summaryrefslogtreecommitdiff
path: root/Source/WebCore/page/PerformanceEntry.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/page/PerformanceEntry.cpp
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/page/PerformanceEntry.cpp')
-rw-r--r--Source/WebCore/page/PerformanceEntry.cpp37
1 files changed, 20 insertions, 17 deletions
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::Type> PerformanceEntry::parseEntryTypeString(const String& entryType)
{
- return m_name;
-}
+ if (entryType == "navigation")
+ return std::optional<Type>(Type::Navigation);
-String PerformanceEntry::entryType() const
-{
- return m_entryType;
-}
+ if (RuntimeEnabledFeatures::sharedFeatures().userTimingEnabled()) {
+ if (entryType == "mark")
+ return std::optional<Type>(Type::Mark);
+ if (entryType == "measure")
+ return std::optional<Type>(Type::Measure);
+ }
-double PerformanceEntry::startTime() const
-{
- return m_startTime;
-}
+ if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled()) {
+ if (entryType == "resource")
+ return std::optional<Type>(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)