#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/bindings/core/v8/v8_compile_hints_producer.h"
#if BUILDFLAG(PRODUCE_V8_COMPILE_HINTS)
#include "base/rand_util.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_compile_hints_common.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/frame.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/wtf/bloom_filter.h"
#include <limits>
namespace blink::v8_compile_hints {
std::atomic<bool>
V8CrowdsourcedCompileHintsProducer::data_generated_for_this_process_ = …;
namespace {
bool RandomlySelectedToGenerateData() { … }
bool ShouldThisProcessGenerateData() { … }
}
V8CrowdsourcedCompileHintsProducer::V8CrowdsourcedCompileHintsProducer(
Page* page)
: … { … }
void V8CrowdsourcedCompileHintsProducer::RecordScript(
Frame* frame,
ExecutionContext* execution_context,
const v8::Local<v8::Script> script,
ScriptState* script_state) { … }
void V8CrowdsourcedCompileHintsProducer::GenerateData() { … }
void V8CrowdsourcedCompileHintsProducer::Trace(Visitor* visitor) const { … }
void V8CrowdsourcedCompileHintsProducer::ClearData() { … }
namespace {
void ClearDataTask(V8CrowdsourcedCompileHintsProducer* producer) { … }
}
void V8CrowdsourcedCompileHintsProducer::ScheduleDataDeletionTask(
ExecutionContext* execution_context) { … }
bool V8CrowdsourcedCompileHintsProducer::MightGenerateData() { … }
bool V8CrowdsourcedCompileHintsProducer::SendDataToUkm() { … }
void V8CrowdsourcedCompileHintsProducer::AddNoise(unsigned* data) { … }
}
#endif