2011-06-27 Yuta Kitamura <yutak@chromium.org>
authoryutak@chromium.org <yutak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jun 2011 05:39:07 +0000 (05:39 +0000)
committeryutak@chromium.org <yutak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jun 2011 05:39:07 +0000 (05:39 +0000)
        Reviewed by Alexey Proskuryakov.

        [WebKit2] Add hixie76WebSocketProtocolEnabled flag to WebPreferences
        https://bugs.webkit.org/show_bug.cgi?id=63447

        Make a new flag added in WebCore::Settings (useHixie76WebSocketProtocol)
        switchable from WebPage and WebPreferences.

        * Shared/WebPreferencesStore.h:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetHixie76WebSocketProtocolEnabled):
        (WKPreferencesGetHixie76WebSocketProtocolEnabled):
        * UIProcess/API/C/WKPreferencesPrivate.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updatePreferences):

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

Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesStore.h
Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index 1adab05..a615367 100644 (file)
@@ -1,3 +1,21 @@
+2011-06-27  Yuta Kitamura  <yutak@chromium.org>
+
+        Reviewed by Alexey Proskuryakov.
+
+        [WebKit2] Add hixie76WebSocketProtocolEnabled flag to WebPreferences
+        https://bugs.webkit.org/show_bug.cgi?id=63447
+
+        Make a new flag added in WebCore::Settings (useHixie76WebSocketProtocol)
+        switchable from WebPage and WebPreferences.
+
+        * Shared/WebPreferencesStore.h:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetHixie76WebSocketProtocolEnabled):
+        (WKPreferencesGetHixie76WebSocketProtocolEnabled):
+        * UIProcess/API/C/WKPreferencesPrivate.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+
 2011-06-27  Jeff Miller  <jeffm@apple.com>
 
         Reviewed by Oliver Hunt.
index 29418f6..05b1420 100644 (file)
@@ -75,6 +75,7 @@ namespace WebKit {
     macro(AllowUniversalAccessFromFileURLs, allowUniversalAccessFromFileURLs, Bool, bool, false) \
     macro(AllowFileAccessFromFileURLs, allowFileAccessFromFileURLs, Bool, bool, false) \
     macro(AVFoundationEnabled, isAVFoundationEnabled, Bool, bool, true) \
+    macro(Hixie76WebSocketProtocolEnabled, hixie76WebSocketProtocolEnabled, Bool, bool, true) \
     \
 
 #define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
index e2b7085..b087640 100644 (file)
@@ -561,3 +561,13 @@ bool WKPreferencesGetFileAccessFromFileURLsAllowed(WKPreferencesRef preferencesR
 {
     return toImpl(preferencesRef)->allowFileAccessFromFileURLs();
 }
+
+void WKPreferencesSetHixie76WebSocketProtocolEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+    toImpl(preferencesRef)->setHixie76WebSocketProtocolEnabled(enabled);
+}
+
+bool WKPreferencesGetHixie76WebSocketProtocolEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->hixie76WebSocketProtocolEnabled();
+}
index c890468..f8e7ff3 100644 (file)
@@ -128,9 +128,12 @@ WK_EXPORT bool WKPreferencesGetUniversalAccessFromFileURLsAllowed(WKPreferencesR
 WK_EXPORT void WKPreferencesSetFileAccessFromFileURLsAllowed(WKPreferencesRef preferences, bool allowed);
 WK_EXPORT bool WKPreferencesGetFileAccessFromFileURLsAllowed(WKPreferencesRef preferences);
 
+// Defaults to true.
+WK_EXPORT void WKPreferencesSetHixie76WebSocketProtocolEnabled(WKPreferencesRef preferencesRef, bool enabled);
+WK_EXPORT bool WKPreferencesGetHixie76WebSocketProtocolEnabled(WKPreferencesRef preferencesRef);
+
 #ifdef __cplusplus
 }
 #endif
 
 #endif /* WKPreferencesPrivate_h */
-
index adf5266..8f27ecd 100644 (file)
@@ -1609,6 +1609,10 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
     settings->setAVFoundationEnabled(store.getBoolValueForKey(WebPreferencesKey::isAVFoundationEnabledKey()));
 #endif
 
+#if ENABLE(WEB_SOCKETS)
+    settings->setUseHixie76WebSocketProtocol(store.getBoolValueForKey(WebPreferencesKey::hixie76WebSocketProtocolEnabledKey()));
+#endif
+
     platformPreferencesDidChange(store);
 }