Title: [89669] trunk/Source
Revision
89669
Author
[email protected]
Date
2011-06-24 05:18:18 -0700 (Fri, 24 Jun 2011)

Log Message

2011-06-24  Yuta Kitamura  <[email protected]>

        Reviewed by Adam Barth.

        WebSocket: Add run-time flag for new HyBi protocol
        https://bugs.webkit.org/show_bug.cgi?id=60348

        Add a flag in Setting so that WebSocket protocols can be switched
        dynamically. The protocol we have implemented so far is based on
        older Hixie-76 specification. A new protocol is being discussed in
        IETF HyBi working group, and I'm planning to implement the new protocol
        behind this Settings flag.

        I will add a method to LayoutTestController which flips this flag in
        a later patch. In this way, we can put tests for both protocols in
        the same place and test implementation for both protocols at the same time.

        This patch only adds a flag. The flag is not used yet, thus there is
        no change in functionality. Therefore, no tests were added.

        * page/Settings.cpp:
        (WebCore::Settings::Settings):
        * page/Settings.h:
        (WebCore::Settings::setUseHixie76WebSocketProtocol):
        (WebCore::Settings::useHixie76WebSocketProtocol):
2011-06-24  Yuta Kitamura  <[email protected]>

        Reviewed by Adam Barth.

        WebSocket: Add run-time flag for new HyBi protocol
        https://bugs.webkit.org/show_bug.cgi?id=60348

        Make a new flag (Setting::m_useHixie76WebSocketProtocol)
        switchable from WebView and WebPreferences.

        * WebView/WebPreferenceKeysPrivate.h:
        * WebView/WebPreferences.mm:
        (+[WebPreferences initialize]):
        (-[WebPreferences setHixie76WebSocketProtocolEnabled:]):
        (-[WebPreferences isHixie76WebSocketProtocolEnabled]):
        * WebView/WebPreferencesPrivate.h:
        * WebView/WebView.mm:
        (-[WebView _preferencesChanged:]):
2011-06-24  Yuta Kitamura  <[email protected]>

        Reviewed by Adam Barth.

        WebSocket: Add run-time flag for new HyBi protocol
        https://bugs.webkit.org/show_bug.cgi?id=60348

        Make a new flag (Setting::m_useHixie76WebSocketProtocol)
        switchable from WebView and WebPreferences.

        * Interfaces/IWebPreferencesPrivate.idl:
        * WebPreferenceKeysPrivate.h:
        * WebPreferences.cpp:
        (WebPreferences::initializeDefaultSettings):
        (WebPreferences::setHixie76WebSocketProtocolEnabled):
        (WebPreferences::hixie76WebSocketProtocolEnabled):
        * WebPreferences.h:
        * WebView.cpp:
        (WebView::notifyPreferencesChanged):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (89668 => 89669)


--- trunk/Source/WebCore/ChangeLog	2011-06-24 12:02:11 UTC (rev 89668)
+++ trunk/Source/WebCore/ChangeLog	2011-06-24 12:18:18 UTC (rev 89669)
@@ -1,3 +1,29 @@
+2011-06-24  Yuta Kitamura  <[email protected]>
+
+        Reviewed by Adam Barth.
+
+        WebSocket: Add run-time flag for new HyBi protocol
+        https://bugs.webkit.org/show_bug.cgi?id=60348
+
+        Add a flag in Setting so that WebSocket protocols can be switched
+        dynamically. The protocol we have implemented so far is based on
+        older Hixie-76 specification. A new protocol is being discussed in
+        IETF HyBi working group, and I'm planning to implement the new protocol
+        behind this Settings flag.
+
+        I will add a method to LayoutTestController which flips this flag in
+        a later patch. In this way, we can put tests for both protocols in
+        the same place and test implementation for both protocols at the same time.
+
+        This patch only adds a flag. The flag is not used yet, thus there is
+        no change in functionality. Therefore, no tests were added.
+
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings):
+        * page/Settings.h:
+        (WebCore::Settings::setUseHixie76WebSocketProtocol):
+        (WebCore::Settings::useHixie76WebSocketProtocol):
+
 2011-06-23  Mikhail Naganov  <[email protected]>
 
         Reviewed by Pavel Feldman.

Modified: trunk/Source/WebCore/page/Settings.cpp (89668 => 89669)


--- trunk/Source/WebCore/page/Settings.cpp	2011-06-24 12:02:11 UTC (rev 89668)
+++ trunk/Source/WebCore/page/Settings.cpp	2011-06-24 12:18:18 UTC (rev 89669)
@@ -185,6 +185,9 @@
 #if ENABLE(SMOOTH_SCROLLING)
     , m_scrollAnimatorEnabled(false)
 #endif
+#if ENABLE(WEB_SOCKETS)
+    , m_useHixie76WebSocketProtocol(true)
+#endif
     , m_loadsImagesAutomaticallyTimer(this, &Settings::loadsImagesAutomaticallyTimerFired)
 {
     // A Frame may not have been created yet, so we initialize the AtomicString 

Modified: trunk/Source/WebCore/page/Settings.h (89668 => 89669)


--- trunk/Source/WebCore/page/Settings.h	2011-06-24 12:02:11 UTC (rev 89668)
+++ trunk/Source/WebCore/page/Settings.h	2011-06-24 12:18:18 UTC (rev 89669)
@@ -413,6 +413,10 @@
         void setEnableScrollAnimator(bool flag) { m_scrollAnimatorEnabled = flag; }
         bool scrollAnimatorEnabled() const { return m_scrollAnimatorEnabled; }
 #endif
+#if ENABLE(WEB_SOCKETS)
+        void setUseHixie76WebSocketProtocol(bool flag) { m_useHixie76WebSocketProtocol = flag; }
+        bool useHixie76WebSocketProtocol() { return m_useHixie76WebSocketProtocol; }
+#endif
 
     private:
         Page* m_page;
@@ -523,6 +527,9 @@
 #if ENABLE(SMOOTH_SCROLLING)
         bool m_scrollAnimatorEnabled : 1;
 #endif
+#if ENABLE(WEB_SOCKETS)
+        bool m_useHixie76WebSocketProtocol : 1;
+#endif
 
         Timer<Settings> m_loadsImagesAutomaticallyTimer;
         void loadsImagesAutomaticallyTimerFired(Timer<Settings>*);

Modified: trunk/Source/WebKit/mac/ChangeLog (89668 => 89669)


--- trunk/Source/WebKit/mac/ChangeLog	2011-06-24 12:02:11 UTC (rev 89668)
+++ trunk/Source/WebKit/mac/ChangeLog	2011-06-24 12:18:18 UTC (rev 89669)
@@ -1,3 +1,22 @@
+2011-06-24  Yuta Kitamura  <[email protected]>
+
+        Reviewed by Adam Barth.
+
+        WebSocket: Add run-time flag for new HyBi protocol
+        https://bugs.webkit.org/show_bug.cgi?id=60348
+
+        Make a new flag (Setting::m_useHixie76WebSocketProtocol)
+        switchable from WebView and WebPreferences.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences setHixie76WebSocketProtocolEnabled:]):
+        (-[WebPreferences isHixie76WebSocketProtocolEnabled]):
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2011-06-22  Sam Weinig  <[email protected]>
 
         Roll out r89469 (Add preference for setting the html parser depth limit)

Modified: trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h (89668 => 89669)


--- trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2011-06-24 12:02:11 UTC (rev 89668)
+++ trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2011-06-24 12:18:18 UTC (rev 89669)
@@ -107,6 +107,7 @@
 #define WebKitMemoryInfoEnabledPreferenceKey @"WebKitMemoryInfoEnabled"
 #define WebKitHyperlinkAuditingEnabledPreferenceKey @"WebKitHyperlinkAuditingEnabled"
 #define WebKitAVFoundationEnabledKey @"WebKitAVFoundationEnabled"
+#define WebKitHixie76WebSocketProtocolEnabledKey @"WebKitHixie76WebSocketProtocolEnabled"
 
 // These are private both because callers should be using the cover methods and because the
 // cover methods themselves are private.

Modified: trunk/Source/WebKit/mac/WebView/WebPreferences.mm (89668 => 89669)


--- trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2011-06-24 12:02:11 UTC (rev 89668)
+++ trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2011-06-24 12:18:18 UTC (rev 89669)
@@ -376,6 +376,7 @@
         [NSNumber numberWithBool:YES],  WebKitHyperlinkAuditingEnabledPreferenceKey,
         [NSNumber numberWithBool:NO],   WebKitUsePreHTML5ParserQuirksKey,
         [NSNumber numberWithBool:YES],  WebKitAVFoundationEnabledKey,
+        [NSNumber numberWithBool:YES],  WebKitHixie76WebSocketProtocolEnabledKey,
         [NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
         [NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheDefaultOriginQuota,
         nil];
@@ -1472,6 +1473,16 @@
 {
     return [self _boolValueForKey:WebKitAVFoundationEnabledKey];
 }
+
+- (void)setHixie76WebSocketProtocolEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitHixie76WebSocketProtocolEnabledKey];
+}
+
+- (BOOL)isHixie76WebSocketProtocolEnabled
+{
+    return [self _boolValueForKey:WebKitHixie76WebSocketProtocolEnabledKey];
+}
 @end
 
 @implementation WebPreferences (WebInternal)

Modified: trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (89668 => 89669)


--- trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2011-06-24 12:02:11 UTC (rev 89668)
+++ trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2011-06-24 12:18:18 UTC (rev 89669)
@@ -246,4 +246,8 @@
 - (void)setAVFoundationEnabled:(BOOL)flag;
 - (BOOL)isAVFoundationEnabled;
 
+// WebSocket support depends on ENABLE(WEB_SOCKETS).
+- (void)setHixie76WebSocketProtocolEnabled:(BOOL)flag;
+- (BOOL)isHixie76WebSocketProtocolEnabled;
+
 @end

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (89668 => 89669)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2011-06-24 12:02:11 UTC (rev 89668)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2011-06-24 12:18:18 UTC (rev 89669)
@@ -1580,6 +1580,9 @@
     settings->setAVFoundationEnabled(false);
 #endif
 #endif
+#if ENABLE(WEB_SOCKETS)
+    settings->setUseHixie76WebSocketProtocol([preferences isHixie76WebSocketProtocolEnabled]);
+#endif
 
     // Application Cache Preferences are stored on the global cache storage manager, not in Settings.
     [WebApplicationCache setDefaultOriginQuota:[preferences applicationCacheDefaultOriginQuota]];

Modified: trunk/Source/WebKit/win/ChangeLog (89668 => 89669)


--- trunk/Source/WebKit/win/ChangeLog	2011-06-24 12:02:11 UTC (rev 89668)
+++ trunk/Source/WebKit/win/ChangeLog	2011-06-24 12:18:18 UTC (rev 89669)
@@ -1,3 +1,23 @@
+2011-06-24  Yuta Kitamura  <[email protected]>
+
+        Reviewed by Adam Barth.
+
+        WebSocket: Add run-time flag for new HyBi protocol
+        https://bugs.webkit.org/show_bug.cgi?id=60348
+
+        Make a new flag (Setting::m_useHixie76WebSocketProtocol)
+        switchable from WebView and WebPreferences.
+
+        * Interfaces/IWebPreferencesPrivate.idl:
+        * WebPreferenceKeysPrivate.h:
+        * WebPreferences.cpp:
+        (WebPreferences::initializeDefaultSettings):
+        (WebPreferences::setHixie76WebSocketProtocolEnabled):
+        (WebPreferences::hixie76WebSocketProtocolEnabled):
+        * WebPreferences.h:
+        * WebView.cpp:
+        (WebView::notifyPreferencesChanged):
+
 2011-06-22  Dominic Cooney  <[email protected]>
 
         Reviewed by Mark Rowe.

Modified: trunk/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl (89668 => 89669)


--- trunk/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl	2011-06-24 12:02:11 UTC (rev 89668)
+++ trunk/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl	2011-06-24 12:18:18 UTC (rev 89669)
@@ -127,4 +127,7 @@
 
     HRESULT setFullScreenEnabled([in] BOOL enabled);
     HRESULT isFullScreenEnabled([out, retval] BOOL* enabled);
+
+    HRESULT setHixie76WebSocketProtocolEnabled([in] BOOL enabled);
+    HRESULT hixie76WebSocketProtocolEnabled([out, retval] BOOL* enabled);
 }

Modified: trunk/Source/WebKit/win/WebPreferenceKeysPrivate.h (89668 => 89669)


--- trunk/Source/WebKit/win/WebPreferenceKeysPrivate.h	2011-06-24 12:02:11 UTC (rev 89668)
+++ trunk/Source/WebKit/win/WebPreferenceKeysPrivate.h	2011-06-24 12:18:18 UTC (rev 89669)
@@ -152,3 +152,5 @@
 #define WebKitMemoryInfoEnabledPreferenceKey "WebKitMemoryInfoEnabled"
 
 #define WebKitFullScreenEnabledPreferenceKey "WebKitFullScreenEnabled"
+
+#define WebKitHixie76WebSocketProtocolEnabledPreferenceKey "WebKitHixie76WebSocketProtocolEnabled"

Modified: trunk/Source/WebKit/win/WebPreferences.cpp (89668 => 89669)


--- trunk/Source/WebKit/win/WebPreferences.cpp	2011-06-24 12:02:11 UTC (rev 89668)
+++ trunk/Source/WebKit/win/WebPreferences.cpp	2011-06-24 12:18:18 UTC (rev 89669)
@@ -266,6 +266,7 @@
 
     CFDictionaryAddValue(defaults, CFSTR(WebKitMemoryInfoEnabledPreferenceKey), kCFBooleanFalse);
     CFDictionaryAddValue(defaults, CFSTR(WebKitHyperlinkAuditingEnabledPreferenceKey), kCFBooleanTrue);
+    CFDictionaryAddValue(defaults, CFSTR(WebKitHixie76WebSocketProtocolEnabledPreferenceKey), kCFBooleanTrue);
 
     defaultSettings = defaults;
 }
@@ -942,6 +943,20 @@
     return S_OK;
 }
 
+HRESULT STDMETHODCALLTYPE WebPreferences::setHixie76WebSocketProtocolEnabled(
+    /* [in] */ BOOL enabled)
+{
+    setBoolValue(CFSTR(WebKitHixie76WebSocketProtocolEnabledPreferenceKey), enabled);
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebPreferences::hixie76WebSocketProtocolEnabled(
+    /* [retval][out] */ BOOL* enabled)
+{
+    *enabled = boolValueForKey(CFSTR(WebKitHixie76WebSocketProtocolEnabledPreferenceKey));
+    return S_OK;
+}
+
 HRESULT STDMETHODCALLTYPE WebPreferences::setAutosaves( 
     /* [in] */ BOOL enabled)
 {

Modified: trunk/Source/WebKit/win/WebPreferences.h (89668 => 89669)


--- trunk/Source/WebKit/win/WebPreferences.h	2011-06-24 12:02:11 UTC (rev 89668)
+++ trunk/Source/WebKit/win/WebPreferences.h	2011-06-24 12:18:18 UTC (rev 89669)
@@ -435,6 +435,9 @@
     virtual HRESULT STDMETHODCALLTYPE setFullScreenEnabled(BOOL);
     virtual HRESULT STDMETHODCALLTYPE isFullScreenEnabled(BOOL*);
 
+    virtual HRESULT STDMETHODCALLTYPE hixie76WebSocketProtocolEnabled(BOOL*);
+    virtual HRESULT STDMETHODCALLTYPE setHixie76WebSocketProtocolEnabled(BOOL);
+
     // WebPreferences
 
     // This method accesses a different preference key than developerExtrasEnabled.

Modified: trunk/Source/WebKit/win/WebView.cpp (89668 => 89669)


--- trunk/Source/WebKit/win/WebView.cpp	2011-06-24 12:02:11 UTC (rev 89668)
+++ trunk/Source/WebKit/win/WebView.cpp	2011-06-24 12:18:18 UTC (rev 89669)
@@ -4849,6 +4849,13 @@
         return hr;
     settings->setLoadsSiteIconsIgnoringImageLoadingSetting(!!enabled);
 
+#if ENABLE(WEB_SOCKETS)
+    hr = prefsPrivate->hixie76WebSocketProtocolEnabled(&enabled);
+    if (FAILED(hr))
+        return hr;
+    settings->setUseHixie76WebSocketProtocol(enabled);
+#endif
+
     if (!m_closeWindowTimer)
         m_mainFrame->invalidate(); // FIXME
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to