From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/page/PerformanceEntry.h | 43 +++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 16 deletions(-) (limited to 'Source/WebCore/page/PerformanceEntry.h') diff --git a/Source/WebCore/page/PerformanceEntry.h b/Source/WebCore/page/PerformanceEntry.h index 129a24640..7ebee6a4c 100644 --- a/Source/WebCore/page/PerformanceEntry.h +++ b/Source/WebCore/page/PerformanceEntry.h @@ -29,14 +29,14 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef PerformanceEntry_h -#define PerformanceEntry_h +#pragma once -#if ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE) +#if ENABLE(WEB_TIMING) #include "Performance.h" -#include +#include #include +#include #include namespace WebCore { @@ -45,31 +45,42 @@ class PerformanceEntry : public RefCounted { public: virtual ~PerformanceEntry(); - String name() const; - String entryType() const; - double startTime() const; - double duration() const; + String name() const { return m_name; } + String entryType() const { return m_entryType; } + double startTime() const { return m_startTime; } + double duration() const { return m_duration; } - virtual bool isResource() { return false; } - virtual bool isMark() { return false; } - virtual bool isMeasure() { return false; } + enum class Type { + Navigation = 1 << 0, + Mark = 1 << 1, + Measure = 1 << 2, + Resource = 1 << 3, + }; - static bool startTimeCompareLessThan(PassRefPtr a, PassRefPtr b) + Type type() const { return m_type; } + + static std::optional parseEntryTypeString(const String& entryType); + + virtual bool isResource() const { return false; } + virtual bool isMark() const { return false; } + virtual bool isMeasure() const { return false; } + + static bool startTimeCompareLessThan(const RefPtr& a, const RefPtr& b) { return a->startTime() < b->startTime(); } protected: - PerformanceEntry(const String& name, const String& entryType, double startTime, double finishTime); + PerformanceEntry(Type, const String& name, const String& entryType, double startTime, double finishTime); private: const String m_name; const String m_entryType; const double m_startTime; const double m_duration; + const Type m_type; }; -} +} // namespace WebCore -#endif // !ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE) -#endif // !defined(PerformanceEntry_h) +#endif // ENABLE(WEB_TIMING) -- cgit v1.2.1