[WebCrypto] Remove experimental feature flag of SubtleCrypto
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Jun 2017 20:27:00 +0000 (20:27 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Jun 2017 20:27:00 +0000 (20:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173197
<rdar://problem/32688148>

Reviewed by Brent Fulgham.

Source/WebCore:

The SubtleCrypto implementation is no longer experimental and is ready for production use. We are therefore removing the runtime flag.

No tests.

* page/Crypto.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setSubtleCryptoEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::subtleCryptoEnabled): Deleted.

Source/WebKit/mac:

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences subtleCryptoEnabled]): Deleted.
(-[WebPreferences setSubtleCryptoEnabled:]): Deleted.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetSubtleCryptoEnabled): Deleted.
(WKPreferencesGetSubtleCryptoEnabled): Deleted.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setSubtleCryptoEnabled): Deleted.
* WebKitTestRunner/InjectedBundle/TestRunner.h:

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

18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/page/Crypto.idl
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit/mac/WebView/WebPreferencesPrivate.h
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesDefinitions.h
Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.h

index 68cf3fe..63f0949 100644 (file)
@@ -1,3 +1,20 @@
+2017-06-12  Jiewen Tan  <jiewen_tan@apple.com>
+
+        [WebCrypto] Remove experimental feature flag of SubtleCrypto
+        https://bugs.webkit.org/show_bug.cgi?id=173197
+        <rdar://problem/32688148>
+
+        Reviewed by Brent Fulgham.
+
+        The SubtleCrypto implementation is no longer experimental and is ready for production use. We are therefore removing the runtime flag.
+
+        No tests.
+
+        * page/Crypto.idl:
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setSubtleCryptoEnabled): Deleted.
+        (WebCore::RuntimeEnabledFeatures::subtleCryptoEnabled): Deleted.
+
 2017-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [iOS DnD] Allow the injected bundle to add client data when writing an image to the pasteboard
index 05dbee1..24fb5cb 100644 (file)
@@ -31,7 +31,7 @@
     Exposed=(Window,Worker),
     GenerateIsReachable=ImplScriptExecutionContext,
 ] interface Crypto {
-    [Conditional=SUBTLE_CRYPTO, EnabledAtRuntime=SubtleCrypto] readonly attribute SubtleCrypto subtle;
+    [Conditional=SUBTLE_CRYPTO] readonly attribute SubtleCrypto subtle;
     [Custom, MayThrowException] ArrayBufferView getRandomValues(ArrayBufferView array);
 
     // Will be deprecated.
index e326e67..e730fc7 100644 (file)
@@ -188,11 +188,6 @@ public:
     bool encryptedMediaAPIEnabled() const { return m_encryptedMediaAPIEnabled; }
 #endif
 
-#if ENABLE(SUBTLE_CRYPTO)
-    void setSubtleCryptoEnabled(bool isEnabled) { m_isSubtleCryptoEnabled = isEnabled; }
-    bool subtleCryptoEnabled() const { return m_isSubtleCryptoEnabled; }
-#endif
-
 #if ENABLE(VIDEO)
     bool audioEnabled() const;
 #endif
@@ -305,10 +300,6 @@ private:
     bool m_intersectionObserverEnabled { false };
 #endif
 
-#if ENABLE(SUBTLE_CRYPTO)
-    bool m_isSubtleCryptoEnabled { true };
-#endif
-
     friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>;
 };
 
index 0a9e65e..7b899bc 100644 (file)
@@ -1,3 +1,19 @@
+2017-06-12  Jiewen Tan  <jiewen_tan@apple.com>
+
+        [WebCrypto] Remove experimental feature flag of SubtleCrypto
+        https://bugs.webkit.org/show_bug.cgi?id=173197
+        <rdar://problem/32688148>
+
+        Reviewed by Brent Fulgham.
+
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences subtleCryptoEnabled]): Deleted.
+        (-[WebPreferences setSubtleCryptoEnabled:]): Deleted.
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2017-06-10  Dan Bernstein  <mitz@apple.com>
 
         Reverted r218056 because it made the IDE reindex constantly.
index 34052b3..8366fa9 100644 (file)
@@ -652,9 +652,6 @@ public:
 #endif
 
         [NSNumber numberWithBool:YES], WebKitNeedsStorageAccessFromFileURLsQuirkKey,
-#if ENABLE(SUBTLE_CRYPTO)
-        [NSNumber numberWithBool:YES], WebKitSubtleCryptoEnabledPreferenceKey,
-#endif
 #if ENABLE(MEDIA_STREAM)
         [NSNumber numberWithBool:NO], WebKitMediaDevicesEnabledPreferenceKey,
         [NSNumber numberWithBool:YES], WebKitMediaStreamEnabledPreferenceKey,
@@ -2755,16 +2752,6 @@ static NSString *classIBCreatorID = nil;
     [self _setStringValue:directory forKey:WebKitMediaKeysStorageDirectoryKey];
 }
 
-- (BOOL)subtleCryptoEnabled
-{
-    return [self _boolValueForKey:WebKitSubtleCryptoEnabledPreferenceKey];
-}
-
-- (void)setSubtleCryptoEnabled:(BOOL)flag
-{
-    [self _setBoolValue:flag forKey:WebKitSubtleCryptoEnabledPreferenceKey];
-}
-
 - (BOOL)mediaDevicesEnabled
 {
     return [self _boolValueForKey:WebKitMediaDevicesEnabledPreferenceKey];
index cfd63bf..592f308 100644 (file)
@@ -159,9 +159,6 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification;
 - (BOOL)isSpatialNavigationEnabled;
 - (void)setSpatialNavigationEnabled:(BOOL)flag;
 
-- (void)setSubtleCryptoEnabled:(BOOL)flag;
-- (BOOL)subtleCryptoEnabled;
-
 - (void)setMediaDevicesEnabled:(BOOL)flag;
 - (BOOL)mediaDevicesEnabled;
 
index 82cc670..5cec238 100644 (file)
@@ -3052,10 +3052,6 @@ static bool needsSelfRetainWhileLoadingQuirk()
 #endif
     RuntimeEnabledFeatures::sharedFeatures().setDisplayContentsEnabled(preferences.displayContentsEnabled);
 
-#if ENABLE(SUBTLE_CRYPTO)
-    RuntimeEnabledFeatures::sharedFeatures().setSubtleCryptoEnabled([preferences subtleCryptoEnabled]);
-#endif
-
     RuntimeEnabledFeatures::sharedFeatures().setUserTimingEnabled(preferences.userTimingEnabled);
     RuntimeEnabledFeatures::sharedFeatures().setResourceTimingEnabled(preferences.resourceTimingEnabled);
     RuntimeEnabledFeatures::sharedFeatures().setLinkPreloadEnabled(preferences.linkPreloadEnabled);
index 90282c9..f80f51b 100644 (file)
@@ -1,3 +1,21 @@
+2017-06-12  Jiewen Tan  <jiewen_tan@apple.com>
+
+        [WebCrypto] Remove experimental feature flag of SubtleCrypto
+        https://bugs.webkit.org/show_bug.cgi?id=173197
+        <rdar://problem/32688148>
+
+        Reviewed by Brent Fulgham.
+
+        * Shared/WebPreferencesDefinitions.h:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetSubtleCryptoEnabled): Deleted.
+        (WKPreferencesGetSubtleCryptoEnabled): Deleted.
+        * UIProcess/API/C/WKPreferencesRefPrivate.h:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+
 2017-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [iOS DnD] Allow the injected bundle to add client data when writing an image to the pasteboard
index 9ed78df..c39293f 100644 (file)
     macro(LinkPreloadEnabled, linkPreloadEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "Link Preload", "Link preload support") \
     macro(WebRTCLegacyAPIDisabled, webRTCLegacyAPIDisabled, Bool, bool, false, "Remove Legacy WebRTC API", "Remove Legacy WebRTC API") \
     macro(SubresourceIntegrityEnabled, subresourceIntegrityEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "SubresourceIntegrity", "Enable SubresourceIntegrity") \
-    macro(SubtleCryptoEnabled, subtleCryptoEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "SubtleCrypto", "Enable SubtleCrypto support") \
     macro(ViewportFitEnabled, viewportFitEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "Viewport Fit", "Enable viewport-fit viewport parameter") \
     macro(WebAnimationsEnabled, webAnimationsEnabled, Bool, bool, false, "Web Animations", "Web Animations prototype") \
     macro(WebGL2Enabled, webGL2Enabled, Bool, bool, false, "WebGL 2.0", "WebGL 2 prototype") \
index 9e2ffd3..f8f8254 100644 (file)
@@ -1711,16 +1711,6 @@ void WKPreferencesSetApplePayCapabilityDisclosureAllowed(WKPreferencesRef prefer
     WebKit::toImpl(preferencesRef)->setApplePayCapabilityDisclosureAllowed(allowed);
 }
 
-void WKPreferencesSetSubtleCryptoEnabled(WKPreferencesRef preferencesRef, bool flag)
-{
-    toImpl(preferencesRef)->setSubtleCryptoEnabled(flag);
-}
-
-bool WKPreferencesGetSubtleCryptoEnabled(WKPreferencesRef preferencesRef)
-{
-    return toImpl(preferencesRef)->subtleCryptoEnabled();
-}
-
 void WKPreferencesSetLinkPreloadEnabled(WKPreferencesRef preferencesRef, bool flag)
 {
     toImpl(preferencesRef)->setLinkPreloadEnabled(flag);
index 5d1f559..b328156 100644 (file)
@@ -465,10 +465,6 @@ WK_EXPORT bool WKPreferencesGetUserTimingEnabled(WKPreferencesRef);
 WK_EXPORT void WKPreferencesSetResourceTimingEnabled(WKPreferencesRef, bool flag);
 WK_EXPORT bool WKPreferencesGetResourceTimingEnabled(WKPreferencesRef);
 
-// Defaults to true
-WK_EXPORT void WKPreferencesSetSubtleCryptoEnabled(WKPreferencesRef, bool flag);
-WK_EXPORT bool WKPreferencesGetSubtleCryptoEnabled(WKPreferencesRef);
-
 // Defaults to true.
 WK_EXPORT void WKPreferencesSetLargeImageAsyncDecodingEnabled(WKPreferencesRef preferencesRef, bool flag);
 WK_EXPORT bool WKPreferencesGetLargeImageAsyncDecodingEnabled(WKPreferencesRef preferencesRef);
index 61d9cc0..1bab3cb 100644 (file)
@@ -214,11 +214,6 @@ void InjectedBundle::overrideBoolPreferenceForTestRunner(WebPageGroupProxy* page
         RuntimeEnabledFeatures::sharedFeatures().setEncryptedMediaAPIEnabled(enabled);
 #endif
 
-#if ENABLE(SUBTLE_CRYPTO)
-    if (preference == "WebKitSubtleCryptoEnabled")
-        RuntimeEnabledFeatures::sharedFeatures().setSubtleCryptoEnabled(enabled);
-#endif
-
 #if ENABLE(MEDIA_STREAM)
     if (preference == "WebKitMediaDevicesEnabled")
         RuntimeEnabledFeatures::sharedFeatures().setMediaDevicesEnabled(enabled);
index b9fdd82..8a2bdf7 100644 (file)
@@ -3373,10 +3373,6 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
         updateThrottleState();
     }
 
-#if ENABLE(SUBTLE_CRYPTO)
-    RuntimeEnabledFeatures::sharedFeatures().setSubtleCryptoEnabled(store.getBoolValueForKey(WebPreferencesKey::subtleCryptoEnabledKey()));
-#endif
-
     settings.setSubresourceIntegrityEnabled(store.getBoolValueForKey(WebPreferencesKey::subresourceIntegrityEnabledKey()));
 
     platformPreferencesDidChange(store);
index 46226d2..3044229 100644 (file)
@@ -1,3 +1,19 @@
+2017-06-12  Jiewen Tan  <jiewen_tan@apple.com>
+
+        [WebCrypto] Remove experimental feature flag of SubtleCrypto
+        https://bugs.webkit.org/show_bug.cgi?id=173197
+        <rdar://problem/32688148>
+
+        Reviewed by Brent Fulgham.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (enableExperimentalFeatures):
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+        (WTR::InjectedBundle::beginTesting):
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::setSubtleCryptoEnabled): Deleted.
+        * WebKitTestRunner/InjectedBundle/TestRunner.h:
+
 2017-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [iOS DnD] Allow the injected bundle to add client data when writing an image to the pasteboard
index a9f2003..8b65145 100644 (file)
@@ -845,7 +845,6 @@ static void enableExperimentalFeatures(WebPreferences* preferences)
     [preferences setLinkPreloadEnabled:YES];
     [preferences setMediaPreloadingEnabled:YES];
     // FIXME: InputEvents
-    [preferences setSubtleCryptoEnabled:YES];
     [preferences setWebAnimationsEnabled:YES];
     [preferences setWebGL2Enabled:YES];
     [preferences setWebGPUEnabled:YES];
index a727b24..893b227 100644 (file)
@@ -347,8 +347,6 @@ void InjectedBundle::beginTesting(WKDictionaryRef settings)
     m_testRunner->setTabKeyCyclesThroughElements(true);
     m_testRunner->clearTestRunnerCallbacks();
 
-    m_testRunner->setSubtleCryptoEnabled(true);
-
     if (m_timeout > 0)
         m_testRunner->setCustomTimeout(m_timeout);
 
index e1f2cbf..435443e 100644 (file)
@@ -353,13 +353,6 @@ void TestRunner::setXSSAuditorEnabled(bool enabled)
     WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
 }
 
-void TestRunner::setSubtleCryptoEnabled(bool enabled)
-{
-    WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitSubtleCryptoEnabled"));
-    auto& injectedBundle = InjectedBundle::singleton();
-    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
-}
-
 void TestRunner::setMediaDevicesEnabled(bool enabled)
 {
     WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitMediaDevicesEnabled"));
index b961003..e9c4eaa 100644 (file)
@@ -127,7 +127,6 @@ public:
     void setAsynchronousSpellCheckingEnabled(bool);
     void setAllowsAnySSLCertificate(bool);
     void setEncryptedMediaAPIEnabled(bool);
-    void setSubtleCryptoEnabled(bool);
     void setMediaDevicesEnabled(bool);
     void setWebRTCLegacyAPIEnabled(bool);