Commit c185601b authored by Nicolas Pena's avatar Nicolas Pena Committed by Commit Bot

Use AtomicString for PerformanceEntry::entryType()

This CL makes PerformanceEntry::entryType() a pure virtual method
instead of storing |entry_type_|. It also changes the usage from String
to AtomicString. Only PerformanceEventTiming keeps |entry_type_| since
it can be 'event' or 'firstInput'.

Since the entry type is no longer available from the PerformanceEntry
constructor, we change EntryTypeEnum() to pure virtual too.

Bug: 852050
Change-Id: Ie02040b52cf17c7563667ef440bbb78ae97e64c7
Reviewed-on: https://chromium-review.googlesource.com/1113671
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: default avatarYoav Weiss <yoav@yoav.ws>
Reviewed-by: default avatarTimothy Dresser <tdresser@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573442}
parent 286c8ef9
<!doctype html>
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
async_test(function(t) {
performance.mark('windowMark');
const worker = new Worker("resources/worker-invalid-entries.js");
worker.onmessage = function(event) {
assert_equals(event.data['invalid'], 0, 'The worker must have 0 invalid entries.');
assert_equals(event.data['mark'], 1, 'The worker must have 1 mark entry.');
assert_equals(event.data['measure'], 0, 'The worker must have 0 measure entries.');
assert_equals(performance.getEntriesByType('invalid').length, 0,
'The window must have 0 invalid entries.');
assert_equals(performance.getEntriesByType('mark').length, 1,
'The window must have 1 mark entry.');
assert_equals(performance.getEntriesByType('measure').length, 0,
'The window must have 0 measure entries.')
t.done();
}
}, 'Get invalid entries from worker and window.');
</script>
</body>
</html>
performance.mark('workerMark');
postMessage({
'invalid' : performance.getEntriesByType('invalid').length,
'mark' : performance.getEntriesByType('mark').length,
'measure' : performance.getEntriesByType('measure').length
});
......@@ -160,7 +160,8 @@ PerformanceEntryVector Performance::getEntries() {
return entries;
}
PerformanceEntryVector Performance::getEntriesByType(const String& entry_type) {
PerformanceEntryVector Performance::getEntriesByType(
const AtomicString& entry_type) {
PerformanceEntryVector entries;
PerformanceEntry::EntryType type =
PerformanceEntry::ToEntryTypeEnum(entry_type);
......@@ -228,8 +229,9 @@ PerformanceEntryVector Performance::getEntriesByType(const String& entry_type) {
return entries;
}
PerformanceEntryVector Performance::getEntriesByName(const String& name,
const String& entry_type) {
PerformanceEntryVector Performance::getEntriesByName(
const String& name,
const AtomicString& entry_type) {
PerformanceEntryVector entries;
PerformanceEntry::EntryType type =
PerformanceEntry::ToEntryTypeEnum(entry_type);
......
......@@ -48,6 +48,7 @@
#include "third_party/blink/renderer/platform/wtf/forward.h"
#include "third_party/blink/renderer/platform/wtf/hash_set.h"
#include "third_party/blink/renderer/platform/wtf/linked_hash_set.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
namespace blink {
......@@ -113,9 +114,9 @@ class CORE_EXPORT Performance : public EventTargetWithInlineData {
double GetTimeOrigin() const { return TimeTicksInSeconds(time_origin_); }
PerformanceEntryVector getEntries();
PerformanceEntryVector getEntriesByType(const String& entry_type);
PerformanceEntryVector getEntriesByType(const AtomicString& entry_type);
PerformanceEntryVector getEntriesByName(const String& name,
const String& entry_type);
const AtomicString& entry_type);
void clearResourceTimings();
void setResourceTimingBufferSize(unsigned);
......
......@@ -41,14 +41,11 @@ static base::AtomicSequenceNumber index_seq;
}
PerformanceEntry::PerformanceEntry(const String& name,
const String& entry_type,
double start_time,
double finish_time)
: duration_(finish_time - start_time),
name_(name),
entry_type_(entry_type),
start_time_(start_time),
entry_type_enum_(ToEntryTypeEnum(entry_type)),
index_(index_seq.GetNext()) {}
PerformanceEntry::~PerformanceEntry() = default;
......@@ -57,10 +54,6 @@ String PerformanceEntry::name() const {
return name_;
}
String PerformanceEntry::entryType() const {
return entry_type_;
}
DOMHighResTimeStamp PerformanceEntry::startTime() const {
return start_time_;
}
......@@ -69,29 +62,107 @@ DOMHighResTimeStamp PerformanceEntry::duration() const {
return duration_;
}
const AtomicString& PerformanceEntry::CompositeKeyword() {
DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<AtomicString>, composite, ());
if (!composite.IsSet())
*composite = "composite";
return *composite;
}
const AtomicString& PerformanceEntry::EventKeyword() {
DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<AtomicString>, event, ());
if (!event.IsSet())
*event = "event";
return *event;
}
const AtomicString& PerformanceEntry::FirstInputKeyword() {
DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<AtomicString>, firstInput, ());
if (!firstInput.IsSet())
*firstInput = "firstInput";
return *firstInput;
}
const AtomicString& PerformanceEntry::LongtaskKeyword() {
DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<AtomicString>, longtask, ());
if (!longtask.IsSet())
*longtask = "longtask";
return *longtask;
}
const AtomicString& PerformanceEntry::MarkKeyword() {
DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<AtomicString>, mark, ());
if (!mark.IsSet())
*mark = "mark";
return *mark;
}
const AtomicString& PerformanceEntry::MeasureKeyword() {
DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<AtomicString>, measure, ());
if (!measure.IsSet())
*measure = "measure";
return *measure;
}
const AtomicString& PerformanceEntry::NavigationKeyword() {
DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<AtomicString>, navigation, ());
if (!navigation.IsSet())
*navigation = "navigation";
return *navigation;
}
const AtomicString& PerformanceEntry::PaintKeyword() {
DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<AtomicString>, paint, ());
if (!paint.IsSet())
*paint = "paint";
return *paint;
}
const AtomicString& PerformanceEntry::RenderKeyword() {
DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<AtomicString>, render, ());
if (!render.IsSet())
*render = "render";
return *render;
}
const AtomicString& PerformanceEntry::ResourceKeyword() {
DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<AtomicString>, resource, ());
if (!resource.IsSet())
*resource = "resource";
return *resource;
}
const AtomicString& PerformanceEntry::TaskattributionKeyword() {
DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<AtomicString>, taskattribution,
());
if (!taskattribution.IsSet())
*taskattribution = "taskattribution";
return *taskattribution;
}
PerformanceEntry::EntryType PerformanceEntry::ToEntryTypeEnum(
const String& entry_type) {
if (entry_type == "composite")
const AtomicString& entry_type) {
if (entry_type == CompositeKeyword())
return kComposite;
if (entry_type == "longtask")
if (entry_type == LongtaskKeyword())
return kLongTask;
if (entry_type == "mark")
if (entry_type == MarkKeyword())
return kMark;
if (entry_type == "measure")
if (entry_type == MeasureKeyword())
return kMeasure;
if (entry_type == "render")
if (entry_type == RenderKeyword())
return kRender;
if (entry_type == "resource")
if (entry_type == ResourceKeyword())
return kResource;
if (entry_type == "navigation")
if (entry_type == NavigationKeyword())
return kNavigation;
if (entry_type == "taskattribution")
if (entry_type == TaskattributionKeyword())
return kTaskAttribution;
if (entry_type == "paint")
if (entry_type == PaintKeyword())
return kPaint;
if (entry_type == "event")
if (entry_type == EventKeyword())
return kEvent;
if (entry_type == "firstInput")
if (entry_type == FirstInputKeyword())
return kFirstInput;
return kInvalid;
}
......
......@@ -69,8 +69,9 @@ class CORE_EXPORT PerformanceEntry : public ScriptWrappable {
};
String name() const;
String entryType() const;
DOMHighResTimeStamp startTime() const;
virtual AtomicString entryType() const = 0;
virtual PerformanceEntryType EntryTypeEnum() const = 0;
// PerformanceNavigationTiming will override this due to
// the nature of reporting it early, which means not having a
// finish time available at construction time.
......@@ -79,13 +80,11 @@ class CORE_EXPORT PerformanceEntry : public ScriptWrappable {
ScriptValue toJSONForBinding(ScriptState*) const;
PerformanceEntryType EntryTypeEnum() const { return entry_type_enum_; }
bool IsResource() const { return entry_type_enum_ == kResource; }
bool IsRender() const { return entry_type_enum_ == kRender; }
bool IsComposite() const { return entry_type_enum_ == kComposite; }
bool IsMark() const { return entry_type_enum_ == kMark; }
bool IsMeasure() const { return entry_type_enum_ == kMeasure; }
bool IsResource() const { return EntryTypeEnum() == kResource; }
bool IsRender() const { return EntryTypeEnum() == kRender; }
bool IsComposite() const { return EntryTypeEnum() == kComposite; }
bool IsMark() const { return EntryTypeEnum() == kMark; }
bool IsMeasure() const { return EntryTypeEnum() == kMeasure; }
static bool StartTimeCompareLessThan(PerformanceEntry* a,
PerformanceEntry* b) {
......@@ -94,11 +93,22 @@ class CORE_EXPORT PerformanceEntry : public ScriptWrappable {
return a->startTime() < b->startTime();
}
static PerformanceEntry::EntryType ToEntryTypeEnum(const String& entry_type);
static const AtomicString& CompositeKeyword();
static const AtomicString& EventKeyword();
static const AtomicString& FirstInputKeyword();
static const AtomicString& LongtaskKeyword();
static const AtomicString& MarkKeyword();
static const AtomicString& MeasureKeyword();
static const AtomicString& NavigationKeyword();
static const AtomicString& PaintKeyword();
static const AtomicString& RenderKeyword();
static const AtomicString& ResourceKeyword();
static const AtomicString& TaskattributionKeyword();
static PerformanceEntry::EntryType ToEntryTypeEnum(
const AtomicString& entry_type);
protected:
PerformanceEntry(const String& name,
const String& entry_type,
double start_time,
double finish_time);
virtual void BuildJSONValue(V8ObjectBuilder&) const;
......@@ -108,9 +118,7 @@ class CORE_EXPORT PerformanceEntry : public ScriptWrappable {
private:
const String name_;
const String entry_type_;
const double start_time_;
const PerformanceEntryType entry_type_enum_;
const int index_;
};
......
......@@ -18,35 +18,42 @@ PerformanceEventTiming* PerformanceEventTiming::Create(
// TODO(npm): enable this DCHECK once https://crbug.com/852846 is fixed.
// DCHECK_LE(start_time, processing_start);
DCHECK_LE(processing_start, processing_end);
return new PerformanceEventTiming(event_type, "event", start_time,
processing_start, processing_end,
cancelable);
return new PerformanceEventTiming(
event_type, PerformanceEntry::EventKeyword(), start_time,
processing_start, processing_end, cancelable);
}
// static
PerformanceEventTiming* PerformanceEventTiming::CreateFirstInputTiming(
PerformanceEventTiming* entry) {
PerformanceEventTiming* first_input = new PerformanceEventTiming(
entry->name(), "firstInput", entry->startTime(), entry->processingStart(),
entry->processingEnd(), entry->cancelable());
entry->name(), PerformanceEntry::FirstInputKeyword(), entry->startTime(),
entry->processingStart(), entry->processingEnd(), entry->cancelable());
first_input->SetDuration(entry->duration());
return first_input;
}
PerformanceEventTiming::PerformanceEventTiming(
const String& event_type,
const String& entry_type,
const AtomicString& entry_type,
DOMHighResTimeStamp start_time,
DOMHighResTimeStamp processing_start,
DOMHighResTimeStamp processing_end,
bool cancelable)
: PerformanceEntry(event_type, entry_type, start_time, 0.0),
: PerformanceEntry(event_type, start_time, 0.0),
entry_type_(entry_type),
processing_start_(processing_start),
processing_end_(processing_end),
cancelable_(cancelable) {}
PerformanceEventTiming::~PerformanceEventTiming() = default;
PerformanceEntryType PerformanceEventTiming::EntryTypeEnum() const {
return entry_type_ == PerformanceEntry::EventKeyword()
? PerformanceEntry::EntryType::kEvent
: PerformanceEntry::EntryType::kFirstInput;
}
DOMHighResTimeStamp PerformanceEventTiming::processingStart() const {
return processing_start_;
}
......
......@@ -27,6 +27,9 @@ class CORE_EXPORT PerformanceEventTiming final : public PerformanceEntry {
~PerformanceEventTiming() override;
AtomicString entryType() const override { return entry_type_; }
PerformanceEntryType EntryTypeEnum() const override;
bool cancelable() const { return cancelable_; }
DOMHighResTimeStamp processingStart() const;
......@@ -40,11 +43,12 @@ class CORE_EXPORT PerformanceEventTiming final : public PerformanceEntry {
private:
PerformanceEventTiming(const String& event_type,
const String& entry_type,
const AtomicString& entry_type,
DOMHighResTimeStamp start_time,
DOMHighResTimeStamp processing_start,
DOMHighResTimeStamp processing_end,
bool cancelable);
AtomicString entry_type_;
DOMHighResTimeStamp processing_start_;
DOMHighResTimeStamp processing_end_;
bool cancelable_;
......
......@@ -34,7 +34,7 @@ PerformanceLongTaskTiming::PerformanceLongTaskTiming(
String culprit_frame_id,
String culprit_frame_name,
const SubTaskAttribution::EntriesVector& sub_task_attributions)
: PerformanceEntry(name, "longtask", start_time, end_time) {
: PerformanceEntry(name, start_time, end_time) {
// Only one possible container type exists currently: "iframe".
if (RuntimeEnabledFeatures::LongTaskV2Enabled()) {
for (auto&& it : sub_task_attributions) {
......@@ -55,6 +55,14 @@ PerformanceLongTaskTiming::PerformanceLongTaskTiming(
PerformanceLongTaskTiming::~PerformanceLongTaskTiming() = default;
AtomicString PerformanceLongTaskTiming::entryType() const {
return PerformanceEntry::LongtaskKeyword();
}
PerformanceEntryType PerformanceLongTaskTiming::EntryTypeEnum() const {
return PerformanceEntry::EntryType::kLongTask;
}
TaskAttributionVector PerformanceLongTaskTiming::attribution() const {
return attribution_;
}
......
......@@ -29,6 +29,9 @@ class PerformanceLongTaskTiming final : public PerformanceEntry {
String frame_name,
const SubTaskAttribution::EntriesVector& sub_task_attributions);
AtomicString entryType() const override;
PerformanceEntryType EntryTypeEnum() const override;
TaskAttributionVector attribution() const;
void Trace(blink::Visitor*) override;
......
......@@ -13,7 +13,7 @@ PerformanceMark::PerformanceMark(ScriptState* script_state,
const String& name,
double start_time,
const ScriptValue& detail)
: PerformanceEntry(name, "mark", start_time, start_time) {
: PerformanceEntry(name, start_time, start_time) {
world_ = WrapRefCounted(&script_state->World());
if (detail.IsEmpty() || detail.IsNull() || detail.IsUndefined()) {
return;
......@@ -21,6 +21,14 @@ PerformanceMark::PerformanceMark(ScriptState* script_state,
detail_.Set(detail.GetIsolate(), detail.V8Value());
}
AtomicString PerformanceMark::entryType() const {
return PerformanceEntry::MarkKeyword();
}
PerformanceEntryType PerformanceMark::EntryTypeEnum() const {
return PerformanceEntry::EntryType::kMark;
}
ScriptValue PerformanceMark::detail(ScriptState* script_state) const {
v8::Isolate* isolate = script_state->GetIsolate();
if (detail_.IsEmpty()) {
......
......@@ -44,6 +44,9 @@ class CORE_EXPORT PerformanceMark final : public PerformanceEntry {
return new PerformanceMark(script_state, name, start_time, detail);
}
AtomicString entryType() const override;
PerformanceEntryType EntryTypeEnum() const override;
ScriptValue detail(ScriptState*) const;
void Trace(blink::Visitor*) override;
......
......@@ -14,7 +14,7 @@ PerformanceMeasure::PerformanceMeasure(ScriptState* script_state,
double start_time,
double end_time,
const ScriptValue& detail)
: PerformanceEntry(name, "measure", start_time, end_time) {
: PerformanceEntry(name, start_time, end_time) {
if (detail.IsEmpty()) {
detail_ = SerializedScriptValue::NullValue();
} else {
......@@ -29,4 +29,12 @@ ScriptValue PerformanceMeasure::detail(ScriptState* script_state) const {
return ScriptValue(script_state, detail);
}
AtomicString PerformanceMeasure::entryType() const {
return PerformanceEntry::MeasureKeyword();
}
PerformanceEntryType PerformanceMeasure::EntryTypeEnum() const {
return PerformanceEntry::EntryType::kMeasure;
}
} // namespace blink
......@@ -48,6 +48,9 @@ class PerformanceMeasure final : public PerformanceEntry {
}
ScriptValue detail(ScriptState*) const;
AtomicString entryType() const override;
PerformanceEntryType EntryTypeEnum() const override;
void Trace(blink::Visitor* visitor) override {
PerformanceEntry::Trace(visitor);
}
......
......@@ -23,7 +23,6 @@ PerformanceNavigationTiming::PerformanceNavigationTiming(
const WebVector<WebServerTimingInfo>& server_timing)
: PerformanceResourceTiming(
info ? info->FinalResponse().Url().GetString() : "",
"navigation",
time_origin,
server_timing),
ContextClient(frame),
......@@ -34,6 +33,14 @@ PerformanceNavigationTiming::PerformanceNavigationTiming(
PerformanceNavigationTiming::~PerformanceNavigationTiming() = default;
AtomicString PerformanceNavigationTiming::entryType() const {
return PerformanceEntry::NavigationKeyword();
}
PerformanceEntryType PerformanceNavigationTiming::EntryTypeEnum() const {
return PerformanceEntry::EntryType::kNavigation;
}
void PerformanceNavigationTiming::Trace(blink::Visitor* visitor) {
ContextClient::Trace(visitor);
PerformanceResourceTiming::Trace(visitor);
......@@ -110,7 +117,7 @@ AtomicString PerformanceNavigationTiming::GetNavigationType(
}
AtomicString PerformanceNavigationTiming::initiatorType() const {
return "navigation";
return PerformanceEntry::NavigationKeyword();
}
bool PerformanceNavigationTiming::GetAllowRedirectDetails() const {
......
......@@ -38,6 +38,8 @@ class CORE_EXPORT PerformanceNavigationTiming final
// Attributes inheritted from PerformanceEntry.
DOMHighResTimeStamp duration() const override;
AtomicString entryType() const override;
PerformanceEntryType EntryTypeEnum() const override;
AtomicString initiatorType() const override;
......
......@@ -73,8 +73,10 @@ void PerformanceObserver::observe(const PerformanceObserverInit& observer_init,
PerformanceEntryTypeMask entry_types = PerformanceEntry::kInvalid;
if (observer_init.hasEntryTypes() && observer_init.entryTypes().size()) {
const Vector<String>& sequence = observer_init.entryTypes();
for (const auto& entry_type_string : sequence)
entry_types |= PerformanceEntry::ToEntryTypeEnum(entry_type_string);
for (const auto& entry_type_string : sequence) {
entry_types |=
PerformanceEntry::ToEntryTypeEnum(AtomicString(entry_type_string));
}
}
if (entry_types == PerformanceEntry::kInvalid) {
exception_state.ThrowTypeError(
......
......@@ -27,7 +27,7 @@ PerformanceEntryVector PerformanceObserverEntryList::getEntries() const {
}
PerformanceEntryVector PerformanceObserverEntryList::getEntriesByType(
const String& entry_type) {
const AtomicString& entry_type) {
PerformanceEntryVector entries;
PerformanceEntry::EntryType type =
PerformanceEntry::ToEntryTypeEnum(entry_type);
......@@ -48,7 +48,7 @@ PerformanceEntryVector PerformanceObserverEntryList::getEntriesByType(
PerformanceEntryVector PerformanceObserverEntryList::getEntriesByName(
const String& name,
const String& entry_type) {
const AtomicString& entry_type) {
PerformanceEntryVector entries;
PerformanceEntry::EntryType type =
PerformanceEntry::ToEntryTypeEnum(entry_type);
......
......@@ -8,6 +8,7 @@
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
#include "third_party/blink/renderer/platform/wtf/forward.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"
namespace blink {
......@@ -23,9 +24,9 @@ class PerformanceObserverEntryList : public ScriptWrappable {
~PerformanceObserverEntryList() override;
PerformanceEntryVector getEntries() const;
PerformanceEntryVector getEntriesByType(const String& entry_type);
PerformanceEntryVector getEntriesByType(const AtomicString& entry_type);
PerformanceEntryVector getEntriesByName(const String& name,
const String& entry_type);
const AtomicString& entry_type);
void Trace(blink::Visitor*) override;
......
......@@ -11,12 +11,19 @@ namespace blink {
PerformancePaintTiming::PerformancePaintTiming(PaintType type,
double start_time)
: PerformanceEntry(FromPaintTypeToString(type),
"paint",
start_time,
start_time) {}
PerformancePaintTiming::~PerformancePaintTiming() = default;
AtomicString PerformancePaintTiming::entryType() const {
return PerformanceEntry::PaintKeyword();
}
PerformanceEntryType PerformancePaintTiming::EntryTypeEnum() const {
return PerformanceEntry::EntryType::kPaint;
}
String PerformancePaintTiming::FromPaintTypeToString(PaintType type) {
switch (type) {
case PaintType::kFirstPaint:
......
......@@ -19,6 +19,9 @@ class CORE_EXPORT PerformancePaintTiming final : public PerformanceEntry {
PerformancePaintTiming(PaintType, double start_time);
~PerformancePaintTiming() override;
AtomicString entryType() const override;
PerformanceEntryType EntryTypeEnum() const override;
static String FromPaintTypeToString(PaintType);
};
} // namespace blink
......
......@@ -46,7 +46,6 @@ PerformanceResourceTiming::PerformanceResourceTiming(
TimeTicks time_origin,
const AtomicString& initiator_type)
: PerformanceEntry(info.name,
"resource",
Performance::MonotonicTimeToDOMHighResTimeStamp(
time_origin,
info.start_time,
......@@ -78,16 +77,23 @@ PerformanceResourceTiming::PerformanceResourceTiming(
// This constructor is for PerformanceNavigationTiming.
PerformanceResourceTiming::PerformanceResourceTiming(
const String& name,
const String& entry_type,
TimeTicks time_origin,
const WebVector<WebServerTimingInfo>& server_timing)
: PerformanceEntry(name, entry_type, 0.0, 0.0),
: PerformanceEntry(name, 0.0, 0.0),
time_origin_(time_origin),
server_timing_(
PerformanceServerTiming::FromParsedServerTiming(server_timing)) {}
PerformanceResourceTiming::~PerformanceResourceTiming() = default;
AtomicString PerformanceResourceTiming::entryType() const {
return PerformanceEntry::ResourceKeyword();
}
PerformanceEntryType PerformanceResourceTiming::EntryTypeEnum() const {
return PerformanceEntry::EntryType::kResource;
}
ResourceLoadTiming* PerformanceResourceTiming::GetResourceLoadTiming() const {
return timing_.get();
}
......
......@@ -57,6 +57,9 @@ class CORE_EXPORT PerformanceResourceTiming : public PerformanceEntry {
return new PerformanceResourceTiming(info, time_origin, initiator_type);
}
AtomicString entryType() const override;
PerformanceEntryType EntryTypeEnum() const override;
// Related doc: https://goo.gl/uNecAj.
virtual AtomicString initiatorType() const;
AtomicString nextHopProtocol() const;
......@@ -85,7 +88,6 @@ class CORE_EXPORT PerformanceResourceTiming : public PerformanceEntry {
// This constructor is for PerformanceNavigationTiming.
// Related doc: https://goo.gl/uNecAj.
PerformanceResourceTiming(const String& name,
const String& entry_type,
TimeTicks time_origin,
const WebVector<WebServerTimingInfo>&);
virtual AtomicString AlpnNegotiatedProtocol() const;
......
......@@ -17,7 +17,7 @@ TaskAttributionTiming::TaskAttributionTiming(String name,
double start_time,
double finish_time,
String script_url)
: PerformanceEntry(name, "taskattribution", start_time, finish_time),
: PerformanceEntry(name, start_time, finish_time),
container_type_(container_type),
container_src_(container_src),
container_id_(container_id),
......@@ -26,6 +26,14 @@ TaskAttributionTiming::TaskAttributionTiming(String name,
TaskAttributionTiming::~TaskAttributionTiming() = default;
AtomicString TaskAttributionTiming::entryType() const {
return PerformanceEntry::TaskattributionKeyword();
}
PerformanceEntryType TaskAttributionTiming::EntryTypeEnum() const {
return PerformanceEntry::EntryType::kTaskAttribution;
}
String TaskAttributionTiming::scriptURL() const {
return script_url_;
}
......
......@@ -40,6 +40,10 @@ class TaskAttributionTiming final : public PerformanceEntry {
container_id, container_name, 0.0, 0.0,
g_empty_string);
}
AtomicString entryType() const override;
PerformanceEntryType EntryTypeEnum() const override;
String containerType() const;
String containerSrc() const;
String containerId() const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment