#include "third_party/blink/renderer/core/timing/performance_user_timing.h"
#include "base/trace_event/typed_macros.h"
#include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom-shared.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_performance_mark_options.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_union_double_string.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/performance_entry_names.h"
#include "third_party/blink/renderer/core/timing/performance.h"
#include "third_party/blink/renderer/core/timing/performance_mark.h"
#include "third_party/blink/renderer/core/timing/performance_measure.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/bindings/source_location.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/wtf/text/string_hash.h"
namespace blink {
namespace {
bool IsTracingEnabled() { … }
}
UserTiming::UserTiming(Performance& performance) : … { … }
String UserTiming::GetSerializedDetail(const ScriptValue& detail) { … }
void UserTiming::AddMarkToPerformanceTimeline(
PerformanceMark& mark,
PerformanceMarkOptions* mark_options) { … }
void UserTiming::ClearMarks(const AtomicString& mark_name) { … }
const PerformanceMark* UserTiming::FindExistingMark(
const AtomicString& mark_name) { … }
double UserTiming::FindExistingMarkStartTime(const AtomicString& mark_name,
ExceptionState& exception_state) { … }
double UserTiming::GetTimeOrFindMarkTime(
const AtomicString& measure_name,
const V8UnionDoubleOrString* mark_or_time,
ExceptionState& exception_state) { … }
base::TimeTicks UserTiming::GetPerformanceMarkUnsafeTimeForTraces(
double start_time,
const V8UnionDoubleOrString* maybe_mark_name) { … }
PerformanceMeasure* UserTiming::Measure(ScriptState* script_state,
const AtomicString& measure_name,
const V8UnionDoubleOrString* start,
const std::optional<double>& duration,
const V8UnionDoubleOrString* end,
const ScriptValue& detail,
ExceptionState& exception_state,
DOMWindow* source) { … }
void UserTiming::ClearMeasures(const AtomicString& measure_name) { … }
PerformanceEntryVector UserTiming::GetMarks() const { … }
PerformanceEntryVector UserTiming::GetMarks(const AtomicString& name) const { … }
PerformanceEntryVector UserTiming::GetMeasures() const { … }
PerformanceEntryVector UserTiming::GetMeasures(const AtomicString& name) const { … }
void UserTiming::InsertPerformanceEntry(
PerformanceEntryMap& performance_entry_map,
PerformanceEntryVector& performance_entry_buffer,
PerformanceEntry& entry) { … }
void UserTiming::ClearPerformanceEntries(
PerformanceEntryMap& performance_entry_map,
PerformanceEntryVector& performance_entry_buffer,
const AtomicString& name) { … }
void UserTiming::Trace(Visitor* visitor) const { … }
}