Commit 0f751883 authored by Nicolas Pena's avatar Nicolas Pena Committed by Commit Bot

PerformanceEntry: Remove composite and render

The two entry types seem to be completely unused.

Change-Id: I0fe32a2b7502d5aa4af0a4f2c3457536810a4a03
Reviewed-on: https://chromium-review.googlesource.com/1183637Reviewed-by: default avatarYoav Weiss <yoav@yoav.ws>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585138}
parent b0e4475e
...@@ -85,14 +85,12 @@ DOMHighResTimeStamp GetUnixAtZeroMonotonic() { ...@@ -85,14 +85,12 @@ DOMHighResTimeStamp GetUnixAtZeroMonotonic() {
using PerformanceObserverVector = HeapVector<Member<PerformanceObserver>>; using PerformanceObserverVector = HeapVector<Member<PerformanceObserver>>;
static const size_t kDefaultResourceTimingBufferSize = 250; static const size_t kDefaultResourceTimingBufferSize = 250;
static const size_t kDefaultFrameTimingBufferSize = 150;
constexpr size_t kDefaultEventTimingBufferSize = 150; constexpr size_t kDefaultEventTimingBufferSize = 150;
Performance::Performance( Performance::Performance(
TimeTicks time_origin, TimeTicks time_origin,
scoped_refptr<base::SingleThreadTaskRunner> task_runner) scoped_refptr<base::SingleThreadTaskRunner> task_runner)
: frame_timing_buffer_size_(kDefaultFrameTimingBufferSize), : resource_timing_buffer_size_(kDefaultResourceTimingBufferSize),
resource_timing_buffer_size_(kDefaultResourceTimingBufferSize),
event_timing_buffer_max_size_(kDefaultEventTimingBufferSize), event_timing_buffer_max_size_(kDefaultEventTimingBufferSize),
user_timing_(nullptr), user_timing_(nullptr),
time_origin_(time_origin), time_origin_(time_origin),
...@@ -143,7 +141,6 @@ PerformanceEntryVector Performance::getEntries() { ...@@ -143,7 +141,6 @@ PerformanceEntryVector Performance::getEntries() {
// calls this method. // calls this method.
if (navigation_timing_) if (navigation_timing_)
entries.push_back(navigation_timing_); entries.push_back(navigation_timing_);
entries.AppendVector(frame_timing_buffer_);
if (user_timing_) { if (user_timing_) {
entries.AppendVector(user_timing_->GetMarks()); entries.AppendVector(user_timing_->GetMarks());
...@@ -189,14 +186,6 @@ PerformanceEntryVector Performance::getEntriesByType( ...@@ -189,14 +186,6 @@ PerformanceEntryVector Performance::getEntriesByType(
if (navigation_timing_) if (navigation_timing_)
entries.push_back(navigation_timing_); entries.push_back(navigation_timing_);
break; break;
case PerformanceEntry::kComposite:
case PerformanceEntry::kRender:
for (const auto& frame : frame_timing_buffer_) {
if (type == frame->EntryTypeEnum()) {
entries.push_back(frame);
}
}
break;
case PerformanceEntry::kMark: case PerformanceEntry::kMark:
if (user_timing_) if (user_timing_)
entries.AppendVector(user_timing_->GetMarks()); entries.AppendVector(user_timing_->GetMarks());
...@@ -273,15 +262,6 @@ PerformanceEntryVector Performance::getEntriesByName( ...@@ -273,15 +262,6 @@ PerformanceEntryVector Performance::getEntriesByName(
entries.push_back(navigation_timing_); entries.push_back(navigation_timing_);
} }
if (entry_type.IsNull() || type == PerformanceEntry::kComposite ||
type == PerformanceEntry::kRender) {
for (const auto& frame : frame_timing_buffer_) {
if (frame->name() == name &&
(entry_type.IsNull() || entry_type == frame->entryType()))
entries.push_back(frame);
}
}
if (user_timing_) { if (user_timing_) {
if (entry_type.IsNull() || type == PerformanceEntry::kMark) if (entry_type.IsNull() || type == PerformanceEntry::kMark)
entries.AppendVector(user_timing_->GetMarks(name)); entries.AppendVector(user_timing_->GetMarks(name));
...@@ -880,7 +860,6 @@ void Performance::BuildJSONValue(V8ObjectBuilder& builder) const { ...@@ -880,7 +860,6 @@ void Performance::BuildJSONValue(V8ObjectBuilder& builder) const {
} }
void Performance::Trace(blink::Visitor* visitor) { void Performance::Trace(blink::Visitor* visitor) {
visitor->Trace(frame_timing_buffer_);
visitor->Trace(resource_timing_buffer_); visitor->Trace(resource_timing_buffer_);
visitor->Trace(event_timing_buffer_); visitor->Trace(event_timing_buffer_);
visitor->Trace(navigation_timing_); visitor->Trace(navigation_timing_);
......
...@@ -250,8 +250,6 @@ class CORE_EXPORT Performance : public EventTargetWithInlineData { ...@@ -250,8 +250,6 @@ class CORE_EXPORT Performance : public EventTargetWithInlineData {
virtual void BuildJSONValue(V8ObjectBuilder&) const; virtual void BuildJSONValue(V8ObjectBuilder&) const;
PerformanceEntryVector frame_timing_buffer_;
unsigned frame_timing_buffer_size_;
PerformanceEntryVector resource_timing_buffer_; PerformanceEntryVector resource_timing_buffer_;
unsigned resource_timing_buffer_size_; unsigned resource_timing_buffer_size_;
PerformanceEntryVector event_timing_buffer_; PerformanceEntryVector event_timing_buffer_;
......
...@@ -58,13 +58,6 @@ DOMHighResTimeStamp PerformanceEntry::duration() const { ...@@ -58,13 +58,6 @@ DOMHighResTimeStamp PerformanceEntry::duration() const {
return duration_; 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() { const AtomicString& PerformanceEntry::EventKeyword() {
DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<AtomicString>, event, ()); DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<AtomicString>, event, ());
if (!event.IsSet()) if (!event.IsSet())
...@@ -114,13 +107,6 @@ const AtomicString& PerformanceEntry::PaintKeyword() { ...@@ -114,13 +107,6 @@ const AtomicString& PerformanceEntry::PaintKeyword() {
return *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() { const AtomicString& PerformanceEntry::ResourceKeyword() {
DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<AtomicString>, resource, ()); DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<AtomicString>, resource, ());
if (!resource.IsSet()) if (!resource.IsSet())
...@@ -138,16 +124,12 @@ const AtomicString& PerformanceEntry::TaskattributionKeyword() { ...@@ -138,16 +124,12 @@ const AtomicString& PerformanceEntry::TaskattributionKeyword() {
PerformanceEntry::EntryType PerformanceEntry::ToEntryTypeEnum( PerformanceEntry::EntryType PerformanceEntry::ToEntryTypeEnum(
const AtomicString& entry_type) { const AtomicString& entry_type) {
if (entry_type == CompositeKeyword())
return kComposite;
if (entry_type == LongtaskKeyword()) if (entry_type == LongtaskKeyword())
return kLongTask; return kLongTask;
if (entry_type == MarkKeyword()) if (entry_type == MarkKeyword())
return kMark; return kMark;
if (entry_type == MeasureKeyword()) if (entry_type == MeasureKeyword())
return kMeasure; return kMeasure;
if (entry_type == RenderKeyword())
return kRender;
if (entry_type == ResourceKeyword()) if (entry_type == ResourceKeyword())
return kResource; return kResource;
if (entry_type == NavigationKeyword()) if (entry_type == NavigationKeyword())
......
...@@ -56,16 +56,14 @@ class CORE_EXPORT PerformanceEntry : public ScriptWrappable { ...@@ -56,16 +56,14 @@ class CORE_EXPORT PerformanceEntry : public ScriptWrappable {
enum EntryType : PerformanceEntryType { enum EntryType : PerformanceEntryType {
kInvalid = 0, kInvalid = 0,
kNavigation = 1 << 0, kNavigation = 1 << 0,
kComposite = 1 << 1, kMark = 1 << 1,
kMark = 1 << 2, kMeasure = 1 << 2,
kMeasure = 1 << 3, kResource = 1 << 3,
kRender = 1 << 4, kLongTask = 1 << 4,
kResource = 1 << 5, kTaskAttribution = 1 << 5,
kLongTask = 1 << 6, kPaint = 1 << 6,
kTaskAttribution = 1 << 7, kEvent = 1 << 7,
kPaint = 1 << 8, kFirstInput = 1 << 8,
kEvent = 1 << 9,
kFirstInput = 1 << 10,
}; };
const AtomicString& name() const { return name_; } const AtomicString& name() const { return name_; }
...@@ -81,8 +79,6 @@ class CORE_EXPORT PerformanceEntry : public ScriptWrappable { ...@@ -81,8 +79,6 @@ class CORE_EXPORT PerformanceEntry : public ScriptWrappable {
ScriptValue toJSONForBinding(ScriptState*) const; ScriptValue toJSONForBinding(ScriptState*) const;
bool IsResource() const { return EntryTypeEnum() == kResource; } 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 IsMark() const { return EntryTypeEnum() == kMark; }
bool IsMeasure() const { return EntryTypeEnum() == kMeasure; } bool IsMeasure() const { return EntryTypeEnum() == kMeasure; }
...@@ -93,7 +89,6 @@ class CORE_EXPORT PerformanceEntry : public ScriptWrappable { ...@@ -93,7 +89,6 @@ class CORE_EXPORT PerformanceEntry : public ScriptWrappable {
return a->startTime() < b->startTime(); return a->startTime() < b->startTime();
} }
static const AtomicString& CompositeKeyword();
static const AtomicString& EventKeyword(); static const AtomicString& EventKeyword();
static const AtomicString& FirstInputKeyword(); static const AtomicString& FirstInputKeyword();
static const AtomicString& LongtaskKeyword(); static const AtomicString& LongtaskKeyword();
...@@ -101,7 +96,6 @@ class CORE_EXPORT PerformanceEntry : public ScriptWrappable { ...@@ -101,7 +96,6 @@ class CORE_EXPORT PerformanceEntry : public ScriptWrappable {
static const AtomicString& MeasureKeyword(); static const AtomicString& MeasureKeyword();
static const AtomicString& NavigationKeyword(); static const AtomicString& NavigationKeyword();
static const AtomicString& PaintKeyword(); static const AtomicString& PaintKeyword();
static const AtomicString& RenderKeyword();
static const AtomicString& ResourceKeyword(); static const AtomicString& ResourceKeyword();
static const AtomicString& TaskattributionKeyword(); static const AtomicString& TaskattributionKeyword();
static PerformanceEntry::EntryType ToEntryTypeEnum( static PerformanceEntry::EntryType ToEntryTypeEnum(
......
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