Changeset 85684 in webkit


Ignore:
Timestamp:
May 3, 2011 4:25:15 PM (13 years ago)
Author:
ddkilzer@apple.com
Message:

<http://webkit.org/b/59838> Implement HTTP pipelining for CoreFoundation-based networking

Reviewed by Antti Koivisto.

Source/WebCore:

  • platform/network/cf/ResourceRequestCFNet.cpp:

(WebCore::ResourceRequest::doUpdatePlatformRequest): Set the
priority on the request if HTTP pipelining is enabled.
(WebCore::ResourceRequest::doUpdateResourceRequest): Read the
priority from the request if HTTP pipelining is enabled.
(readBooleanPreference): Enable code when compiling with
USE(CFNETWORK).
(WebCore::initializeMaximumHTTPConnectionCountPerHost): Ditto.
Comment out setting the minimum fast lane priority on Windows
since it's not currently available.

Source/WebKit/win:

  • Interfaces/IWebViewPrivate.idl:

(IWebViewPrivate::httpPipeliningEnabled): Added declaration.
(IWebViewPrivate::setHTTPPipeliningEnabled): Added declaration.

  • WebView.cpp:

(WebView::httpPipeliningEnabled): Added.
(WebView::setHTTPPipeliningEnabled): Added.

  • WebView.h:

(WebView::httpPipeliningEnabled): Added declaration.
(WebView::setHTTPPipeliningEnabled): Added declaration.

Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r85681 r85684  
     12011-05-03  David Kilzer  <ddkilzer@apple.com>
     2
     3        <http://webkit.org/b/59838> Implement HTTP pipelining for CoreFoundation-based networking
     4
     5        Reviewed by Antti Koivisto.
     6
     7        * platform/network/cf/ResourceRequestCFNet.cpp:
     8        (WebCore::ResourceRequest::doUpdatePlatformRequest): Set the
     9        priority on the request if HTTP pipelining is enabled.
     10        (WebCore::ResourceRequest::doUpdateResourceRequest): Read the
     11        priority from the request if HTTP pipelining is enabled.
     12        (readBooleanPreference): Enable code when compiling with
     13        USE(CFNETWORK).
     14        (WebCore::initializeMaximumHTTPConnectionCountPerHost): Ditto.
     15        Comment out setting the minimum fast lane priority on Windows
     16        since it's not currently available.
     17
    1182011-05-03  Simon Fraser  <simon.fraser@apple.com>
    219
  • trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp

    r85036 r85684  
    131131    CFURLRequestSetHTTPRequestMethod(cfRequest, requestMethod.get());
    132132
     133    if (httpPipeliningEnabled())
     134        wkSetHTTPPipeliningPriority(cfRequest, toHTTPPipeliningPriority(m_priority));
     135
    133136    setHeaderFields(cfRequest, httpHeaderFields());
    134137    WebCore::setHTTPBody(cfRequest, httpBody());
     
    173176    }
    174177    m_allowCookies = CFURLRequestShouldHandleHTTPCookies(m_cfRequest.get());
     178
     179    if (httpPipeliningEnabled())
     180        m_priority = toResourceLoadPriority(wkGetHTTPPipeliningPriority(m_cfRequest.get()));
    175181
    176182    m_httpHeaderFields.clear();
     
    222228}
    223229
    224 #if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     230#if USE(CFNETWORK) || PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
    225231static inline bool readBooleanPreference(CFStringRef key)
    226232{
     
    238244    unsigned maximumHTTPConnectionCountPerHost = wkInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount);
    239245
    240 #if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     246#if USE(CFNETWORK) || PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
    241247    static const unsigned unlimitedConnectionCount = 10000;
    242248
     
    246252    if (ResourceRequest::httpPipeliningEnabled()) {
    247253        wkSetHTTPPipeliningMaximumPriority(ResourceLoadPriorityHighest);
     254#if !PLATFORM(WIN)
     255        // FIXME: <rdar://problem/9375609> Implement minimum fast lane priority setting on Windows
    248256        wkSetHTTPPipeliningMinimumFastLanePriority(ResourceLoadPriorityMedium);
     257#endif
    249258        // When pipelining do not rate-limit requests sent from WebCore since CFNetwork handles that.
    250259        return unlimitedConnectionCount;
  • trunk/Source/WebKit/win/ChangeLog

    r85656 r85684  
     12011-05-03  David Kilzer  <ddkilzer@apple.com>
     2
     3        <http://webkit.org/b/59838> Implement HTTP pipelining for CoreFoundation-based networking
     4
     5        Reviewed by Antti Koivisto.
     6
     7        * Interfaces/IWebViewPrivate.idl:
     8        (IWebViewPrivate::httpPipeliningEnabled): Added declaration.
     9        (IWebViewPrivate::setHTTPPipeliningEnabled): Added declaration.
     10        * WebView.cpp:
     11        (WebView::httpPipeliningEnabled): Added.
     12        (WebView::setHTTPPipeliningEnabled): Added.
     13        * WebView.h:
     14        (WebView::httpPipeliningEnabled): Added declaration.
     15        (WebView::setHTTPPipeliningEnabled): Added declaration.
     16
    1172011-05-03  Adam Roben  <aroben@apple.com>
    218
  • trunk/Source/WebKit/win/Interfaces/IWebViewPrivate.idl

    r84990 r85684  
    260260    */
    261261    HRESULT setMinimumTimerInterval([in] double interval);
     262
     263    /*!
     264        @method _HTTPPipeliningEnabled
     265        @abstract Checks the HTTP pipelining status.
     266        @discussion Defaults to NO.
     267        @result YES if HTTP pipelining is enabled, NO if not enabled.
     268     */
     269    HRESULT httpPipeliningEnabled([out, retval] BOOL* enabled);
     270
     271    /*!
     272        @method _setHTTPPipeliningEnabled:
     273        @abstract Set the HTTP pipelining status.
     274        @discussion Defaults to NO.
     275        @param enabled The new HTTP pipelining status.
     276     */
     277    HRESULT setHTTPPipeliningEnabled([in] BOOL enabled);
    262278}
  • trunk/Source/WebKit/win/WebView.cpp

    r85653 r85684  
    122122#include <WebCore/ResourceHandle.h>
    123123#include <WebCore/ResourceHandleClient.h>
     124#include <WebCore/ResourceRequest.h>
    124125#include <WebCore/SchemeRegistry.h>
    125126#include <WebCore/ScriptValue.h>
     
    67386739}
    67396740
     6741HRESULT WebView::httpPipeliningEnabled(BOOL* enabled)
     6742{
     6743    if (!enabled)
     6744        return E_POINTER;
     6745    *enabled = ResourceRequest::httpPipeliningEnabled();
     6746    return S_OK;
     6747}
     6748
     6749HRESULT WebView::setHTTPPipeliningEnabled(BOOL enabled)
     6750{
     6751    ResourceRequest::setHTTPPipeliningEnabled(enabled);
     6752    return S_OK;
     6753}
     6754
    67406755void WebView::setGlobalHistoryItem(HistoryItem* historyItem)
    67416756{
  • trunk/Source/WebKit/win/WebView.h

    r85393 r85684  
    830830    virtual HRESULT STDMETHODCALLTYPE setMinimumTimerInterval(
    831831        /* [in] */ double);
     832
     833    virtual HRESULT STDMETHODCALLTYPE httpPipeliningEnabled(
     834        /* [out, retval] */ BOOL* enabled);
     835
     836    virtual HRESULT STDMETHODCALLTYPE setHTTPPipeliningEnabled(
     837        /* [in] */ BOOL);
    832838
    833839    virtual HRESULT STDMETHODCALLTYPE setUsesLayeredWindow(BOOL);
Note: See TracChangeset for help on using the changeset viewer.