Title: [235683] trunk
Revision
235683
Author
[email protected]
Date
2018-09-05 12:03:09 -0700 (Wed, 05 Sep 2018)

Log Message

Added runtime feature flag for web API statistics
https://bugs.webkit.org/show_bug.cgi?id=189211

Patch by Woodrow Wang <[email protected]> on 2018-09-05
Reviewed by Daniel Bates.

Source/WebCore:

Added functionality to get and set the runtime flag.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebAPIStatisticsEnabled):
(WebCore::RuntimeEnabledFeatures::webAPIStatisticsEnabled const):

Source/WebKit:

Added functionality to set the runtime flag with a _javascript_ exposed function
for testing.

* Shared/WebPreferences.yaml:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

Tools:

Added functionality to set the runtime flag with a _javascript_ exposed function
for testing.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setWebAPIStatisticsEnabled):
* WebKitTestRunner/InjectedBundle/TestRunner.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (235682 => 235683)


--- trunk/Source/WebCore/ChangeLog	2018-09-05 18:54:54 UTC (rev 235682)
+++ trunk/Source/WebCore/ChangeLog	2018-09-05 19:03:09 UTC (rev 235683)
@@ -1,3 +1,16 @@
+2018-09-05  Woodrow Wang  <[email protected]>
+
+        Added runtime feature flag for web API statistics
+        https://bugs.webkit.org/show_bug.cgi?id=189211
+
+        Reviewed by Daniel Bates.
+
+        Added functionality to get and set the runtime flag.
+
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setWebAPIStatisticsEnabled):
+        (WebCore::RuntimeEnabledFeatures::webAPIStatisticsEnabled const):
+
 2018-09-05  Youenn Fablet  <[email protected]>
 
         Move replaceTrack logic to LibWebRTCPeerConnectionBackend

Modified: trunk/Source/WebCore/page/RuntimeEnabledFeatures.h (235682 => 235683)


--- trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2018-09-05 18:54:54 UTC (rev 235682)
+++ trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2018-09-05 19:03:09 UTC (rev 235683)
@@ -282,6 +282,9 @@
     void setAttrStyleEnabled(bool isEnabled) { m_attrStyleEnabled = isEnabled; }
     bool attrStyleEnabled() const { return m_attrStyleEnabled; }
 
+    void setWebAPIStatisticsEnabled(bool isEnabled) { m_webAPIStatisticsEnabled = isEnabled; }
+    bool webAPIStatisticsEnabled() const { return m_webAPIStatisticsEnabled; }
+
     WEBCORE_EXPORT static RuntimeEnabledFeatures& sharedFeatures();
 
 private:
@@ -425,6 +428,8 @@
 
     bool m_attrStyleEnabled { false };
 
+    bool m_webAPIStatisticsEnabled { false };
+
     friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>;
 };
 

Modified: trunk/Source/WebKit/ChangeLog (235682 => 235683)


--- trunk/Source/WebKit/ChangeLog	2018-09-05 18:54:54 UTC (rev 235682)
+++ trunk/Source/WebKit/ChangeLog	2018-09-05 19:03:09 UTC (rev 235683)
@@ -1,3 +1,17 @@
+2018-09-05  Woodrow Wang  <[email protected]>
+
+        Added runtime feature flag for web API statistics
+        https://bugs.webkit.org/show_bug.cgi?id=189211
+
+        Reviewed by Daniel Bates.
+
+        Added functionality to set the runtime flag with a _javascript_ exposed function
+        for testing.
+
+        * Shared/WebPreferences.yaml:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+
 2018-09-05  Jer Noble  <[email protected]>
 
         Add MediaCapabilities as an Experimental Feature

Modified: trunk/Source/WebKit/Shared/WebPreferences.yaml (235682 => 235683)


--- trunk/Source/WebKit/Shared/WebPreferences.yaml	2018-09-05 18:54:54 UTC (rev 235682)
+++ trunk/Source/WebKit/Shared/WebPreferences.yaml	2018-09-05 19:03:09 UTC (rev 235683)
@@ -1333,3 +1333,11 @@
   humanReadableDescription: "Enable Media Source Codec Switching through changeType()"
   category: experimental
   condition: ENABLE(MEDIA_SOURCE)
+
+WebAPIStatisticsEnabled:
+  type: bool
+  defaultValue: false
+  humanReadableName: "Web API Statistics"
+  humanReadableDescription: "Enable Web API Statistics"
+  webcoreBinding: RuntimeEnabledFeatures
+  category: experimental

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp (235682 => 235683)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp	2018-09-05 18:54:54 UTC (rev 235682)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp	2018-09-05 19:03:09 UTC (rev 235683)
@@ -250,6 +250,9 @@
         RuntimeEnabledFeatures::sharedFeatures().setIsSecureContextAttributeEnabled(enabled);
     }
 
+    if (preference == "WebKitWebAPIStatisticsEnabled")
+        RuntimeEnabledFeatures::sharedFeatures().setWebAPIStatisticsEnabled(enabled);
+
     // Map the names used in LayoutTests with the names used in WebCore::Settings and WebPreferencesStore.
 #define FOR_EACH_OVERRIDE_BOOL_PREFERENCE(macro) \
     macro(WebKitJavaEnabled, JavaEnabled, javaEnabled) \

Modified: trunk/Tools/ChangeLog (235682 => 235683)


--- trunk/Tools/ChangeLog	2018-09-05 18:54:54 UTC (rev 235682)
+++ trunk/Tools/ChangeLog	2018-09-05 19:03:09 UTC (rev 235683)
@@ -1,3 +1,18 @@
+2018-09-05  Woodrow Wang  <[email protected]>
+
+        Added runtime feature flag for web API statistics
+        https://bugs.webkit.org/show_bug.cgi?id=189211
+
+        Reviewed by Daniel Bates.
+
+        Added functionality to set the runtime flag with a _javascript_ exposed function
+        for testing.
+
+        * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::setWebAPIStatisticsEnabled):
+        * WebKitTestRunner/InjectedBundle/TestRunner.h:
+
 2018-09-05  Ross Kirsling  <[email protected]>
 
         Add WinCairo to bot watcher's dashboard.

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (235682 => 235683)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl	2018-09-05 18:54:54 UTC (rev 235682)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl	2018-09-05 19:03:09 UTC (rev 235683)
@@ -324,6 +324,8 @@
     void setWebRTCUnifiedPlanEnabled(boolean value);
     void setCustomUserAgent(DOMString userAgent);
 
+    void setWebAPIStatisticsEnabled(boolean value);
+
     void terminateNetworkProcess();
     void terminateServiceWorkerProcess();
     void terminateStorageProcess();

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (235682 => 235683)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2018-09-05 18:54:54 UTC (rev 235682)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2018-09-05 19:03:09 UTC (rev 235683)
@@ -455,6 +455,13 @@
     WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), toWK(userAgent).get(), nullptr);
 }
 
+void TestRunner::setWebAPIStatisticsEnabled(bool enabled)
+{
+    WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitWebAPIStatisticsEnabled"));
+    auto& injectedBundle = InjectedBundle::singleton();
+    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
+}
+
 void TestRunner::setModernMediaControlsEnabled(bool enabled)
 {
     WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitModernMediaControlsEnabled"));

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (235682 => 235683)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2018-09-05 18:54:54 UTC (rev 235682)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2018-09-05 19:03:09 UTC (rev 235683)
@@ -133,6 +133,7 @@
     void setMDNSICECandidatesEnabled(bool);
     void setWebRTCUnifiedPlanEnabled(bool);
     void setCustomUserAgent(JSStringRef);
+    void setWebAPIStatisticsEnabled(bool);
 
     // Special DOM functions.
     void clearBackForwardList();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to