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

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

Issue 1198863006: First version of PerformanceObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code review comments Created 5 years, 3 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
« no previous file with comments | « Source/core/timing/PerformanceCompositeTiming.h ('k') | Source/core/timing/PerformanceEntry.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/timing/PerformanceEntry.h
diff --git a/Source/core/timing/PerformanceEntry.h b/Source/core/timing/PerformanceEntry.h
index 7c992f4649ed71d960a73631a8d937c71b386828..0bc7107a91756c4b7ccb3ef591fc1026afe01e8f 100644
--- a/Source/core/timing/PerformanceEntry.h
+++ b/Source/core/timing/PerformanceEntry.h
@@ -42,11 +42,23 @@ namespace blink {
class ScriptState;
class ScriptValue;
+using PerformanceEntryType = unsigned char;
+using PerformanceEntryTypeMask = unsigned char;
+
class CORE_EXPORT PerformanceEntry : public GarbageCollectedFinalized<PerformanceEntry>, public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
virtual ~PerformanceEntry();
+ enum EntryType {
+ Invalid = 0,
+ Composite = 1 << 1,
+ Mark = 1 << 2,
+ Measure = 1 << 3,
+ Render = 1 << 4,
+ Resource = 1 << 5,
+ };
+
String name() const;
String entryType() const;
double startTime() const;
@@ -54,17 +66,21 @@ public:
ScriptValue toJSONForBinding(ScriptState*) const;
- virtual bool isResource() { return false; }
- virtual bool isRender() { return false; }
- virtual bool isComposite() { return false; }
- virtual bool isMark() { return false; }
- virtual bool isMeasure() { return false; }
+ PerformanceEntryType entryTypeEnum() const { return m_entryTypeEnum; }
+
+ bool isResource() const { return m_entryTypeEnum == Resource; }
+ bool isRender() const { return m_entryTypeEnum == Render; }
+ bool isComposite() const { return m_entryTypeEnum == Composite; }
+ bool isMark() const { return m_entryTypeEnum == Mark; }
+ bool isMeasure() const { return m_entryTypeEnum == Measure; }
static bool startTimeCompareLessThan(PerformanceEntry* a, PerformanceEntry* b)
{
return a->startTime() < b->startTime();
}
+ static EntryType toEntryTypeEnum(const String& entryType);
+
DEFINE_INLINE_VIRTUAL_TRACE() { }
protected:
@@ -75,6 +91,7 @@ private:
const String m_entryType;
const double m_startTime;
const double m_duration;
+ const PerformanceEntryType m_entryTypeEnum;
};
} // namespace blink
« no previous file with comments | « Source/core/timing/PerformanceCompositeTiming.h ('k') | Source/core/timing/PerformanceEntry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698