Skip to content
Permalink
Browse files
Runtime feature flag for Server-Timing
https://bugs.webkit.org/show_bug.cgi?id=184758

Patch by Charles Vazac <cvazac@gmail.com> on 2018-05-11
Reviewed by Youenn Fablet.

Source/WebCore:

* 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.

Source/WebKit:

* 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.

Source/WebKitLegacy:

* 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.

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig: added ENABLE_SERVER_TIMING.
* DumpRenderTree/win/DumpRenderTree.cpp: enable Server Timing

LayoutTests:

* 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.

Canonical link: https://commits.webkit.org/201041@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231709 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
cvazac authored and webkit-commit-queue committed May 11, 2018
1 parent 05fce5e commit 19cae37bfd75aac408037910fa9e9a422f5fe474
Showing with 359 additions and 2 deletions.
  1. +14 −0 LayoutTests/ChangeLog
  2. +1 −1 LayoutTests/imported/w3c/resources/import-expectations.json
  3. +3 −0 LayoutTests/imported/w3c/web-platform-tests/server-timing/resource_timing_idl-expected.txt
  4. +14 −0 LayoutTests/imported/w3c/web-platform-tests/server-timing/resource_timing_idl.html
  5. +3 −0 LayoutTests/imported/w3c/web-platform-tests/server-timing/service_worker_idl-expected.txt
  6. +18 −0 LayoutTests/imported/w3c/web-platform-tests/server-timing/service_worker_idl.html
  7. +12 −0 LayoutTests/imported/w3c/web-platform-tests/server-timing/sw.js
  8. +1 −0 LayoutTests/platform/ios-wk1/TestExpectations
  9. +1 −0 LayoutTests/platform/mac-wk1/TestExpectations
  10. +1 −0 LayoutTests/platform/win/TestExpectations
  11. +1 −0 Source/WebCore/CMakeLists.txt
  12. +18 −0 Source/WebCore/ChangeLog
  13. +1 −0 Source/WebCore/DerivedSources.make
  14. +2 −0 Source/WebCore/Sources.txt
  15. +6 −0 Source/WebCore/WebCore.xcodeproj/project.pbxproj
  16. +1 −0 Source/WebCore/bindings/js/WebCoreBuiltinNames.h
  17. +3 −0 Source/WebCore/page/PerformanceResourceTiming.h
  18. +1 −0 Source/WebCore/page/PerformanceResourceTiming.idl
  19. +46 −0 Source/WebCore/page/PerformanceServerTiming.cpp
  20. +50 −0 Source/WebCore/page/PerformanceServerTiming.h
  21. +40 −0 Source/WebCore/page/PerformanceServerTiming.idl
  22. +6 −1 Source/WebCore/page/RuntimeEnabledFeatures.h
  23. +13 −0 Source/WebKit/ChangeLog
  24. +9 −0 Source/WebKit/Shared/WebPreferences.yaml
  25. +10 −0 Source/WebKit/UIProcess/API/C/WKPreferences.cpp
  26. +4 −0 Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h
  27. +1 −0 Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp
  28. +23 −0 Source/WebKitLegacy/ChangeLog
  29. +1 −0 Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h
  30. +11 −0 Source/WebKitLegacy/mac/WebView/WebPreferences.mm
  31. +3 −0 Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h
  32. +2 −0 Source/WebKitLegacy/mac/WebView/WebView.mm
  33. +2 −0 Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl
  34. +2 −0 Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h
  35. +14 −0 Source/WebKitLegacy/win/WebPreferences.cpp
  36. +2 −0 Source/WebKitLegacy/win/WebPreferences.h
  37. +5 −0 Source/WebKitLegacy/win/WebView.cpp
  38. +10 −0 Tools/ChangeLog
  39. +1 −0 Tools/DumpRenderTree/mac/DumpRenderTree.mm
  40. +1 −0 Tools/DumpRenderTree/win/DumpRenderTree.cpp
  41. +2 −0 Tools/WebKitTestRunner/TestController.cpp
@@ -1,3 +1,17 @@
2018-05-11 Charles Vazac <cvazac@gmail.com>

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 <youenn@apple.com>

Layout Test webrtc/addICECandidate-closed.html is a flaky failure
@@ -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",
@@ -0,0 +1,3 @@

PASS Untitled

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<head>
<meta charset='utf-8' />
<script src="/resources/testharness.js"></script>
<script src='/resources/testharnessreport.js'></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>
@@ -0,0 +1,3 @@

PASS Untitled

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<head>
<meta charset='utf-8' />
<script src="/resources/testharness.js"></script>
<script src='/resources/testharnessreport.js'></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>
@@ -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)
})
})
@@ -9,6 +9,7 @@ editing/input/focus-change-with-marked-text.html [ Pass ]

# 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 ]
@@ -149,6 +149,7 @@ imported/w3c/web-platform-tests/streams/readable-byte-streams/detached-buffers.s
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 ]
@@ -3797,6 +3797,7 @@ imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-service-worke
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 ]
@@ -819,6 +819,7 @@ set(WebCore_NON_SVG_IDL_FILES
page/PerformanceObserverEntryList.idl
page/PerformanceNavigation.idl
page/PerformanceResourceTiming.idl
page/PerformanceServerTiming.idl
page/PerformanceTiming.idl
page/RemoteDOMWindow.idl
page/Screen.idl
@@ -1,3 +1,21 @@
2018-05-11 Charles Vazac <cvazac@gmail.com>

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 <beidson@apple.com>

Make sure history navigations reuse the existing process when necessary.
@@ -783,6 +783,7 @@ JS_BINDING_IDLS = \
$(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 \
@@ -1392,6 +1392,7 @@ page/PerformanceNavigation.cpp
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 @@ JSPerformanceObserver.cpp
JSPerformanceObserverCallback.cpp
JSPerformanceObserverEntryList.cpp
JSPerformanceResourceTiming.cpp
JSPerformanceServerTiming.cpp
JSPerformanceTiming.cpp
JSPeriodicWave.cpp
JSPlaybackDirection.cpp
@@ -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 */,
@@ -118,6 +118,7 @@ namespace WebCore {
macro(PerformanceObserver) \
macro(PerformanceObserverEntryList) \
macro(PerformanceResourceTiming) \
macro(PerformanceServerTiming) \
macro(PublicKeyCredential) \
macro(RTCDTMFSender) \
macro(RTCDTMFToneChangeEvent) \
@@ -39,6 +39,7 @@

namespace WebCore {

class PerformanceServerTiming;
class ResourceTiming;

class PerformanceResourceTiming final : public PerformanceEntry {
@@ -60,6 +61,7 @@ class PerformanceResourceTiming final : public PerformanceEntry {
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 @@ class PerformanceResourceTiming final : public PerformanceEntry {
LoadTiming m_loadTiming;
NetworkLoadMetrics m_networkLoadMetrics;
bool m_shouldReportDetails;
Vector<Ref<PerformanceServerTiming>> m_serverTiming;
};

} // namespace WebCore
@@ -51,6 +51,7 @@ typedef double DOMHighResTimeStamp;
readonly attribute DOMHighResTimeStamp requestStart;
readonly attribute DOMHighResTimeStamp responseStart;
readonly attribute DOMHighResTimeStamp responseEnd;
[EnabledAtRuntime=ServerTiming] readonly attribute FrozenArray<PerformanceServerTiming> serverTiming;

serializer = { inherit, attribute };
};
@@ -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
@@ -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
@@ -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};
};
@@ -259,6 +259,9 @@ class RuntimeEnabledFeatures {
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 @@ class RuntimeEnabledFeatures {
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>;
};

0 comments on commit 19cae37

Please sign in to comment.