Changeset 89669 in webkit


Ignore:
Timestamp:
Jun 24, 2011 5:18:18 AM (13 years ago)
Author:
yutak@chromium.org
Message:

2011-06-24 Yuta Kitamura <yutak@chromium.org>

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 <yutak@chromium.org>

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 <yutak@chromium.org>

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):
Location:
trunk/Source
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r89666 r89669  
     12011-06-24  Yuta Kitamura  <yutak@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        WebSocket: Add run-time flag for new HyBi protocol
     6        https://bugs.webkit.org/show_bug.cgi?id=60348
     7
     8        Add a flag in Setting so that WebSocket protocols can be switched
     9        dynamically. The protocol we have implemented so far is based on
     10        older Hixie-76 specification. A new protocol is being discussed in
     11        IETF HyBi working group, and I'm planning to implement the new protocol
     12        behind this Settings flag.
     13
     14        I will add a method to LayoutTestController which flips this flag in
     15        a later patch. In this way, we can put tests for both protocols in
     16        the same place and test implementation for both protocols at the same time.
     17
     18        This patch only adds a flag. The flag is not used yet, thus there is
     19        no change in functionality. Therefore, no tests were added.
     20
     21        * page/Settings.cpp:
     22        (WebCore::Settings::Settings):
     23        * page/Settings.h:
     24        (WebCore::Settings::setUseHixie76WebSocketProtocol):
     25        (WebCore::Settings::useHixie76WebSocketProtocol):
     26
    1272011-06-23  Mikhail Naganov  <mnaganov@chromium.org>
    228
  • trunk/Source/WebCore/page/Settings.cpp

    r89655 r89669  
    186186    , m_scrollAnimatorEnabled(false)
    187187#endif
     188#if ENABLE(WEB_SOCKETS)
     189    , m_useHixie76WebSocketProtocol(true)
     190#endif
    188191    , m_loadsImagesAutomaticallyTimer(this, &Settings::loadsImagesAutomaticallyTimerFired)
    189192{
  • trunk/Source/WebCore/page/Settings.h

    r89655 r89669  
    413413        void setEnableScrollAnimator(bool flag) { m_scrollAnimatorEnabled = flag; }
    414414        bool scrollAnimatorEnabled() const { return m_scrollAnimatorEnabled; }
     415#endif
     416#if ENABLE(WEB_SOCKETS)
     417        void setUseHixie76WebSocketProtocol(bool flag) { m_useHixie76WebSocketProtocol = flag; }
     418        bool useHixie76WebSocketProtocol() { return m_useHixie76WebSocketProtocol; }
    415419#endif
    416420
     
    524528        bool m_scrollAnimatorEnabled : 1;
    525529#endif
     530#if ENABLE(WEB_SOCKETS)
     531        bool m_useHixie76WebSocketProtocol : 1;
     532#endif
    526533
    527534        Timer<Settings> m_loadsImagesAutomaticallyTimer;
  • trunk/Source/WebKit/mac/ChangeLog

    r89501 r89669  
     12011-06-24  Yuta Kitamura  <yutak@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        WebSocket: Add run-time flag for new HyBi protocol
     6        https://bugs.webkit.org/show_bug.cgi?id=60348
     7
     8        Make a new flag (Setting::m_useHixie76WebSocketProtocol)
     9        switchable from WebView and WebPreferences.
     10
     11        * WebView/WebPreferenceKeysPrivate.h:
     12        * WebView/WebPreferences.mm:
     13        (+[WebPreferences initialize]):
     14        (-[WebPreferences setHixie76WebSocketProtocolEnabled:]):
     15        (-[WebPreferences isHixie76WebSocketProtocolEnabled]):
     16        * WebView/WebPreferencesPrivate.h:
     17        * WebView/WebView.mm:
     18        (-[WebView _preferencesChanged:]):
     19
    1202011-06-22  Sam Weinig  <sam@webkit.org>
    221
  • trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h

    r89501 r89669  
    108108#define WebKitHyperlinkAuditingEnabledPreferenceKey @"WebKitHyperlinkAuditingEnabled"
    109109#define WebKitAVFoundationEnabledKey @"WebKitAVFoundationEnabled"
     110#define WebKitHixie76WebSocketProtocolEnabledKey @"WebKitHixie76WebSocketProtocolEnabled"
    110111
    111112// These are private both because callers should be using the cover methods and because the
  • trunk/Source/WebKit/mac/WebView/WebPreferences.mm

    r89501 r89669  
    377377        [NSNumber numberWithBool:NO],   WebKitUsePreHTML5ParserQuirksKey,
    378378        [NSNumber numberWithBool:YES],  WebKitAVFoundationEnabledKey,
     379        [NSNumber numberWithBool:YES],  WebKitHixie76WebSocketProtocolEnabledKey,
    379380        [NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
    380381        [NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheDefaultOriginQuota,
     
    14731474    return [self _boolValueForKey:WebKitAVFoundationEnabledKey];
    14741475}
     1476
     1477- (void)setHixie76WebSocketProtocolEnabled:(BOOL)flag
     1478{
     1479    [self _setBoolValue:flag forKey:WebKitHixie76WebSocketProtocolEnabledKey];
     1480}
     1481
     1482- (BOOL)isHixie76WebSocketProtocolEnabled
     1483{
     1484    return [self _boolValueForKey:WebKitHixie76WebSocketProtocolEnabledKey];
     1485}
    14751486@end
    14761487
  • trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h

    r89501 r89669  
    247247- (BOOL)isAVFoundationEnabled;
    248248
     249// WebSocket support depends on ENABLE(WEB_SOCKETS).
     250- (void)setHixie76WebSocketProtocolEnabled:(BOOL)flag;
     251- (BOOL)isHixie76WebSocketProtocolEnabled;
     252
    249253@end
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r89501 r89669  
    15811581#endif
    15821582#endif
     1583#if ENABLE(WEB_SOCKETS)
     1584    settings->setUseHixie76WebSocketProtocol([preferences isHixie76WebSocketProtocolEnabled]);
     1585#endif
    15831586
    15841587    // Application Cache Preferences are stored on the global cache storage manager, not in Settings.
  • trunk/Source/WebKit/win/ChangeLog

    r89530 r89669  
     12011-06-24  Yuta Kitamura  <yutak@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        WebSocket: Add run-time flag for new HyBi protocol
     6        https://bugs.webkit.org/show_bug.cgi?id=60348
     7
     8        Make a new flag (Setting::m_useHixie76WebSocketProtocol)
     9        switchable from WebView and WebPreferences.
     10
     11        * Interfaces/IWebPreferencesPrivate.idl:
     12        * WebPreferenceKeysPrivate.h:
     13        * WebPreferences.cpp:
     14        (WebPreferences::initializeDefaultSettings):
     15        (WebPreferences::setHixie76WebSocketProtocolEnabled):
     16        (WebPreferences::hixie76WebSocketProtocolEnabled):
     17        * WebPreferences.h:
     18        * WebView.cpp:
     19        (WebView::notifyPreferencesChanged):
     20
    1212011-06-22  Dominic Cooney  <dominicc@chromium.org>
    222
  • trunk/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl

    r85389 r89669  
    128128    HRESULT setFullScreenEnabled([in] BOOL enabled);
    129129    HRESULT isFullScreenEnabled([out, retval] BOOL* enabled);
     130
     131    HRESULT setHixie76WebSocketProtocolEnabled([in] BOOL enabled);
     132    HRESULT hixie76WebSocketProtocolEnabled([out, retval] BOOL* enabled);
    130133}
  • trunk/Source/WebKit/win/WebPreferenceKeysPrivate.h

    r85389 r89669  
    153153
    154154#define WebKitFullScreenEnabledPreferenceKey "WebKitFullScreenEnabled"
     155
     156#define WebKitHixie76WebSocketProtocolEnabledPreferenceKey "WebKitHixie76WebSocketProtocolEnabled"
  • trunk/Source/WebKit/win/WebPreferences.cpp

    r85389 r89669  
    267267    CFDictionaryAddValue(defaults, CFSTR(WebKitMemoryInfoEnabledPreferenceKey), kCFBooleanFalse);
    268268    CFDictionaryAddValue(defaults, CFSTR(WebKitHyperlinkAuditingEnabledPreferenceKey), kCFBooleanTrue);
     269    CFDictionaryAddValue(defaults, CFSTR(WebKitHixie76WebSocketProtocolEnabledPreferenceKey), kCFBooleanTrue);
    269270
    270271    defaultSettings = defaults;
     
    940941{
    941942    *enabled = boolValueForKey(CFSTR(WebKitLoadSiteIconsKey));
     943    return S_OK;
     944}
     945
     946HRESULT STDMETHODCALLTYPE WebPreferences::setHixie76WebSocketProtocolEnabled(
     947    /* [in] */ BOOL enabled)
     948{
     949    setBoolValue(CFSTR(WebKitHixie76WebSocketProtocolEnabledPreferenceKey), enabled);
     950    return S_OK;
     951}
     952
     953HRESULT STDMETHODCALLTYPE WebPreferences::hixie76WebSocketProtocolEnabled(
     954    /* [retval][out] */ BOOL* enabled)
     955{
     956    *enabled = boolValueForKey(CFSTR(WebKitHixie76WebSocketProtocolEnabledPreferenceKey));
    942957    return S_OK;
    943958}
  • trunk/Source/WebKit/win/WebPreferences.h

    r85389 r89669  
    436436    virtual HRESULT STDMETHODCALLTYPE isFullScreenEnabled(BOOL*);
    437437
     438    virtual HRESULT STDMETHODCALLTYPE hixie76WebSocketProtocolEnabled(BOOL*);
     439    virtual HRESULT STDMETHODCALLTYPE setHixie76WebSocketProtocolEnabled(BOOL);
     440
    438441    // WebPreferences
    439442
  • trunk/Source/WebKit/win/WebView.cpp

    r89386 r89669  
    48504850    settings->setLoadsSiteIconsIgnoringImageLoadingSetting(!!enabled);
    48514851
     4852#if ENABLE(WEB_SOCKETS)
     4853    hr = prefsPrivate->hixie76WebSocketProtocolEnabled(&enabled);
     4854    if (FAILED(hr))
     4855        return hr;
     4856    settings->setUseHixie76WebSocketProtocol(enabled);
     4857#endif
     4858
    48524859    if (!m_closeWindowTimer)
    48534860        m_mainFrame->invalidate(); // FIXME
Note: See TracChangeset for help on using the changeset viewer.