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() {
using PerformanceObserverVector = HeapVector<Member<PerformanceObserver>>;
static const size_t kDefaultResourceTimingBufferSize = 250;
static const size_t kDefaultFrameTimingBufferSize = 150;
constexpr size_t kDefaultEventTimingBufferSize = 150;
Performance::Performance(
TimeTicks time_origin,
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),
user_timing_(nullptr),
time_origin_(time_origin),
......@@ -143,7 +141,6 @@ PerformanceEntryVector Performance::getEntries() {
// calls this method.
if (navigation_timing_)
entries.push_back(navigation_timing_);
entries.AppendVector(frame_timing_buffer_);
if (user_timing_) {
entries.AppendVector(user_timing_->GetMarks());
......@@ -189,14 +186,6 @@ PerformanceEntryVector Performance::getEntriesByType(
if (navigation_timing_)
entries.push_back(navigation_timing_);
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:
if (user_timing_)
entries.AppendVector(user_timing_->GetMarks());
......@@ -273,15 +262,6 @@ PerformanceEntryVector Performance::getEntriesByName(
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 (entry_type.IsNull() || type == PerformanceEntry::kMark)
entries.AppendVector(user_timing_->GetMarks(name));
......@@ -880,7 +860,6 @@ void Performance::BuildJSONValue(V8ObjectBuilder& builder) const {
}
void Performance::Trace(blink::Visitor* visitor) {
visitor->Trace(frame_timing_buffer_);
visitor->Trace(resource_timing_buffer_);
visitor->Trace(event_timing_buffer_);
visitor->Trace(navigation_timing_);
......
......@@ -250,8 +250,6 @@ class CORE_EXPORT Performance : public EventTargetWithInlineData {
virtual void BuildJSONValue(V8ObjectBuilder&) const;
PerformanceEntryVector frame_timing_buffer_;
unsigned frame_timing_buffer_size_;
PerformanceEntryVector resource_timing_buffer_;
unsigned resource_timing_buffer_size_;
PerformanceEntryVector event_timing_buffer_;
......
......@@ -58,13 +58,6 @@ 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())
......@@ -114,13 +107,6 @@ const AtomicString& PerformanceEntry::PaintKeyword() {
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())
......@@ -138,16 +124,12 @@ const AtomicString& PerformanceEntry::TaskattributionKeyword() {
PerformanceEntry::EntryType PerformanceEntry::ToEntryTypeEnum(
const AtomicString& entry_type) {
if (entry_type == CompositeKeyword())
return kComposite;
if (entry_type == LongtaskKeyword())
return kLongTask;
if (entry_type == MarkKeyword())
return kMark;
if (entry_type == MeasureKeyword())
return kMeasure;
if (entry_type == RenderKeyword())
return kRender;
if (entry_type == ResourceKeyword())
return kResource;
if (entry_type == NavigationKeyword())
......
......@@ -56,16 +56,14 @@ class CORE_EXPORT PerformanceEntry : public ScriptWrappable {
enum EntryType : PerformanceEntryType {
kInvalid = 0,
kNavigation = 1 << 0,
kComposite = 1 << 1,
kMark = 1 << 2,
kMeasure = 1 << 3,
kRender = 1 << 4,
kResource = 1 << 5,
kLongTask = 1 << 6,
kTaskAttribution = 1 << 7,
kPaint = 1 << 8,
kEvent = 1 << 9,
kFirstInput = 1 << 10,
kMark = 1 << 1,
kMeasure = 1 << 2,
kResource = 1 << 3,
kLongTask = 1 << 4,
kTaskAttribution = 1 << 5,
kPaint = 1 << 6,
kEvent = 1 << 7,
kFirstInput = 1 << 8,
};
const AtomicString& name() const { return name_; }
......@@ -81,8 +79,6 @@ class CORE_EXPORT PerformanceEntry : public ScriptWrappable {
ScriptValue toJSONForBinding(ScriptState*) const;
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; }
......@@ -93,7 +89,6 @@ class CORE_EXPORT PerformanceEntry : public ScriptWrappable {
return a->startTime() < b->startTime();
}
static const AtomicString& CompositeKeyword();
static const AtomicString& EventKeyword();
static const AtomicString& FirstInputKeyword();
static const AtomicString& LongtaskKeyword();
......@@ -101,7 +96,6 @@ class CORE_EXPORT PerformanceEntry : public ScriptWrappable {
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(
......
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