Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1512)

Unified Diff: Source/core/timing/PerformanceEntry.cpp

Issue 1198863006: First version of PerformanceObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Switch from microtask to timer for firing events. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/timing/PerformanceEntry.cpp
diff --git a/Source/core/timing/PerformanceEntry.cpp b/Source/core/timing/PerformanceEntry.cpp
index 83b802b935c41dc76f5c7cc2ab48a31d5d61e4c9..0bac75547c123000c0a55c3ee017de620ba2b4e3 100644
--- a/Source/core/timing/PerformanceEntry.cpp
+++ b/Source/core/timing/PerformanceEntry.cpp
@@ -41,6 +41,7 @@ PerformanceEntry::PerformanceEntry(const String& name, const String& entryType,
, m_entryType(entryType)
, m_startTime(startTime)
, m_duration(finishTime - startTime)
+ , m_entryTypeEnum(toEntryTypeEnum(entryType))
{
}
@@ -68,6 +69,21 @@ double PerformanceEntry::duration() const
return m_duration;
}
+PerformanceEntry::EntryType PerformanceEntry::toEntryTypeEnum(const String& entryType)
+{
+ if (equalIgnoringCase(entryType, "composite"))
+ return Composite;
+ if (equalIgnoringCase(entryType, "mark"))
+ return Mark;
+ if (equalIgnoringCase(entryType, "measure"))
+ return Measure;
+ if (equalIgnoringCase(entryType, "render"))
+ return Render;
+ if (equalIgnoringCase(entryType, "resource"))
+ return Resource;
esprehn 2015/07/24 08:23:12 This is fine for now, but we'd probably use a sort
+ return Invalid;
+}
+
ScriptValue PerformanceEntry::toJSONForBinding(ScriptState* scriptState) const
{
V8ObjectBuilder result(scriptState);

Powered by Google App Engine
This is Rietveld 408576698