Move ResourceTiming behind a runtime flag
authoryoav@yoav.ws <yoav@yoav.ws@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Apr 2016 07:33:02 +0000 (07:33 +0000)
committeryoav@yoav.ws <yoav@yoav.ws@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Apr 2016 07:33:02 +0000 (07:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=157133

Reviewed by Alex Christensen.

.:

* Source/cmake/WebKitFeatures.cmake: Remove the PERFORMANCE_TIMELINE build flag.

Source/JavaScriptCore:

* runtime/CommonIdentifiers.h: Added PerformanceEntry, PerformanceEntryList and PerformanceResourceTiming as property names.

Source/WebCore:

Move the ResourceTiming API from being behind a build time flag to be behind an
off-by-default runtime flag, that can be turned on using internals.

Tests: fast/dom/Window/window-properties-performance-resource-timing.html
       http/tests/performance/performance-resource-timing-entries.html

* DerivedSources.make: Added idl files for PerformanceEntry, PerformanceEntryList and PerformanceResourceTiming.
* WebCore.xcodeproj/project.pbxproj: Added the various Performance* files to the project.
* bindings/generic/RuntimeEnabledFeatures.cpp: Added ResourceTiming as a runtime flag.
(WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
* bindings/generic/RuntimeEnabledFeatures.h: Added ResourceTiming as a runtime flag.
(WebCore::RuntimeEnabledFeatures::setResourceTimingEnabled):
(WebCore::RuntimeEnabledFeatures::resourceTimingEnabled):
* bindings/js/JSPerformanceEntryCustom.cpp: Removed #if for ResourceTiming. Added build flag around UserTiming related h files.
(WebCore::toJS): Deleted.
* dom/EventNames.h: Renamed webkitresourcetimingbufferfull to resourcetimingbufferfull.
* loader/DocumentThreadableLoader.cpp: Replace #if for ResourceTiming with runtime flag.
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/ResourceLoadNotifier.cpp: Replace #if for ResourceTiming with runtime flag.
(WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
* loader/cache/CachedResourceLoader.cpp: Replace #if for ResourceTiming with runtime flag.
(WebCore::CachedResourceLoader::revalidateResource):
(WebCore::CachedResourceLoader::loadResource):
(WebCore::CachedResourceLoader::storeResourceTimingInitiatorInformation):
(WebCore::CachedResourceLoader::loadDone):
* loader/cache/CachedResourceLoader.h: Remove #if for ResourceTiming.
* page/Performance.cpp: Remove #if for ResourceTiming.
(WebCore::Performance::Performance): Removed #if for ResourceTiming related initialization.
(WebCore::Performance::webkitGetEntries): Renamed to getEntries.
(WebCore::Performance::webkitGetEntriesByType): Renamed to getEntriesByType.
(WebCore::Performance::webkitGetEntriesByName): Renamed to getEntriesByName.
* page/Performance.h: Remove #if for ResourceTiming.
* page/Performance.idl: Replace #if for ResourceTiming with runtime flag.
* page/PerformanceEntry.cpp: Remove the PERFORMANCE_TIMELINE build flag.
* page/PerformanceEntry.h: Remove the PERFORMANCE_TIMELINE build flag.
* page/PerformanceEntry.idl: Replace the PERFORMANCE_TIMELINE build flag with runtime flag.
* page/PerformanceEntryList.cpp: Remove the PERFORMANCE_TIMELINE build flag.
* page/PerformanceEntryList.h: Remove the PERFORMANCE_TIMELINE build flag.
* page/PerformanceEntryList.idl: Replace the PERFORMANCE_TIMELINE build flag with runtime flag.
* page/PerformanceResourceTiming.cpp: Remove the RESOURCE_TIMING build flag.
* page/PerformanceResourceTiming.h: Remove the RESOURCE_TIMING build flag.
* page/PerformanceResourceTiming.idl: Replace the RESOURCE_TIMING build flag with runtime flag.
* testing/Internals.cpp: Add a method that enables ResourceTiming.
(WebCore::Internals::setResourceTimingSupport):
* testing/Internals.h: Add a method that enables ResourceTiming.
* testing/Internals.idl: Add a method that enables ResourceTiming.

LayoutTests:

Added tests that make sure ResourceTiming APIs are exposed and that resources
show up as entries in the performance timeline.

* fast/dom/Window/window-properties-performance-resource-timing-expected.txt: Added.
* fast/dom/Window/window-properties-performance-resource-timing.html: Added.
* fast/dom/Window/window-properties-performance.html: Removed "//;".
* http/tests/performance/performance-resource-timing-entries-expected.txt: Added.
* http/tests/performance/performance-resource-timing-entries.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200232 268f45cc-cd09-0410-ab3c-d52691b4dbfc

36 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/fast/dom/Window/window-properties-performance-resource-timing-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Window/window-properties-performance-resource-timing.html [new file with mode: 0644]
LayoutTests/fast/dom/Window/window-properties-performance.html
LayoutTests/http/tests/performance/performance-resource-timing-entries-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/performance/performance-resource-timing-entries.html [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/CommonIdentifiers.h
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h
Source/WebCore/bindings/js/JSPerformanceEntryCustom.cpp
Source/WebCore/dom/EventNames.h
Source/WebCore/loader/DocumentThreadableLoader.cpp
Source/WebCore/loader/ResourceLoadNotifier.cpp
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebCore/loader/cache/CachedResourceLoader.h
Source/WebCore/page/Performance.cpp
Source/WebCore/page/Performance.h
Source/WebCore/page/Performance.idl
Source/WebCore/page/PerformanceEntry.cpp
Source/WebCore/page/PerformanceEntry.h
Source/WebCore/page/PerformanceEntry.idl
Source/WebCore/page/PerformanceEntryList.cpp
Source/WebCore/page/PerformanceEntryList.h
Source/WebCore/page/PerformanceEntryList.idl
Source/WebCore/page/PerformanceResourceTiming.cpp
Source/WebCore/page/PerformanceResourceTiming.h
Source/WebCore/page/PerformanceResourceTiming.idl
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/cmake/WebKitFeatures.cmake

index 69569c4..d9df359 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2016-04-29  Yoav Weiss  <yoav@yoav.ws>
+
+        Move ResourceTiming behind a runtime flag
+        https://bugs.webkit.org/show_bug.cgi?id=157133
+
+        Reviewed by Alex Christensen.
+
+        * Source/cmake/WebKitFeatures.cmake: Remove the PERFORMANCE_TIMELINE build flag.
+
 2016-04-28  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r200185.
index 0cc2e1c..a5543a6 100644 (file)
@@ -1,3 +1,19 @@
+2016-04-29  Yoav Weiss  <yoav@yoav.ws>
+
+        Move ResourceTiming behind a runtime flag
+        https://bugs.webkit.org/show_bug.cgi?id=157133
+
+        Reviewed by Alex Christensen.
+
+        Added tests that make sure ResourceTiming APIs are exposed and that resources
+        show up as entries in the performance timeline.
+
+        * fast/dom/Window/window-properties-performance-resource-timing-expected.txt: Added.
+        * fast/dom/Window/window-properties-performance-resource-timing.html: Added.
+        * fast/dom/Window/window-properties-performance.html: Removed "//;".
+        * http/tests/performance/performance-resource-timing-entries-expected.txt: Added.
+        * http/tests/performance/performance-resource-timing-entries.html: Added.
+
 2016-04-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
 
         Drop [UsePointersEvenForNonNullableObjectArguments] from MediaStream interfaces
diff --git a/LayoutTests/fast/dom/Window/window-properties-performance-resource-timing-expected.txt b/LayoutTests/fast/dom/Window/window-properties-performance-resource-timing-expected.txt
new file mode 100644 (file)
index 0000000..cfb9154
--- /dev/null
@@ -0,0 +1,46 @@
+This test dumps all of the properties that are reachable from the window.performance object, along with their types.
+
+window.performance [object Performance]
+window.performance.addEventListener [function]
+window.performance.clearResourceTimings [function]
+window.performance.dispatchEvent [function]
+window.performance.getEntries [function]
+window.performance.getEntriesByName [function]
+window.performance.getEntriesByType [function]
+window.performance.navigation [object PerformanceNavigation]
+window.performance.navigation.TYPE_BACK_FORWARD [number]
+window.performance.navigation.TYPE_NAVIGATE [number]
+window.performance.navigation.TYPE_RELOAD [number]
+window.performance.navigation.TYPE_RESERVED [number]
+window.performance.navigation.redirectCount [number]
+window.performance.navigation.type [number]
+window.performance.now [function]
+window.performance.onresourcetimingbufferfull [null]
+window.performance.removeEventListener [function]
+window.performance.setResourceTimingBufferSize [function]
+window.performance.timing [object PerformanceTiming]
+window.performance.timing.connectEnd [number]
+window.performance.timing.connectStart [number]
+window.performance.timing.domComplete [number]
+window.performance.timing.domContentLoadedEventEnd [number]
+window.performance.timing.domContentLoadedEventStart [number]
+window.performance.timing.domInteractive [number]
+window.performance.timing.domLoading [number]
+window.performance.timing.domainLookupEnd [number]
+window.performance.timing.domainLookupStart [number]
+window.performance.timing.fetchStart [number]
+window.performance.timing.loadEventEnd [number]
+window.performance.timing.loadEventStart [number]
+window.performance.timing.navigationStart [number]
+window.performance.timing.redirectEnd [number]
+window.performance.timing.redirectStart [number]
+window.performance.timing.requestStart [number]
+window.performance.timing.responseEnd [number]
+window.performance.timing.responseStart [number]
+window.performance.timing.secureConnectionStart [number]
+window.performance.timing.unloadEventEnd [number]
+window.performance.timing.unloadEventStart [number]
+window.performance.timing [printed above as window.performance.timing]
+window.performance.navigation [printed above as window.performance.navigation]
+window.performance [string]
+
diff --git a/LayoutTests/fast/dom/Window/window-properties-performance-resource-timing.html b/LayoutTests/fast/dom/Window/window-properties-performance-resource-timing.html
new file mode 100644 (file)
index 0000000..d5e82c6
--- /dev/null
@@ -0,0 +1,104 @@
+<p>This test dumps all of the properties that are reachable from the window.performance object, along with their types.</p>
+<hr>
+<pre id="pre"></pre>
+
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+
+if (window.internals)
+    internals.setResourceTimingSupport(true);
+    
+var logBuffer = [];
+function log(s)
+{
+    logBuffer.push(s);
+}
+
+var pre = document.getElementById('pre');
+function flushLog()
+{
+    var logMessage = logBuffer.join("");
+    pre.appendChild(document.createTextNode(logMessage));
+}
+
+function tryEval(string)
+{
+    try {
+        return eval(string);
+    } catch (e) {
+        return new String("Caught exception: " + e);
+    }
+}
+
+function typeOfNullAware(value)
+{
+    if (typeof value == "object" && value == null)
+        return "null";
+    return typeof value;
+}
+
+function typeStringNullAware(value)
+{
+    var valueType = typeOfNullAware(value);
+    return valueType == "object"
+        ? Object.prototype.toString.call(value)
+        : "[" + valueType + "]";
+}
+
+function logValue(valueName)
+{
+    var value = tryEval(valueName);
+    var valueType = typeOfNullAware(value);
+
+    // Don't taint the test with our own variables
+    if (value == logBuffer || value == pre)
+        return;
+
+    // Don't taint the test with our own properties
+    if (/__visitedByLogValue__/.test(valueName) || /__nameWhenVisitedByLogValue__/.test(valueName))
+        return;
+
+    // Work around Firefox infinite recursion
+    if (/\.[0-9]/.test(valueName))
+        return;
+
+    // Avoid infinite recursion
+    if (valueType == "object" && value.__visitedByLogValue__) {
+        log(valueName + " [printed above as " + value.__nameWhenVisitedByLogValue__ + "]\n");
+        return;
+    }
+
+    log(valueName + " " + typeStringNullAware(value) + "\n");
+
+    if (valueType == "object") {
+        value.__visitedByLogValue__ = true;
+        value.__nameWhenVisitedByLogValue__ = valueName;
+        logProperties(value, valueName);
+    }
+}
+
+function logProperties(object, objectName)
+{
+    var array = new Array;
+    for (var property in object) {
+        array.push(property);
+    }
+    array.sort();
+    for (var i = 0; i < array.length; i++) {
+        var property = array[i];
+        logValue(objectName + "." + property);
+    }
+}
+
+logValue('window.performance');
+window.performance.timing = 'timing is not replaceable';
+logValue('window.performance.timing');
+window.performance.navigation = 'navigation is not replaceable';
+logValue('window.performance.navigation');
+window.performance = 'performance is replaceable';
+logValue('window.performance');
+flushLog();
+if (window.internals)
+    internals.setResourceTimingSupport(false);
+</script>
index 0a8f81e..1b12e17 100644 (file)
@@ -30,7 +30,7 @@ function tryEval(string)
 
 function typeOfNullAware(value)
 {
-    if (typeof value == "object" && value == null) //;
+    if (typeof value == "object" && value == null)
         return "null";
     return typeof value;
 }
@@ -61,7 +61,7 @@ function logValue(valueName)
         return;
 
     // Avoid infinite recursion
-    if (valueType == "object" && value.__visitedByLogValue__) { //;
+    if (valueType == "object" && value.__visitedByLogValue__) {
         log(valueName + " [printed above as " + value.__nameWhenVisitedByLogValue__ + "]\n");
         return;
     }
diff --git a/LayoutTests/http/tests/performance/performance-resource-timing-entries-expected.txt b/LayoutTests/http/tests/performance/performance-resource-timing-entries-expected.txt
new file mode 100644 (file)
index 0000000..73d17bf
--- /dev/null
@@ -0,0 +1,5 @@
+PASS successfullyParsed is true
+
+TEST COMPLETE
+PASS performance.getEntriesByType('resource').length is 2
+
diff --git a/LayoutTests/http/tests/performance/performance-resource-timing-entries.html b/LayoutTests/http/tests/performance/performance-resource-timing-entries.html
new file mode 100644 (file)
index 0000000..6eecba2
--- /dev/null
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    internals.setResourceTimingSupport(true);
+</script>
+<script src="../../resources/js-test-pre.js"></script>
+</head>
+<body>
+<span id="e"></span>
+<span id="f"></span>
+<script>
+window.addEventListener("load", function() {
+    shouldBe("performance.getEntriesByType('resource').length", "2");
+    if (window.internals)
+        window.internals.setResourceTimingSupport(false);
+});
+
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
index 9d8568e..3009a28 100644 (file)
@@ -1,3 +1,12 @@
+2016-04-29  Yoav Weiss  <yoav@yoav.ws>
+
+        Move ResourceTiming behind a runtime flag
+        https://bugs.webkit.org/show_bug.cgi?id=157133
+
+        Reviewed by Alex Christensen.
+
+        * runtime/CommonIdentifiers.h: Added PerformanceEntry, PerformanceEntryList and PerformanceResourceTiming as property names.
+
 2016-04-28  Joseph Pecoraro  <pecoraro@apple.com>
 
         Remove unused bool parameter in CodeCache::getGlobalCodeBlock
index c44e582..d5b303f 100644 (file)
@@ -71,6 +71,9 @@
     macro(Number) \
     macro(NumberFormat) \
     macro(Object) \
+    macro(PerformanceEntry) \
+    macro(PerformanceEntryList) \
+    macro(PerformanceResourceTiming) \
     macro(Promise) \
     macro(Proxy) \
     macro(RangeError) \
index f19116c..bdafd82 100644 (file)
@@ -1,3 +1,57 @@
+2016-04-29  Yoav Weiss  <yoav@yoav.ws>
+
+        Move ResourceTiming behind a runtime flag
+        https://bugs.webkit.org/show_bug.cgi?id=157133
+
+        Reviewed by Alex Christensen.
+
+        Move the ResourceTiming API from being behind a build time flag to be behind an
+        off-by-default runtime flag, that can be turned on using internals.
+
+        Tests: fast/dom/Window/window-properties-performance-resource-timing.html
+               http/tests/performance/performance-resource-timing-entries.html
+
+        * DerivedSources.make: Added idl files for PerformanceEntry, PerformanceEntryList and PerformanceResourceTiming.
+        * WebCore.xcodeproj/project.pbxproj: Added the various Performance* files to the project.
+        * bindings/generic/RuntimeEnabledFeatures.cpp: Added ResourceTiming as a runtime flag.
+        (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
+        * bindings/generic/RuntimeEnabledFeatures.h: Added ResourceTiming as a runtime flag.
+        (WebCore::RuntimeEnabledFeatures::setResourceTimingEnabled):
+        (WebCore::RuntimeEnabledFeatures::resourceTimingEnabled):
+        * bindings/js/JSPerformanceEntryCustom.cpp: Removed #if for ResourceTiming. Added build flag around UserTiming related h files.
+        (WebCore::toJS): Deleted.
+        * dom/EventNames.h: Renamed webkitresourcetimingbufferfull to resourcetimingbufferfull.
+        * loader/DocumentThreadableLoader.cpp: Replace #if for ResourceTiming with runtime flag.
+        (WebCore::DocumentThreadableLoader::loadRequest):
+        * loader/ResourceLoadNotifier.cpp: Replace #if for ResourceTiming with runtime flag.
+        (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
+        * loader/cache/CachedResourceLoader.cpp: Replace #if for ResourceTiming with runtime flag.
+        (WebCore::CachedResourceLoader::revalidateResource):
+        (WebCore::CachedResourceLoader::loadResource):
+        (WebCore::CachedResourceLoader::storeResourceTimingInitiatorInformation):
+        (WebCore::CachedResourceLoader::loadDone):
+        * loader/cache/CachedResourceLoader.h: Remove #if for ResourceTiming.
+        * page/Performance.cpp: Remove #if for ResourceTiming.
+        (WebCore::Performance::Performance): Removed #if for ResourceTiming related initialization.
+        (WebCore::Performance::webkitGetEntries): Renamed to getEntries.
+        (WebCore::Performance::webkitGetEntriesByType): Renamed to getEntriesByType.
+        (WebCore::Performance::webkitGetEntriesByName): Renamed to getEntriesByName.
+        * page/Performance.h: Remove #if for ResourceTiming.
+        * page/Performance.idl: Replace #if for ResourceTiming with runtime flag.
+        * page/PerformanceEntry.cpp: Remove the PERFORMANCE_TIMELINE build flag.
+        * page/PerformanceEntry.h: Remove the PERFORMANCE_TIMELINE build flag.
+        * page/PerformanceEntry.idl: Replace the PERFORMANCE_TIMELINE build flag with runtime flag.
+        * page/PerformanceEntryList.cpp: Remove the PERFORMANCE_TIMELINE build flag.
+        * page/PerformanceEntryList.h: Remove the PERFORMANCE_TIMELINE build flag.
+        * page/PerformanceEntryList.idl: Replace the PERFORMANCE_TIMELINE build flag with runtime flag.
+        * page/PerformanceResourceTiming.cpp: Remove the RESOURCE_TIMING build flag.
+        * page/PerformanceResourceTiming.h: Remove the RESOURCE_TIMING build flag.
+        * page/PerformanceResourceTiming.idl: Replace the RESOURCE_TIMING build flag with runtime flag.
+        * testing/Internals.cpp: Add a method that enables ResourceTiming.
+        (WebCore::Internals::setResourceTimingSupport):
+        * testing/Internals.h: Add a method that enables ResourceTiming.
+        * testing/Internals.idl: Add a method that enables ResourceTiming.
+
 2016-04-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
 
         Drop [UsePointersEvenForNonNullableObjectArguments] from MediaStream interfaces
index 420a790..c3a12e4 100644 (file)
@@ -518,7 +518,10 @@ NON_SVG_BINDING_IDLS = \
     $(WebCore)/page/Location.idl \
     $(WebCore)/page/Navigator.idl \
     $(WebCore)/page/Performance.idl \
+    $(WebCore)/page/PerformanceEntry.idl \
+    $(WebCore)/page/PerformanceEntryList.idl \
     $(WebCore)/page/PerformanceNavigation.idl \
+    $(WebCore)/page/PerformanceResourceTiming.idl \
     $(WebCore)/page/PerformanceTiming.idl \
     $(WebCore)/page/Screen.idl \
     $(WebCore)/page/WebKitPoint.idl \
index 0f18e22..45c4f39 100644 (file)
                CA3BF67E10D99BAE00E6CE53 /* ScrollAnimator.h in Headers */ = {isa = PBXBuildFile; fileRef = CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */; settings = {ATTRIBUTES = (Private, ); }; };
                CAE9F90F146441F000C245B0 /* CSSAspectRatioValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */; };
                CAE9F910146441F000C245B0 /* CSSAspectRatioValue.h in Headers */ = {isa = PBXBuildFile; fileRef = CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */; };
+               CB38FD4B1CCCF36600592A3F /* PerformanceEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CB38FD4A1CCCF2DD00592A3F /* PerformanceEntry.cpp */; };
+               CB38FD511CCF938900592A3F /* JSPerformanceEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CB38FD4D1CCF937E00592A3F /* JSPerformanceEntry.cpp */; };
+               CB38FD521CCF939400592A3F /* JSPerformanceEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = CB38FD4E1CCF937E00592A3F /* JSPerformanceEntry.h */; };
+               CB38FD531CCF939B00592A3F /* JSPerformanceEntryList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CB38FD4F1CCF937E00592A3F /* JSPerformanceEntryList.cpp */; };
+               CB38FD541CCF939E00592A3F /* JSPerformanceEntryList.h in Headers */ = {isa = PBXBuildFile; fileRef = CB38FD501CCF937E00592A3F /* JSPerformanceEntryList.h */; };
+               CB38FD571CD21E2A00592A3F /* JSPerformanceEntryCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CB38FD551CD21D5B00592A3F /* JSPerformanceEntryCustom.cpp */; };
+               CB38FD5A1CD2325800592A3F /* JSPerformanceResourceTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CB38FD581CD2314500592A3F /* JSPerformanceResourceTiming.cpp */; };
+               CB38FD5B1CD2325B00592A3F /* JSPerformanceResourceTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = CB38FD591CD2314500592A3F /* JSPerformanceResourceTiming.h */; };
                CB8CF0181A9358D4000D510B /* Microtasks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CB8CF0151A934B43000D510B /* Microtasks.cpp */; };
                CCC2B51415F613060048CDD6 /* DeviceClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CCC2B51015F613060048CDD6 /* DeviceClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                CCC2B51515F613060048CDD6 /* DeviceController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CCC2B51115F613060048CDD6 /* DeviceController.cpp */; };
                CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollAnimator.h; sourceTree = "<group>"; };
                CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSAspectRatioValue.cpp; sourceTree = "<group>"; };
                CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSAspectRatioValue.h; sourceTree = "<group>"; };
+               CB38FD4A1CCCF2DD00592A3F /* PerformanceEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceEntry.cpp; sourceTree = "<group>"; };
+               CB38FD4D1CCF937E00592A3F /* JSPerformanceEntry.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = JSPerformanceEntry.cpp; sourceTree = "<group>"; };
+               CB38FD4E1CCF937E00592A3F /* JSPerformanceEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPerformanceEntry.h; sourceTree = "<group>"; };
+               CB38FD4F1CCF937E00592A3F /* JSPerformanceEntryList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPerformanceEntryList.cpp; sourceTree = "<group>"; };
+               CB38FD501CCF937E00592A3F /* JSPerformanceEntryList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = JSPerformanceEntryList.h; sourceTree = "<group>"; };
+               CB38FD551CD21D5B00592A3F /* JSPerformanceEntryCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPerformanceEntryCustom.cpp; sourceTree = "<group>"; };
+               CB38FD581CD2314500592A3F /* JSPerformanceResourceTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPerformanceResourceTiming.cpp; sourceTree = "<group>"; };
+               CB38FD591CD2314500592A3F /* JSPerformanceResourceTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPerformanceResourceTiming.h; sourceTree = "<group>"; };
                CB8CF0151A934B43000D510B /* Microtasks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Microtasks.cpp; sourceTree = "<group>"; };
                CCC2B51015F613060048CDD6 /* DeviceClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceClient.h; sourceTree = "<group>"; };
                CCC2B51115F613060048CDD6 /* DeviceController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceController.cpp; sourceTree = "<group>"; };
                                8A844D0211D3C18E0014065C /* Performance.h */,
                                8A844D0311D3C18E0014065C /* Performance.idl */,
                                86BE33FB15058CB200CE0FD8 /* PerformanceEntry.h */,
+                               CB38FD4A1CCCF2DD00592A3F /* PerformanceEntry.cpp */,
                                86BE33FC15058CB200CE0FD8 /* PerformanceEntry.idl */,
                                86BE33FD15058CB200CE0FD8 /* PerformanceEntryList.cpp */,
                                86BE33FE15058CB200CE0FD8 /* PerformanceEntryList.h */,
                                83F1206A1B8C103600D75F63 /* JSNodeFilterCustom.cpp */,
                                7C91A38D1B498ABE003F9EFA /* JSNodeOrString.cpp */,
                                7C91A38E1B498ABE003F9EFA /* JSNodeOrString.h */,
+                               CB38FD551CD21D5B00592A3F /* JSPerformanceEntryCustom.cpp */,
                                93B70D4F09EB0C7C009D8468 /* JSPluginElementFunctions.cpp */,
                                93B70D5009EB0C7C009D8468 /* JSPluginElementFunctions.h */,
                                4129DF831BB5B7F700322A16 /* JSReadableStreamPrivateConstructors.cpp */,
                                A9D247F60D757E3300FDF959 /* JSNavigator.h */,
                                E51A81DE17298D7700BFCA61 /* JSPerformance.cpp */,
                                8A9A587311E84C81008ACFD1 /* JSPerformance.h */,
+                               CB38FD4D1CCF937E00592A3F /* JSPerformanceEntry.cpp */,
+                               CB38FD4E1CCF937E00592A3F /* JSPerformanceEntry.h */,
+                               CB38FD4F1CCF937E00592A3F /* JSPerformanceEntryList.cpp */,
+                               CB38FD501CCF937E00592A3F /* JSPerformanceEntryList.h */,
                                8A9A586E11E84C35008ACFD1 /* JSPerformanceNavigation.cpp */,
                                8A9A586F11E84C36008ACFD1 /* JSPerformanceNavigation.h */,
+                               CB38FD581CD2314500592A3F /* JSPerformanceResourceTiming.cpp */,
+                               CB38FD591CD2314500592A3F /* JSPerformanceResourceTiming.h */,
                                0F43C85E189E15A600019AE2 /* JSPerformanceTiming.cpp */,
                                8A9A587711E84C98008ACFD1 /* JSPerformanceTiming.h */,
                                BCEC01C00C274DDD009F4EC9 /* JSScreen.cpp */,
                                2D29ECCA192F1F1D00984B78 /* DisplayRefreshMonitorIOS.h in Headers */,
                                2DE70023192FE82A00B0975C /* DisplayRefreshMonitorMac.h in Headers */,
                                2D29ECC8192ECC8300984B78 /* DisplayRefreshMonitorManager.h in Headers */,
+                               CB38FD521CCF939400592A3F /* JSPerformanceEntry.h in Headers */,
                                CD52481B18E200ED0008A07D /* DisplaySleepDisabler.h in Headers */,
                                5D8C4DC01428222C0026CE72 /* DisplaySleepDisablerCocoa.h in Headers */,
                                FD31609112B026F700C1A359 /* Distance.h in Headers */,
                                BCEA4868097D93020094C9E4 /* RenderView.h in Headers */,
                                BE20507E18A458C20080647E /* RenderVTTCue.h in Headers */,
                                A871DFE40A15376B00B12A68 /* RenderWidget.h in Headers */,
+                               CB38FD5B1CD2325B00592A3F /* JSPerformanceResourceTiming.h in Headers */,
                                A89CCC530F44E98100B5DA10 /* ReplaceNodeWithSpanCommand.h in Headers */,
                                93309E0A099E64920056E581 /* ReplaceSelectionCommand.h in Headers */,
                                99CC0B5418BE9849006CEBCC /* ReplayController.h in Headers */,
                                A8EA800A0A19516E00A8EF5F /* StyleSheetList.h in Headers */,
                                BC5EB5E50E81BF6D00B25965 /* StyleSurroundData.h in Headers */,
                                BC5EB8100E81F2CE00B25965 /* StyleTransformData.h in Headers */,
+                               CB38FD541CCF939E00592A3F /* JSPerformanceEntryList.h in Headers */,
                                E4DEAA1817A93DC3000E0430 /* StyleTreeResolver.h in Headers */,
                                BC5EB69A0E81DA6300B25965 /* StyleVisualData.h in Headers */,
                                D000ED2811C1B9CD00C47726 /* SubframeLoader.h in Headers */,
                                B27535770B053814002CE64F /* ColorMac.mm in Sources */,
                                43EDD67E1B485DBF00640E75 /* CombinedFiltersAlphabet.cpp in Sources */,
                                26E944D81AC4B2DD007B85B5 /* CombinedURLFilters.cpp in Sources */,
+                               CB38FD4B1CCCF36600592A3F /* PerformanceEntry.cpp in Sources */,
                                A584FE341864D5AF00843B10 /* CommandLineAPIHost.cpp in Sources */,
                                A584FE2B1863870F00843B10 /* CommandLineAPIModule.cpp in Sources */,
                                6550B6A1099DF0270090D781 /* Comment.cpp in Sources */,
                                BC96DB460F3A882200573CB3 /* RenderBoxModelObject.cpp in Sources */,
                                BCEA4865097D93020094C9E4 /* RenderButton.cpp in Sources */,
                                BCE4413312F748E2009B84B8 /* RenderCombineText.cpp in Sources */,
+                               CB38FD5A1CD2325800592A3F /* JSPerformanceResourceTiming.cpp in Sources */,
                                9392F1440AD185FE00691BD4 /* RenderCounter.cpp in Sources */,
                                BCEA486D097D93020094C9E4 /* RenderDeprecatedFlexibleBox.cpp in Sources */,
                                D302754912A5FE84004BD828 /* RenderDetailsMarker.cpp in Sources */,
                                444D4E230F708B2E003158E0 /* WebCoreURLResponseIOS.mm in Sources */,
                                93F19B0708245E59001E9ABC /* WebCoreView.m in Sources */,
                                A5E616731894581F009ADF50 /* WebDebuggerAgent.cpp in Sources */,
+                               CB38FD571CD21E2A00592A3F /* JSPerformanceEntryCustom.cpp in Sources */,
                                FE0D84EB1048436E001A179E /* WebEvent.mm in Sources */,
                                225A16B60D5C11E900090295 /* WebEventRegion.mm in Sources */,
                                D3F3D36D1A69B7DC0059FC2B /* WebGL2RenderingContext.cpp in Sources */,
                                B10B6981140C174000BC1C26 /* WebVTTTokenizer.cpp in Sources */,
                                CD8203111395ACE700F956C6 /* WebWindowAnimation.mm in Sources */,
                                F55B3DDF1251F12D003EF269 /* WeekInputType.cpp in Sources */,
+                               CB38FD511CCF938900592A3F /* JSPerformanceEntry.cpp in Sources */,
                                85031B500A44EFC700F992E0 /* WheelEvent.cpp in Sources */,
                                2E19516B1B6598D200DF6EEF /* WheelEventDeltaFilter.cpp in Sources */,
                                2EEEE55C1B66A047008E2CBC /* WheelEventDeltaFilterMac.mm in Sources */,
                                00B9318913BA8DBC0035A948 /* XMLDocumentParserLibxml2.cpp in Sources */,
                                00B9318B13BA8DC90035A948 /* XMLDocumentParserScope.cpp in Sources */,
                                59C28045138DC2410079B7E2 /* XMLErrors.cpp in Sources */,
+                               CB38FD531CCF939B00592A3F /* JSPerformanceEntryList.cpp in Sources */,
                                BC772C460C4EB2C60083285F /* XMLHttpRequest.cpp in Sources */,
                                A136A00C1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.cpp in Sources */,
                                BCDFD48F0E305290009D10AD /* XMLHttpRequestUpload.cpp in Sources */,
index 2cc6124..1b5dc15 100644 (file)
@@ -59,6 +59,7 @@ RuntimeEnabledFeatures::RuntimeEnabledFeatures()
 #else
     , m_isPluginReplacementEnabled(false)
 #endif
+    , m_isResourceTimingEnabled(false)
 #if ENABLE(INDEXED_DATABASE)
     , m_isIndexedDBEnabled(false)
 #endif
index 11ecd95..4d36d68 100644 (file)
@@ -201,6 +201,9 @@ public:
     void setPluginReplacementEnabled(bool isEnabled) { m_isPluginReplacementEnabled = isEnabled; }
     bool pluginReplacementEnabled() const { return m_isPluginReplacementEnabled; }
 
+    void setResourceTimingEnabled(bool isEnabled) { m_isResourceTimingEnabled = isEnabled; }
+    bool resourceTimingEnabled() const { return m_isResourceTimingEnabled; }
+
 #if ENABLE(GAMEPAD)
     void setGamepadsEnabled(bool areEnabled) { m_areGamepadsEnabled = areEnabled; }
     bool gamepadsEnabled() const { return m_areGamepadsEnabled; }
@@ -267,6 +270,7 @@ private:
     bool m_isCSSCompositingEnabled;
     bool m_isLangAttributeAwareFormControlUIEnabled;
     bool m_isPluginReplacementEnabled;
+    bool m_isResourceTimingEnabled;
 
 #if ENABLE(INDEXED_DATABASE)
     bool m_isIndexedDBEnabled;
index ebdd37f..8f11e70 100644 (file)
 
 #include "config.h"
 
-#if ENABLE(PERFORMANCE_TIMELINE)
-
 #include "JSPerformanceEntry.h"
 
 #include "JSDOMBinding.h"
+#if ENABLE(USER_TIMING)
 #include "JSPerformanceMark.h"
 #include "JSPerformanceMeasure.h"
+#endif
 #include "JSPerformanceResourceTiming.h"
 #include "PerformanceMark.h"
 #include "PerformanceMeasure.h"
@@ -51,10 +51,8 @@ JSValue toJS(ExecState*, JSDOMGlobalObject* globalObject, PerformanceEntry* entr
     if (!entry)
         return jsNull();
 
-#if ENABLE(RESOURCE_TIMING)
     if (entry->isResource())
         return wrap<JSPerformanceResourceTiming>(globalObject, static_cast<PerformanceResourceTiming*>(entry));
-#endif
 
 #if ENABLE(USER_TIMING)
     if (entry->isMark())
@@ -68,5 +66,3 @@ JSValue toJS(ExecState*, JSDOMGlobalObject* globalObject, PerformanceEntry* entr
 }
 
 } // namespace WebCore
-
-#endif // ENABLE(PERFORMANCE_TIMELINE)
index 4ce8678..d574738 100644 (file)
@@ -183,6 +183,7 @@ namespace WebCore {
     macro(removetrack) \
     macro(reset) \
     macro(resize) \
+    macro(resourcetimingbufferfull) \
     macro(result) \
     macro(resume) \
     macro(scroll) \
@@ -261,7 +262,6 @@ namespace WebCore {
     macro(webkitpresentationmodechanged) \
     macro(webkitregionoversetchange) \
     macro(webkitremovesourcebuffer) \
-    macro(webkitresourcetimingbufferfull) \
     macro(webkitsourceclose) \
     macro(webkitsourceended) \
     macro(webkitsourceopen) \
index cdc459f..5f5efd8 100644 (file)
@@ -45,6 +45,7 @@
 #include "ProgressTracker.h"
 #include "ResourceError.h"
 #include "ResourceRequest.h"
+#include "RuntimeEnabledFeatures.h"
 #include "SchemeRegistry.h"
 #include "SecurityOrigin.h"
 #include "SubresourceLoader.h"
@@ -385,9 +386,8 @@ void DocumentThreadableLoader::loadRequest(const ResourceRequest& request, Secur
         }
 
         CachedResourceRequest newRequest(request, options);
-#if ENABLE(RESOURCE_TIMING)
-        newRequest.setInitiator(m_options.initiator);
-#endif
+        if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled())
+            newRequest.setInitiator(m_options.initiator);
         ASSERT(!m_resource);
         m_resource = m_document.cachedResourceLoader().requestRawResource(newRequest);
         if (m_resource)
index d39fd27..e5467fd 100644 (file)
@@ -39,6 +39,7 @@
 #include "Page.h"
 #include "ProgressTracker.h"
 #include "ResourceLoader.h"
+#include "RuntimeEnabledFeatures.h"
 
 #if USE(QUICK_LOOK)
 #include "QuickLook.h"
@@ -146,9 +147,8 @@ void ResourceLoadNotifier::dispatchWillSendRequest(DocumentLoader* loader, unsig
     if (loader && !request.isNull() && request.url() == loader->url())
         request.setReportLoadTiming(true);
 
-#if ENABLE(RESOURCE_TIMING)
-    request.setReportLoadTiming(true);
-#endif
+    if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled())
+        request.setReportLoadTiming(true);
 }
 
 void ResourceLoadNotifier::dispatchDidReceiveResponse(DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r, ResourceLoader* resourceLoader)
index c0a99a3..3db9007 100644 (file)
 #include "MainFrame.h"
 #include "MemoryCache.h"
 #include "Page.h"
+#include "Performance.h"
 #include "PingLoader.h"
 #include "PlatformStrategies.h"
 #include "RenderElement.h"
 #include "ResourceLoadInfo.h"
+#include "RuntimeEnabledFeatures.h"
 #include "ScriptController.h"
 #include "SecurityOrigin.h"
 #include "SessionID.h"
 #include "CachedTextTrack.h"
 #endif
 
-#if ENABLE(RESOURCE_TIMING)
-#include "Performance.h"
-#endif
-
 #define PRELOAD_DEBUG 0
 
 namespace WebCore {
@@ -671,11 +669,8 @@ CachedResourceHandle<CachedResource> CachedResourceLoader::revalidateResource(co
     
     memoryCache.remove(*resource);
     memoryCache.add(*newResource);
-#if ENABLE(RESOURCE_TIMING)
-    storeResourceTimingInitiatorInformation(resource, request);
-#else
-    UNUSED_PARAM(request);
-#endif
+    if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled())
+        storeResourceTimingInitiatorInformation(resource, request);
     return newResource;
 }
 
@@ -690,15 +685,14 @@ CachedResourceHandle<CachedResource> CachedResourceLoader::loadResource(CachedRe
 
     if (request.allowsCaching() && !memoryCache.add(*resource))
         resource->setOwningCachedResourceLoader(this);
-#if ENABLE(RESOURCE_TIMING)
-    storeResourceTimingInitiatorInformation(resource, request);
-#endif
+    if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled())
+        storeResourceTimingInitiatorInformation(resource, request);
     return resource;
 }
 
-#if ENABLE(RESOURCE_TIMING)
 void CachedResourceLoader::storeResourceTimingInitiatorInformation(const CachedResourceHandle<CachedResource>& resource, const CachedResourceRequest& request)
 {
+    ASSERT(RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled());
     if (resource->type() == CachedResource::MainResource) {
         // <iframe>s should report the initial navigation requested by the parent document, but not subsequent navigations.
         if (frame()->ownerElement() && m_documentLoader->frameLoader()->stateMachine().committingFirstRealLoad()) {
@@ -710,7 +704,6 @@ void CachedResourceLoader::storeResourceTimingInitiatorInformation(const CachedR
         m_initiatorMap.add(resource.get(), info);
     }
 }
-#endif // ENABLE(RESOURCE_TIMING)
 
 static void logRevalidation(const String& reason, DiagnosticLoggingClient& logClient)
 {
@@ -976,8 +969,9 @@ void CachedResourceLoader::loadDone(CachedResource* resource, bool shouldPerform
     RefPtr<DocumentLoader> protectDocumentLoader(m_documentLoader);
     RefPtr<Document> protectDocument(m_document);
 
-#if ENABLE(RESOURCE_TIMING)
-    if (resource && resource->response().isHTTP() && ((!resource->errorOccurred() && !resource->wasCanceled()) || resource->response().httpStatusCode() == 304)) {
+    if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled()
+        && resource && resource->response().isHTTP()
+        && ((!resource->errorOccurred() && !resource->wasCanceled()) || resource->response().httpStatusCode() == 304)) {
         HashMap<CachedResource*, InitiatorInfo>::iterator initiatorIt = m_initiatorMap.find(resource);
         if (initiatorIt != m_initiatorMap.end()) {
             ASSERT(document());
@@ -990,9 +984,6 @@ void CachedResourceLoader::loadDone(CachedResource* resource, bool shouldPerform
             m_initiatorMap.remove(initiatorIt);
         }
     }
-#else
-    UNUSED_PARAM(resource);
-#endif // ENABLE(RESOURCE_TIMING)
 
     if (frame())
         frame()->loader().loadDone();
index b1f7c4f..4df8199 100644 (file)
@@ -144,9 +144,7 @@ private:
     CachedResourceHandle<CachedResource> requestResource(CachedResource::Type, CachedResourceRequest&);
     CachedResourceHandle<CachedResource> revalidateResource(const CachedResourceRequest&, CachedResource*);
     CachedResourceHandle<CachedResource> loadResource(CachedResource::Type, CachedResourceRequest&);
-#if ENABLE(RESOURCE_TIMING)
     void storeResourceTimingInitiatorInformation(const CachedResourceHandle<CachedResource>&, const CachedResourceRequest&);
-#endif
     void requestPreload(CachedResource::Type, CachedResourceRequest&, const String& charset);
 
     enum RevalidationPolicy { Use, Revalidate, Reload, Load };
@@ -179,13 +177,11 @@ private:
 
     Timer m_garbageCollectDocumentResourcesTimer;
 
-#if ENABLE(RESOURCE_TIMING)
     struct InitiatorInfo {
         AtomicString name;
         double startTime;
     };
     HashMap<CachedResource*, InitiatorInfo> m_initiatorMap;
-#endif
 
     // 29 bits left
     bool m_autoLoadImages : 1;
index ed39a1d..08c7031 100644 (file)
 
 namespace WebCore {
 
-#if ENABLE(RESOURCE_TIMING)
 static const size_t defaultResourceTimingBufferSize = 150;
-#endif
 
 Performance::Performance(Frame& frame)
     : DOMWindowProperty(&frame)
-#if ENABLE(RESOURCE_TIMING)
     , m_resourceTimingBufferSize(defaultResourceTimingBufferSize)
-#endif // ENABLE(RESOURCE_TIMING)
     , m_referenceTime(frame.document()->loader() ? frame.document()->loader()->timing().referenceMonotonicTime() : monotonicallyIncreasingTime())
 #if ENABLE(USER_TIMING)
     , m_userTiming(nullptr)
@@ -91,14 +87,11 @@ PerformanceTiming* Performance::timing() const
     return m_timing.get();
 }
 
-#if ENABLE(PERFORMANCE_TIMELINE)
-PassRefPtr<PerformanceEntryList> Performance::webkitGetEntries() const
+RefPtr<PerformanceEntryList> Performance::getEntries() const
 {
     RefPtr<PerformanceEntryList> entries = PerformanceEntryList::create();
 
-#if ENABLE(RESOURCE_TIMING)
     entries->appendAll(m_resourceTimingBuffer);
-#endif // ENABLE(RESOURCE_TIMING)
 
 #if ENABLE(USER_TIMING)
     if (m_userTiming) {
@@ -111,16 +104,14 @@ PassRefPtr<PerformanceEntryList> Performance::webkitGetEntries() const
     return entries;
 }
 
-PassRefPtr<PerformanceEntryList> Performance::webkitGetEntriesByType(const String& entryType)
+RefPtr<PerformanceEntryList> Performance::getEntriesByType(const String& entryType)
 {
     RefPtr<PerformanceEntryList> entries = PerformanceEntryList::create();
 
-#if ENABLE(RESOURCE_TIMING)
     if (equalLettersIgnoringASCIICase(entryType, "resource")) {
         for (auto& resource : m_resourceTimingBuffer)
             entries->append(resource);
     }
-#endif
 
 #if ENABLE(USER_TIMING)
     if (m_userTiming) {
@@ -135,18 +126,16 @@ PassRefPtr<PerformanceEntryList> Performance::webkitGetEntriesByType(const Strin
     return entries;
 }
 
-PassRefPtr<PerformanceEntryList> Performance::webkitGetEntriesByName(const String& name, const String& entryType)
+RefPtr<PerformanceEntryList> Performance::getEntriesByName(const String& name, const String& entryType)
 {
     RefPtr<PerformanceEntryList> entries = PerformanceEntryList::create();
 
-#if ENABLE(RESOURCE_TIMING)
     if (entryType.isNull() || equalLettersIgnoringASCIICase(entryType, "resource")) {
         for (auto& resource : m_resourceTimingBuffer) {
             if (resource->name() == name)
                 entries->append(resource);
         }
     }
-#endif
 
 #if ENABLE(USER_TIMING)
     if (m_userTiming) {
@@ -161,20 +150,16 @@ PassRefPtr<PerformanceEntryList> Performance::webkitGetEntriesByName(const Strin
     return entries;
 }
 
-#endif // ENABLE(PERFORMANCE_TIMELINE)
-
-#if ENABLE(RESOURCE_TIMING)
-
-void Performance::webkitClearResourceTimings()
+void Performance::clearResourceTimings()
 {
     m_resourceTimingBuffer.clear();
 }
 
-void Performance::webkitSetResourceTimingBufferSize(unsigned size)
+void Performance::setResourceTimingBufferSize(unsigned size)
 {
     m_resourceTimingBufferSize = size;
     if (isResourceTimingBufferFull())
-        dispatchEvent(Event::create(eventNames().webkitresourcetimingbufferfullEvent, false, false));
+        dispatchEvent(Event::create(eventNames().resourcetimingbufferfullEvent, false, false));
 }
 
 void Performance::addResourceTiming(const String& initiatorName, Document* initiatorDocument, const ResourceRequest& request, const ResourceResponse& response, double initiationTime, double finishTime)
@@ -187,7 +172,7 @@ void Performance::addResourceTiming(const String& initiatorName, Document* initi
     m_resourceTimingBuffer.append(entry);
 
     if (isResourceTimingBufferFull())
-        dispatchEvent(Event::create(eventNames().webkitresourcetimingbufferfullEvent, false, false));
+        dispatchEvent(Event::create(eventNames().resourcetimingbufferfullEvent, false, false));
 }
 
 bool Performance::isResourceTimingBufferFull()
@@ -195,8 +180,6 @@ bool Performance::isResourceTimingBufferFull()
     return m_resourceTimingBuffer.size() >= m_resourceTimingBufferSize;
 }
 
-#endif // ENABLE(RESOURCE_TIMING)
-
 #if ENABLE(USER_TIMING)
 void Performance::webkitMark(const String& markName, ExceptionCode& ec)
 {
index 93f4406..176c150 100644 (file)
@@ -40,7 +40,6 @@
 #include "PerformanceNavigation.h"
 #include "PerformanceTiming.h"
 #include "ScriptWrappable.h"
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 #include <wtf/text/WTFString.h>
@@ -64,18 +63,14 @@ public:
     PerformanceTiming* timing() const;
     double now() const;
 
-#if ENABLE(PERFORMANCE_TIMELINE)
-    PassRefPtr<PerformanceEntryList> webkitGetEntries() const;
-    PassRefPtr<PerformanceEntryList> webkitGetEntriesByType(const String& entryType);
-    PassRefPtr<PerformanceEntryList> webkitGetEntriesByName(const String& name, const String& entryType);
-#endif
+    RefPtr<PerformanceEntryList> getEntries() const;
+    RefPtr<PerformanceEntryList> getEntriesByType(const String& entryType);
+    RefPtr<PerformanceEntryList> getEntriesByName(const String& name, const String& entryType);
 
-#if ENABLE(RESOURCE_TIMING)
-    void webkitClearResourceTimings();
-    void webkitSetResourceTimingBufferSize(unsigned int);
+    void clearResourceTimings();
+    void setResourceTimingBufferSize(unsigned);
 
     void addResourceTiming(const String& initiatorName, Document*, const ResourceRequest&, const ResourceResponse&, double initiationTime, double finishTime);
-#endif
 
     using RefCounted<Performance>::ref;
     using RefCounted<Performance>::deref;
@@ -97,11 +92,9 @@ private:
 
     mutable RefPtr<PerformanceNavigation> m_navigation;
     mutable RefPtr<PerformanceTiming> m_timing;
-    
-#if ENABLE(RESOURCE_TIMING)
+
     Vector<RefPtr<PerformanceEntry>> m_resourceTimingBuffer;
     unsigned m_resourceTimingBufferSize;
-#endif
 
     double m_referenceTime;
 
index 9b0a8b7..9489690 100644 (file)
     readonly attribute PerformanceNavigation navigation;
     readonly attribute PerformanceTiming timing;
 
-#if defined(ENABLE_PERFORMANCE_TIMELINE) && ENABLE_PERFORMANCE_TIMELINE
-    PerformanceEntryList webkitGetEntries();
-    PerformanceEntryList webkitGetEntriesByType(DOMString entryType);
-    PerformanceEntryList webkitGetEntriesByName(DOMString name, optional DOMString entryType);
-#endif
+    [EnabledAtRuntime=ResourceTiming] PerformanceEntryList getEntries();
+    [EnabledAtRuntime=ResourceTiming] PerformanceEntryList getEntriesByType(DOMString entryType);
+    [EnabledAtRuntime=ResourceTiming] PerformanceEntryList getEntriesByName(DOMString name, optional DOMString entryType);
 
-#if defined(ENABLE_RESOURCE_TIMING) && ENABLE_RESOURCE_TIMING
-    void webkitClearResourceTimings();
-    void webkitSetResourceTimingBufferSize(unsigned long maxSize);
 
-    attribute EventHandler onwebkitresourcetimingbufferfull;
-#endif
+    [EnabledAtRuntime=ResourceTiming] void clearResourceTimings();
+    [EnabledAtRuntime=ResourceTiming] void setResourceTimingBufferSize(unsigned long maxSize);
+
+    [EnabledAtRuntime=ResourceTiming] attribute EventHandler onresourcetimingbufferfull;
 
     // See http://www.w3.org/TR/2012/CR-user-timing-20120726/
 #if defined(ENABLE_USER_TIMING) && ENABLE_USER_TIMING
index 32db7cf..374e142 100644 (file)
@@ -31,7 +31,7 @@
 #include "config.h"
 #include "PerformanceEntry.h"
 
-#if ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE)
+#if ENABLE(WEB_TIMING)
 
 namespace WebCore {
 
@@ -69,4 +69,4 @@ double PerformanceEntry::duration() const
 
 } // namespace WebCore
 
-#endif // ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE)
+#endif // ENABLE(WEB_TIMING)
index 129a246..cf37c0e 100644 (file)
@@ -32,7 +32,7 @@
 #ifndef PerformanceEntry_h
 #define PerformanceEntry_h
 
-#if ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE)
+#if ENABLE(WEB_TIMING)
 
 #include "Performance.h"
 #include <wtf/PassRefPtr.h>
@@ -71,5 +71,5 @@ private:
 
 }
 
-#endif // !ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE)
+#endif // !ENABLE(WEB_TIMING)
 #endif // !defined(PerformanceEntry_h)
index 9bcaf4c..f37e2a3 100644 (file)
@@ -31,7 +31,7 @@
 // See: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PerformanceTimeline/Overview.html
 [
     Conditional=WEB_TIMING,
-    Conditional=PERFORMANCE_TIMELINE,
+    EnabledAtRuntime=ResourceTiming,
     CustomToJSObject,
 ] interface PerformanceEntry {
     readonly attribute DOMString name;
index d9fa055..c035928 100644 (file)
@@ -32,7 +32,7 @@
 #include "config.h"
 #include "PerformanceEntryList.h"
 
-#if ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE)
+#if ENABLE(WEB_TIMING)
 
 #include "PerformanceEntry.h"
 
@@ -75,4 +75,4 @@ void PerformanceEntryList::sort()
 
 } // namespace WebCore
 
-#endif // ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE)
+#endif // ENABLE(WEB_TIMING)
index 97a212d..d2c41f5 100644 (file)
@@ -32,7 +32,7 @@
 #ifndef PerformanceEntryList_h
 #define PerformanceEntryList_h
 
-#if ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE)
+#if ENABLE(WEB_TIMING)
 
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
@@ -64,5 +64,5 @@ private:
 
 } // namespace WebCore
 
-#endif // !ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE)
+#endif // !ENABLE(WEB_TIMING)
 #endif // PerformanceEntryList_h
index 7e25a85..18066cc 100644 (file)
 [
     NoInterfaceObject,
     Conditional=WEB_TIMING,
-    Conditional=PERFORMANCE_TIMELINE,
+    EnabledAtRuntime=ResourceTiming,
     ImplementationLacksVTable,
 ] interface PerformanceEntryList {
     readonly attribute unsigned long length;
     getter PerformanceEntry item(unsigned long index);
 };
-
index 31b8971..5bb6140 100644 (file)
@@ -32,8 +32,6 @@
 #include "config.h"
 #include "PerformanceResourceTiming.h"
 
-#if ENABLE(RESOURCE_TIMING)
-
 #include "Document.h"
 #include "DocumentLoadTiming.h"
 #include "DocumentLoader.h"
@@ -199,5 +197,3 @@ double PerformanceResourceTiming::resourceTimeToDocumentMilliseconds(int deltaMi
 }
 
 } // namespace WebCore
-
-#endif // ENABLE(RESOURCE_TIMING)
index 99dfc5b..37b5ae9 100644 (file)
@@ -32,8 +32,6 @@
 #ifndef PerformanceResourceTiming_h
 #define PerformanceResourceTiming_h
 
-#if ENABLE(RESOURCE_TIMING)
-
 #include "PerformanceEntry.h"
 #include "ResourceLoadTiming.h"
 #include <wtf/PassRefPtr.h>
@@ -85,6 +83,4 @@ private:
 
 }
 
-#endif // ENABLE(RESOURCE_TIMING)
-
 #endif // !defined(PerformanceResourceTiming_h)
index 3f011b2..3f309e3 100644 (file)
@@ -30,7 +30,7 @@
 
 // See: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/ResourceTiming/Overview.html
 [
-    Conditional=RESOURCE_TIMING,
+    EnabledAtRuntime=ResourceTiming
 ] interface PerformanceResourceTiming : PerformanceEntry {
     readonly attribute DOMString initiatorType;
 
index 21d8b76..ae9cc98 100644 (file)
@@ -3325,4 +3325,9 @@ void Internals::setCSSGridLayoutEnabled(bool enable)
 }
 #endif
 
+void Internals::setResourceTimingSupport(bool enable)
+{
+    RuntimeEnabledFeatures::sharedFeatures().setResourceTimingEnabled(enable);
+}
+
 }
index 5882e76..9719729 100644 (file)
@@ -468,6 +468,7 @@ public:
     
     void setViewportForceAlwaysUserScalable(bool);
     void setLinkPreloadSupport(bool);
+    void setResourceTimingSupport(bool);
 
 #if ENABLE(CSS_GRID_LAYOUT)
     void setCSSGridLayoutEnabled(bool);
index 3e0266f..4d4df19 100644 (file)
@@ -451,4 +451,5 @@ enum AutoFillButtonType {
     void setCSSGridLayoutEnabled(boolean enable);
 #endif
 
+    void setResourceTimingSupport(boolean scalable);
 };
index 9304b5a..768e3e5 100644 (file)
@@ -158,7 +158,6 @@ macro(WEBKIT_OPTION_BEGIN)
     WEBKIT_OPTION_DEFINE(ENABLE_NOTIFICATIONS "Toggle Desktop Notifications Support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_ORIENTATION_EVENTS "Toggle Orientation Events support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_PDFKIT_PLUGIN "Toggle PDFKit plugin support" PRIVATE OFF)
-    WEBKIT_OPTION_DEFINE(ENABLE_PERFORMANCE_TIMELINE "Toggle Performance Timeline support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_POINTER_LOCK "Toggle pointer lock support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_PROXIMITY_EVENTS "Toggle Proximity Events support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_PUBLIC_SUFFIX_LIST "Toggle public suffix list support" PRIVATE OFF)