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.cpp | 37 +++++++++++++++++--------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'Source/WebCore/page/PerformanceEntry.cpp') diff --git a/Source/WebCore/page/PerformanceEntry.cpp b/Source/WebCore/page/PerformanceEntry.cpp index 32db7cfe5..a85fbdb5f 100644 --- a/Source/WebCore/page/PerformanceEntry.cpp +++ b/Source/WebCore/page/PerformanceEntry.cpp @@ -31,15 +31,18 @@ #include "config.h" #include "PerformanceEntry.h" -#if ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE) +#if ENABLE(WEB_TIMING) + +#include "RuntimeEnabledFeatures.h" namespace WebCore { -PerformanceEntry::PerformanceEntry(const String& name, const String& entryType, double startTime, double finishTime) +PerformanceEntry::PerformanceEntry(Type type, const String& name, const String& entryType, double startTime, double finishTime) : m_name(name) , m_entryType(entryType) , m_startTime(startTime) , m_duration(finishTime - startTime) + , m_type(type) { } @@ -47,26 +50,26 @@ PerformanceEntry::~PerformanceEntry() { } -String PerformanceEntry::name() const +std::optional PerformanceEntry::parseEntryTypeString(const String& entryType) { - return m_name; -} + if (entryType == "navigation") + return std::optional(Type::Navigation); -String PerformanceEntry::entryType() const -{ - return m_entryType; -} + if (RuntimeEnabledFeatures::sharedFeatures().userTimingEnabled()) { + if (entryType == "mark") + return std::optional(Type::Mark); + if (entryType == "measure") + return std::optional(Type::Measure); + } -double PerformanceEntry::startTime() const -{ - return m_startTime; -} + if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled()) { + if (entryType == "resource") + return std::optional(Type::Resource); + } -double PerformanceEntry::duration() const -{ - return m_duration; + return std::nullopt; } } // namespace WebCore -#endif // ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE) +#endif // ENABLE(WEB_TIMING) -- cgit v1.2.1