Diff
Modified: trunk/LayoutTests/ChangeLog (231708 => 231709)
--- trunk/LayoutTests/ChangeLog 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/LayoutTests/ChangeLog 2018-05-11 18:33:43 UTC (rev 231709)
@@ -1,3 +1,17 @@
+2018-05-11 Charles Vazac <[email protected]>
+
+ Runtime feature flag for Server-Timing
+ https://bugs.webkit.org/show_bug.cgi?id=184758
+
+ Reviewed by Youenn Fablet.
+
+ * imported/w3c/resources/import-expectations.json: Import server-timing tests.
+ * imported/w3c/web-platform-tests/server-timing/resource_timing_idl.html: Added.
+ * imported/w3c/web-platform-tests/server-timing/resource_timing_idl-expected.txt: Added.
+ * platform/ios-wk1/TestExpectations: Skip service-worker test.
+ * platform/mac-wk1/TestExpectations: Skip service-worker test.
+ * platform/win/TestExpectations: Skip service-worker test.
+
2018-05-11 Youenn Fablet <[email protected]>
Layout Test webrtc/addICECandidate-closed.html is a flaky failure
Modified: trunk/LayoutTests/imported/w3c/resources/import-expectations.json (231708 => 231709)
--- trunk/LayoutTests/imported/w3c/resources/import-expectations.json 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/LayoutTests/imported/w3c/resources/import-expectations.json 2018-05-11 18:33:43 UTC (rev 231709)
@@ -290,7 +290,7 @@
"web-platform-tests/selection": "skip",
"web-platform-tests/selectors": "skip",
"web-platform-tests/selectors-api": "skip",
- "web-platform-tests/server-timing": "skip",
+ "web-platform-tests/server-timing": "import",
"web-platform-tests/service-workers/cache-storage": "import",
"web-platform-tests/service-workers/service-worker": "import",
"web-platform-tests/service-workers/tools": "import",
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/server-timing/resource_timing_idl-expected.txt (0 => 231709)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/server-timing/resource_timing_idl-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/server-timing/resource_timing_idl-expected.txt 2018-05-11 18:33:43 UTC (rev 231709)
@@ -0,0 +1,3 @@
+
+PASS Untitled
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/server-timing/resource_timing_idl.html (0 => 231709)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/server-timing/resource_timing_idl.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/server-timing/resource_timing_idl.html 2018-05-11 18:33:43 UTC (rev 231709)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<head>
+ <meta charset='utf-8' />
+ <script src=""
+ <script src=''></script>
+ <script>
+ setup({explicit_done: true})
+ window.addEventListener('load', function(){
+ assert_not_equals(typeof performance.getEntriesByType('resource')[0].serverTiming, 'undefined',
+ 'An instance of `PerformanceResourceTiming` should have a `serverTiming` attribute.')
+ done()
+ })
+ </script>
+</head>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/server-timing/service_worker_idl-expected.txt (0 => 231709)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/server-timing/service_worker_idl-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/server-timing/service_worker_idl-expected.txt 2018-05-11 18:33:43 UTC (rev 231709)
@@ -0,0 +1,3 @@
+
+PASS Untitled
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/server-timing/service_worker_idl.html (0 => 231709)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/server-timing/service_worker_idl.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/server-timing/service_worker_idl.html 2018-05-11 18:33:43 UTC (rev 231709)
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<head>
+ <meta charset='utf-8' />
+ <script src=""
+ <script src=''></script>
+ <script>
+ (async () => {
+ const scope = 'does/not/exist'
+
+ let registration = await navigator.serviceWorker.getRegistration(scope)
+ if (registration)
+ await registration.unregister()
+ registration = await navigator.serviceWorker.register('./sw.js', {scope})
+
+ fetch_tests_from_worker(registration.installing)
+ })()
+ </script>
+</head>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/server-timing/sw.js (0 => 231709)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/server-timing/sw.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/server-timing/sw.js 2018-05-11 18:33:43 UTC (rev 231709)
@@ -0,0 +1,12 @@
+importScripts('/resources/testharness.js')
+
+promise_test(async (test) => {
+ return fetch('./sw.js').then(function(response) {
+ setTimeout(() => {
+ assert_not_equals(typeof performance.getEntriesByName(response.url)[0].serverTiming,
+ 'undefined',
+ 'An instance of `PerformanceResourceTiming` should have a `serverTiming` attribute in the Service Worker context.')
+ done()
+ }, 100)
+ })
+})
Modified: trunk/LayoutTests/platform/ios-wk1/TestExpectations (231708 => 231709)
--- trunk/LayoutTests/platform/ios-wk1/TestExpectations 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/LayoutTests/platform/ios-wk1/TestExpectations 2018-05-11 18:33:43 UTC (rev 231709)
@@ -9,6 +9,7 @@
# No service worker implementation for WK1
imported/w3c/web-platform-tests/service-workers [ Skip ]
+imported/w3c/web-platform-tests/server-timing/service_worker_idl.html [ Skip ]
http/wpt/service-workers [ Skip ]
http/wpt/cache-storage [ Skip ]
http/tests/cache-storage [ Skip ]
Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (231708 => 231709)
--- trunk/LayoutTests/platform/mac-wk1/TestExpectations 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations 2018-05-11 18:33:43 UTC (rev 231709)
@@ -149,6 +149,7 @@
http/tests/appcache/main-resource-redirect-with-sw.html [ Skip ]
http/tests/cookies/same-site/fetch-in-cross-origin-service-worker.html [ Skip ]
http/tests/cookies/same-site/fetch-in-same-origin-service-worker.html [ Skip ]
+imported/w3c/web-platform-tests/server-timing/service_worker_idl.html [ Skip ]
# Skip WebRTC for now in WK1
imported/w3c/web-platform-tests/webrtc [ Skip ]
Modified: trunk/LayoutTests/platform/win/TestExpectations (231708 => 231709)
--- trunk/LayoutTests/platform/win/TestExpectations 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/LayoutTests/platform/win/TestExpectations 2018-05-11 18:33:43 UTC (rev 231709)
@@ -3797,6 +3797,7 @@
imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-when-cross-origin-service-worker.https.html [ Skip ]
imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url-service-worker.https.html [ Skip ]
imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-_javascript_-agent-formalism/canblock-serviceworker.https.html [ Skip ]
+imported/w3c/web-platform-tests/server-timing/service_worker_idl.html [ Skip ]
imported/w3c/web-platform-tests/service-workers [ Skip ]
http/tests/cache-storage [ Skip ]
http/wpt/cache-storage [ Skip ]
Modified: trunk/Source/WebCore/CMakeLists.txt (231708 => 231709)
--- trunk/Source/WebCore/CMakeLists.txt 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebCore/CMakeLists.txt 2018-05-11 18:33:43 UTC (rev 231709)
@@ -819,6 +819,7 @@
page/PerformanceObserverEntryList.idl
page/PerformanceNavigation.idl
page/PerformanceResourceTiming.idl
+ page/PerformanceServerTiming.idl
page/PerformanceTiming.idl
page/RemoteDOMWindow.idl
page/Screen.idl
Modified: trunk/Source/WebCore/ChangeLog (231708 => 231709)
--- trunk/Source/WebCore/ChangeLog 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebCore/ChangeLog 2018-05-11 18:33:43 UTC (rev 231709)
@@ -1,3 +1,21 @@
+2018-05-11 Charles Vazac <[email protected]>
+
+ Runtime feature flag for Server-Timing
+ https://bugs.webkit.org/show_bug.cgi?id=184758
+
+ Reviewed by Youenn Fablet.
+
+ * Source/WebCore/CMakeLists.txt: Added reference to PerformanceServerTiming.idl.
+ * Source/WebCore/DerivedSources.make: Added reference to PerformanceServerTiming.idl.
+ * Source/WebCore/Sources.txt: Added reference to PerformanceServerTiming.cpp and JSPerformanceServerTiming.cpp.
+ * Source/WebCore/WebCore.xcodeproj/project.pbxproj: Added references to PerformanceServerTiming.cpp, PerformanceServerTiming.h, and PerformanceServerTiming.idl.
+ * Source/WebCore/bindings/js/WebCoreBuiltinNames.h: Added PerformanceServerTiming.
+ * Source/WebCore/page/PerformanceResourceTiming.h: Added serverTiming member.
+ * Source/WebCore/page/PerformanceResourceTiming.idl: Added serverTiming attribute.
+ * Source/WebCore/page/PerformanceServerTiming.cpp: Added.
+ * Source/WebCore/page/PerformanceServerTiming.h: Added.
+ * Source/WebCore/page/PerformanceServerTiming.idl: Added.
+
2018-05-11 Brady Eidson <[email protected]>
Make sure history navigations reuse the existing process when necessary.
Modified: trunk/Source/WebCore/DerivedSources.make (231708 => 231709)
--- trunk/Source/WebCore/DerivedSources.make 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebCore/DerivedSources.make 2018-05-11 18:33:43 UTC (rev 231709)
@@ -783,6 +783,7 @@
$(WebCore)/page/PerformanceObserverCallback.idl \
$(WebCore)/page/PerformanceObserverEntryList.idl \
$(WebCore)/page/PerformanceResourceTiming.idl \
+ $(WebCore)/page/PerformanceServerTiming.idl \
$(WebCore)/page/PerformanceTiming.idl \
$(WebCore)/page/RemoteDOMWindow.idl \
$(WebCore)/page/Screen.idl \
Modified: trunk/Source/WebCore/Sources.txt (231708 => 231709)
--- trunk/Source/WebCore/Sources.txt 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebCore/Sources.txt 2018-05-11 18:33:43 UTC (rev 231709)
@@ -1392,6 +1392,7 @@
page/PerformanceObserver.cpp
page/PerformanceObserverEntryList.cpp
page/PerformanceResourceTiming.cpp
+page/PerformanceServerTiming.cpp
page/PerformanceTiming.cpp
page/PerformanceUserTiming.cpp
page/PointerLockController.cpp
@@ -2809,6 +2810,7 @@
JSPerformanceObserverCallback.cpp
JSPerformanceObserverEntryList.cpp
JSPerformanceResourceTiming.cpp
+JSPerformanceServerTiming.cpp
JSPerformanceTiming.cpp
JSPeriodicWave.cpp
JSPlaybackDirection.cpp
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (231708 => 231709)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-05-11 18:33:43 UTC (rev 231709)
@@ -6383,6 +6383,9 @@
26F756B41B3B68F20005DD79 /* ImmutableNFANodeBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImmutableNFANodeBuilder.h; sourceTree = "<group>"; };
26F9A83618A046AC00AEB88A /* ViewportConfiguration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ViewportConfiguration.cpp; sourceTree = "<group>"; };
26F9A83718A046AC00AEB88A /* ViewportConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewportConfiguration.h; sourceTree = "<group>"; };
+ 28DB9BC52020EA0400E54A07 /* PerformanceServerTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceServerTiming.cpp; sourceTree = "<group>"; };
+ 28DB9BC62020EA0400E54A07 /* PerformanceServerTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceServerTiming.h; sourceTree = "<group>"; };
+ 28DB9BC72020EA0400E54A07 /* PerformanceServerTiming.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PerformanceServerTiming.idl; sourceTree = "<group>"; };
2914E3051CAB5A440049966F /* AccessibilityAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityAttachment.cpp; sourceTree = "<group>"; };
2914E3061CAB5A440049966F /* AccessibilityAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityAttachment.h; sourceTree = "<group>"; };
2917B55E1473496C0052C9D0 /* LayerFlushScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayerFlushScheduler.cpp; sourceTree = "<group>"; };
@@ -19315,6 +19318,9 @@
86512EDB154A2AEE00A90426 /* PerformanceResourceTiming.cpp */,
86512EDC154A2AEF00A90426 /* PerformanceResourceTiming.h */,
86512EDD154A2AEF00A90426 /* PerformanceResourceTiming.idl */,
+ 28DB9BC52020EA0400E54A07 /* PerformanceServerTiming.cpp */,
+ 28DB9BC62020EA0400E54A07 /* PerformanceServerTiming.h */,
+ 28DB9BC72020EA0400E54A07 /* PerformanceServerTiming.idl */,
0F43C85C189E10CF00019AE2 /* PerformanceTiming.cpp */,
8AF4E55911DC5A63000ED3DE /* PerformanceTiming.h */,
8AF4E55A11DC5A63000ED3DE /* PerformanceTiming.idl */,
Modified: trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h (231708 => 231709)
--- trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h 2018-05-11 18:33:43 UTC (rev 231709)
@@ -118,6 +118,7 @@
macro(PerformanceObserver) \
macro(PerformanceObserverEntryList) \
macro(PerformanceResourceTiming) \
+ macro(PerformanceServerTiming) \
macro(PublicKeyCredential) \
macro(RTCDTMFSender) \
macro(RTCDTMFToneChangeEvent) \
Modified: trunk/Source/WebCore/page/PerformanceResourceTiming.h (231708 => 231709)
--- trunk/Source/WebCore/page/PerformanceResourceTiming.h 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebCore/page/PerformanceResourceTiming.h 2018-05-11 18:33:43 UTC (rev 231709)
@@ -39,6 +39,7 @@
namespace WebCore {
+class PerformanceServerTiming;
class ResourceTiming;
class PerformanceResourceTiming final : public PerformanceEntry {
@@ -60,6 +61,7 @@
double requestStart() const;
double responseStart() const;
double responseEnd() const;
+ const Vector<Ref<PerformanceServerTiming>>& serverTiming() const { return m_serverTiming; }
private:
PerformanceResourceTiming(MonotonicTime timeOrigin, ResourceTiming&&);
@@ -72,6 +74,7 @@
LoadTiming m_loadTiming;
NetworkLoadMetrics m_networkLoadMetrics;
bool m_shouldReportDetails;
+ Vector<Ref<PerformanceServerTiming>> m_serverTiming;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/page/PerformanceResourceTiming.idl (231708 => 231709)
--- trunk/Source/WebCore/page/PerformanceResourceTiming.idl 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebCore/page/PerformanceResourceTiming.idl 2018-05-11 18:33:43 UTC (rev 231709)
@@ -51,6 +51,7 @@
readonly attribute DOMHighResTimeStamp requestStart;
readonly attribute DOMHighResTimeStamp responseStart;
readonly attribute DOMHighResTimeStamp responseEnd;
+ [EnabledAtRuntime=ServerTiming] readonly attribute FrozenArray<PerformanceServerTiming> serverTiming;
serializer = { inherit, attribute };
};
Added: trunk/Source/WebCore/page/PerformanceServerTiming.cpp (0 => 231709)
--- trunk/Source/WebCore/page/PerformanceServerTiming.cpp (rev 0)
+++ trunk/Source/WebCore/page/PerformanceServerTiming.cpp 2018-05-11 18:33:43 UTC (rev 231709)
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2017 The Chromium Authors. All rights reserved.
+ * Copyright (C) 2018 Akamai Technologies Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PerformanceServerTiming.h"
+
+namespace WebCore {
+
+Ref<PerformanceServerTiming> PerformanceServerTiming::create(String&& name, double duration, String&& description)
+{
+ return adoptRef(*new PerformanceServerTiming(WTFMove(name), duration, WTFMove(description)));
+}
+
+PerformanceServerTiming::PerformanceServerTiming(String&& name, double duration, String&& description)
+ : m_name(WTFMove(name))
+ , m_duration(duration)
+ , m_description(WTFMove(description))
+{
+}
+
+PerformanceServerTiming::~PerformanceServerTiming() = default;
+
+} // namespace WebCore
Added: trunk/Source/WebCore/page/PerformanceServerTiming.h (0 => 231709)
--- trunk/Source/WebCore/page/PerformanceServerTiming.h (rev 0)
+++ trunk/Source/WebCore/page/PerformanceServerTiming.h 2018-05-11 18:33:43 UTC (rev 231709)
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2017 The Chromium Authors. All rights reserved.
+ * Copyright (C) 2018 Akamai Technologies Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class PerformanceServerTiming : public RefCounted<PerformanceServerTiming> {
+public:
+ static Ref<PerformanceServerTiming> create(String&& name, double duration, String&& description);
+ ~PerformanceServerTiming();
+
+ const String& name() const { return m_name; }
+ double duration() const { return m_duration; }
+ const String& description() const { return m_description; }
+
+private:
+ PerformanceServerTiming(String&& name, double duration, String&& description);
+ String m_name;
+ double m_duration;
+ String m_description;
+};
+
+} // namespace WebCore
Added: trunk/Source/WebCore/page/PerformanceServerTiming.idl (0 => 231709)
--- trunk/Source/WebCore/page/PerformanceServerTiming.idl (rev 0)
+++ trunk/Source/WebCore/page/PerformanceServerTiming.idl 2018-05-11 18:33:43 UTC (rev 231709)
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2017 The Chromium Authors. All rights reserved.
+ * Copyright (C) 2018 Akamai Technologies Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// https://w3c.github.io/server-timing/#dom-performanceservertiming
+
+typedef double DOMHighResTimeStamp;
+
+[
+ Exposed=(Window,Worker),
+ ImplementationLacksVTable,
+ EnabledAtRuntime=ServerTiming
+] interface PerformanceServerTiming {
+ readonly attribute DOMString name;
+ readonly attribute DOMHighResTimeStamp duration;
+ readonly attribute DOMString description;
+ serializer = {attribute};
+};
Modified: trunk/Source/WebCore/page/RuntimeEnabledFeatures.h (231708 => 231709)
--- trunk/Source/WebCore/page/RuntimeEnabledFeatures.h 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebCore/page/RuntimeEnabledFeatures.h 2018-05-11 18:33:43 UTC (rev 231709)
@@ -259,6 +259,9 @@
void setStorageAccessPromptsEnabled(bool isEnabled) { m_promptForStorageAccessAPIEnabled = isEnabled; }
bool storageAccessPromptsEnabled() const { return m_promptForStorageAccessAPIEnabled; }
+ void setServerTimingEnabled(bool isEnabled) { m_isServerTimingEnabled = isEnabled; }
+ bool serverTimingEnabled() const { return m_isServerTimingEnabled; }
+
WEBCORE_EXPORT static RuntimeEnabledFeatures& sharedFeatures();
private:
@@ -394,11 +397,13 @@
bool m_isRestrictedHTTPResponseAccess { true };
bool m_fromOriginResponseHeaderEnabled { false };
-
+
bool m_isWebGLCompressedTextureASTCSupportEnabled { false };
bool m_promptForStorageAccessAPIEnabled { false };
+ bool m_isServerTimingEnabled { false };
+
friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>;
};
Modified: trunk/Source/WebKit/ChangeLog (231708 => 231709)
--- trunk/Source/WebKit/ChangeLog 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebKit/ChangeLog 2018-05-11 18:33:43 UTC (rev 231709)
@@ -1,3 +1,16 @@
+2018-05-11 Charles Vazac <[email protected]>
+
+ Runtime feature flag for Server-Timing
+ https://bugs.webkit.org/show_bug.cgi?id=184758
+
+ Reviewed by Youenn Fablet.
+
+ * Shared/WebPreferences.yaml: Added ServerTimingEnabled.
+ * UIProcess/API/C/WKPreferences.cpp:
+ (WKPreferencesGetServerTimingEnabled):
+ * UIProcess/API/C/WKPreferencesRefPrivate.h: WK_EXPORT for WKPreferencesSetServerTimingEnabled.
+ * WebProcess/Storage/WebSWContextManagerConnection.cpp: Call setServerTimingEnabled.
+
2018-05-11 Antti Koivisto <[email protected]>
Network process should not stat() all cache files on startup to find their sizes
Modified: trunk/Source/WebKit/Shared/WebPreferences.yaml (231708 => 231709)
--- trunk/Source/WebKit/Shared/WebPreferences.yaml 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebKit/Shared/WebPreferences.yaml 2018-05-11 18:33:43 UTC (rev 231709)
@@ -1274,3 +1274,12 @@
humanReadableDescription: "Prompt the user when Storage Access API calls are made"
category: experimental
webcoreBinding: RuntimeEnabledFeatures
+
+ServerTimingEnabled:
+ type: bool
+ defaultValue: false
+ humanReadableName: "Server Timing"
+ humanReadableDescription: "Enable Server Timing API"
+ category: experimental
+ webcoreBinding: RuntimeEnabledFeatures
+ webcoreName: serverTimingEnabled
Modified: trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp (231708 => 231709)
--- trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp 2018-05-11 18:33:43 UTC (rev 231709)
@@ -1993,3 +1993,13 @@
{
return toImpl(preferencesRef)->restrictedHTTPResponseAccess();
}
+
+void WKPreferencesSetServerTimingEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setServerTimingEnabled(flag);
+}
+
+bool WKPreferencesGetServerTimingEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->serverTimingEnabled();
+}
Modified: trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h (231708 => 231709)
--- trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h 2018-05-11 18:33:43 UTC (rev 231709)
@@ -561,6 +561,10 @@
WK_EXPORT void WKPreferencesSetAllowCrossOriginSubresourcesToAskForCredentials(WKPreferencesRef, bool flag);
WK_EXPORT bool WKPreferencesGetAllowCrossOriginSubresourcesToAskForCredentials(WKPreferencesRef);
+// Defaults to false.
+WK_EXPORT void WKPreferencesSetServerTimingEnabled(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetServerTimingEnabled(WKPreferencesRef);
+
#ifdef __cplusplus
}
#endif
Modified: trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp (231708 => 231709)
--- trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp 2018-05-11 18:33:43 UTC (rev 231709)
@@ -129,6 +129,7 @@
RuntimeEnabledFeatures::sharedFeatures().setResourceTimingEnabled(store.getBoolValueForKey(WebPreferencesKey::resourceTimingEnabledKey()));
RuntimeEnabledFeatures::sharedFeatures().setFetchAPIKeepAliveEnabled(store.getBoolValueForKey(WebPreferencesKey::fetchAPIKeepAliveEnabledKey()));
RuntimeEnabledFeatures::sharedFeatures().setRestrictedHTTPResponseAccess(store.getBoolValueForKey(WebPreferencesKey::restrictedHTTPResponseAccessKey()));
+ RuntimeEnabledFeatures::sharedFeatures().setServerTimingEnabled(store.getBoolValueForKey(WebPreferencesKey::serverTimingEnabledKey()));
m_storageBlockingPolicy = static_cast<SecurityOrigin::StorageBlockingPolicy>(store.getUInt32ValueForKey(WebPreferencesKey::storageBlockingPolicyKey()));
}
Modified: trunk/Source/WebKitLegacy/ChangeLog (231708 => 231709)
--- trunk/Source/WebKitLegacy/ChangeLog 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebKitLegacy/ChangeLog 2018-05-11 18:33:43 UTC (rev 231709)
@@ -1,3 +1,26 @@
+2018-05-11 Charles Vazac <[email protected]>
+
+ Runtime feature flag for Server-Timing
+ https://bugs.webkit.org/show_bug.cgi?id=184758
+
+ Reviewed by Youenn Fablet.
+
+ * mac/WebView/WebPreferenceKeysPrivate.h: Added server-timing preference.
+ * mac/WebView/WebPreferences.mm:
+ (WebKit::WebPreferences::serverTimingEnabled):
+ (WebKit::WebPreferences::setServerTimingEnabled):
+ * mac/WebView/WebPreferencesPrivate.h:
+ (WebKit::WebPreferences::setServerTimingEnabled):
+ (WebKit::WebPreferences::serverTimingEnabled):
+ * mac/WebView/WebView.mm: Set runtime enabled feature based on preference.
+ * win/Interfaces/IWebPreferencesPrivate.idl: define serverTimingEnabled and setServerTimingEnabled.
+ * win/WebPreferenceKeysPrivate.h: Added server-timing preference.
+ * win/WebPreferences.cpp: Initialize server-timing as false and define setter and getter.
+ (WebKit::WebPreferences::serverTimingEnabled):
+ (WebKit::WebPreferences::setServerTimingEnabled):
+ * win/WebPreferences.h: Define serverTimingEnabled and setServerTimingEnabled.
+ * win/WebView.cpp: Set runtime enabled feature based on preference.
+
2018-05-02 Keith Rollin <[email protected]>
Add facility for tracking times and results of page and resource loading
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h (231708 => 231709)
--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h 2018-05-11 18:33:43 UTC (rev 231709)
@@ -258,3 +258,4 @@
#define WebKitInspectorAdditionsEnabledPreferenceKey @"WebKitInspectorAdditionsEnabled"
#define WebKitAccessibilityObjectModelEnabledPreferenceKey @"WebKitAccessibilityObjectModelEnabled"
#define WebKitMediaCapabilitiesEnabledPreferenceKey @"WebKitMediaCapabilitiesEnabled"
+#define WebKitServerTimingEnabledPreferenceKey @"WebKitServerTimingEnabled"
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm (231708 => 231709)
--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm 2018-05-11 18:33:43 UTC (rev 231709)
@@ -684,6 +684,7 @@
@NO, WebKitAccessibilityObjectModelEnabledPreferenceKey,
@NO, WebKitMediaCapabilitiesEnabledPreferenceKey,
@NO, WebKitFetchAPIKeepAliveEnabledPreferenceKey,
+ @NO, WebKitServerTimingEnabledPreferenceKey,
nil];
#if !PLATFORM(IOS)
@@ -3322,6 +3323,16 @@
[self _setBoolValue:flag forKey:WebKitMediaCapabilitiesEnabledPreferenceKey];
}
+- (BOOL)serverTimingEnabled
+{
+ return [self _boolValueForKey:WebKitServerTimingEnabledPreferenceKey];
+}
+
+- (void)setServerTimingEnabled:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitServerTimingEnabledPreferenceKey];
+}
+
@end
@implementation WebPreferences (WebInternal)
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h (231708 => 231709)
--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h 2018-05-11 18:33:43 UTC (rev 231709)
@@ -579,6 +579,9 @@
- (void)setIsSecureContextAttributeEnabled:(BOOL)flag;
- (BOOL)isSecureContextAttributeEnabled;
+- (void)setServerTimingEnabled:(BOOL)flag;
+- (BOOL)serverTimingEnabled;
+
@property (nonatomic) BOOL visualViewportEnabled;
@property (nonatomic) BOOL visualViewportAPIEnabled;
@property (nonatomic) BOOL largeImageAsyncDecodingEnabled;
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (231708 => 231709)
--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2018-05-11 18:33:43 UTC (rev 231709)
@@ -3162,6 +3162,8 @@
settings.setLargeImageAsyncDecodingEnabled([preferences largeImageAsyncDecodingEnabled]);
settings.setAnimatedImageAsyncDecodingEnabled([preferences animatedImageAsyncDecodingEnabled]);
+
+ RuntimeEnabledFeatures::sharedFeatures().setServerTimingEnabled([preferences serverTimingEnabled]);
}
static inline IMP getMethod(id o, SEL s)
Modified: trunk/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl (231708 => 231709)
--- trunk/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl 2018-05-11 18:33:43 UTC (rev 231709)
@@ -227,6 +227,8 @@
HRESULT setSpatialNavigationEnabled([in] BOOL enabled);
HRESULT menuItemElementEnabled([out, retval] BOOL* enabled);
HRESULT setMenuItemElementEnabled([in] BOOL enabled);
+ HRESULT serverTimingEnabled([out, retval] BOOL* enabled);
+ HRESULT setServerTimingEnabled([in] BOOL enabled);
}
[uuid(9A49D1DE-53DD-11E8-95E6-003EE1C28AB6)]
Modified: trunk/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h (231708 => 231709)
--- trunk/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h 2018-05-11 18:33:43 UTC (rev 231709)
@@ -203,3 +203,5 @@
#define WebKitInspectorAdditionsEnabledPreferenceKey "WebKitInspectorAdditionsEnabled"
#define WebKitVisualViewportAPIEnabledPreferenceKey "WebKitVisualViewportAPIEnabled"
+
+#define WebKitServerTimingEnabledPreferenceKey "WebKitServerTimingEnabled"
Modified: trunk/Source/WebKitLegacy/win/WebPreferences.cpp (231708 => 231709)
--- trunk/Source/WebKitLegacy/win/WebPreferences.cpp 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebKitLegacy/win/WebPreferences.cpp 2018-05-11 18:33:43 UTC (rev 231709)
@@ -2231,3 +2231,17 @@
*enabled = boolValueForKey(WebKitResourceTimingEnabledPreferenceKey);
return S_OK;
}
+
+HRESULT WebPreferences::serverTimingEnabled(_Out_ BOOL* enabled)
+{
+ if (!enabled)
+ return E_POINTER;
+ *enabled = boolValueForKey(WebKitServerTimingEnabledPreferenceKey);
+ return S_OK;
+}
+
+HRESULT WebPreferences::setServerTimingEnabled(BOOL enabled)
+{
+ setBoolValue(WebKitServerTimingEnabledPreferenceKey, enabled);
+ return S_OK;
+}
Modified: trunk/Source/WebKitLegacy/win/WebPreferences.h (231708 => 231709)
--- trunk/Source/WebKitLegacy/win/WebPreferences.h 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebKitLegacy/win/WebPreferences.h 2018-05-11 18:33:43 UTC (rev 231709)
@@ -275,6 +275,8 @@
virtual HRESULT STDMETHODCALLTYPE setSpatialNavigationEnabled(BOOL);
virtual HRESULT STDMETHODCALLTYPE menuItemElementEnabled(_Out_ BOOL*);
virtual HRESULT STDMETHODCALLTYPE setMenuItemElementEnabled(BOOL);
+ virtual HRESULT STDMETHODCALLTYPE serverTimingEnabled(_Out_ BOOL*);
+ virtual HRESULT STDMETHODCALLTYPE setServerTimingEnabled(BOOL);
// IWebPreferencesPrivate7
virtual HRESULT STDMETHODCALLTYPE crossOriginOptionsSupportEnabled(_Out_ BOOL*);
Modified: trunk/Source/WebKitLegacy/win/WebView.cpp (231708 => 231709)
--- trunk/Source/WebKitLegacy/win/WebView.cpp 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Source/WebKitLegacy/win/WebView.cpp 2018-05-11 18:33:43 UTC (rev 231709)
@@ -5578,6 +5578,11 @@
return hr;
settings.setJavaScriptRuntimeFlags(JSC::RuntimeFlags(_javascript_RuntimeFlags));
+ hr = prefsPrivate->serverTimingEnabled(&enabled);
+ if (FAILED(hr))
+ return hr;
+ RuntimeEnabledFeatures::sharedFeatures().setServerTimingEnabled(!!enabled);
+
return S_OK;
}
Modified: trunk/Tools/ChangeLog (231708 => 231709)
--- trunk/Tools/ChangeLog 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Tools/ChangeLog 2018-05-11 18:33:43 UTC (rev 231709)
@@ -1,3 +1,13 @@
+2018-05-11 Charles Vazac <[email protected]>
+
+ Runtime feature flag for Server-Timing
+ https://bugs.webkit.org/show_bug.cgi?id=184758
+
+ Reviewed by Youenn Fablet.
+
+ * TestWebKitAPI/Configurations/FeatureDefines.xcconfig: added ENABLE_SERVER_TIMING.
+ * DumpRenderTree/win/DumpRenderTree.cpp: enable Server Timing
+
2018-05-11 Fujii Hironori <[email protected]>
[Win][MiniBrowser] Move WK1 related code into MiniBrowser
Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (231708 => 231709)
--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm 2018-05-11 18:33:43 UTC (rev 231709)
@@ -863,6 +863,7 @@
[preferences setVisualViewportAPIEnabled:YES];
[preferences setColorFilterEnabled:YES];
[preferences setCrossOriginOptionsSupportEnabled:YES];
+ [preferences setServerTimingEnabled:YES];
}
// Called before each test.
Modified: trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp (231708 => 231709)
--- trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp 2018-05-11 18:33:43 UTC (rev 231709)
@@ -786,6 +786,7 @@
// FIXME: SubtleCrypto
prefsPrivate->setVisualViewportAPIEnabled(TRUE);
prefsPrivate->setWebAnimationsEnabled(TRUE);
+ prefsPrivate->setServerTimingEnabled(TRUE);
// FIXME: WebGL2
// FIXME: WebRTC
prefsPrivate->setCrossOriginOptionsSupportEnabled(TRUE);
Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (231708 => 231709)
--- trunk/Tools/WebKitTestRunner/TestController.cpp 2018-05-11 18:11:21 UTC (rev 231708)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp 2018-05-11 18:33:43 UTC (rev 231709)
@@ -771,6 +771,8 @@
WKPreferencesSetRestrictedHTTPResponseAccess(preferences, true);
+ WKPreferencesSetServerTimingEnabled(preferences, true);
+
platformResetPreferencesToConsistentValues();
}