Changeset 161796 in webkit


Ignore:
Timestamp:
Jan 11, 2014 8:20:13 PM (10 years ago)
Author:
ap@apple.com
Message:

[Mac] [Windows] Stop scheduling network requests in WebCore
https://bugs.webkit.org/show_bug.cgi?id=126789
<rdar://problem/15114727>

Source/WebCore:

Reviewed by Sam Weinig.

We'll just send all requests to CFNetwork now, along with associated priorities.

  • WebCore.exp.in: WebKitSystemInterface functions are changing to support priorities

for more than just pipelining.

  • loader/ResourceLoadScheduler.cpp:

(WebCore::ResourceLoadScheduler::scheduleLoad):

  • platform/ios/WebCoreSystemInterfaceIOS.mm:
  • platform/mac/WebCoreSystemInterface.h:
  • platform/mac/WebCoreSystemInterface.mm:
  • platform/network/ResourceHandle.h: For syncronous requests, make it so that they

don't count against HTTP connection limit, to avoid the possibility of hanging the process.

  • platform/network/cf/ResourceHandleCFNet.cpp:

(WebCore::ResourceHandle::createCFURLConnection):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):

  • platform/network/cf/ResourceRequestCFNet.cpp:

(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::initializeMaximumHTTPConnectionCountPerHost):
(WebCore::initializeHTTPConnectionSettingsOnStartup):

  • platform/network/cf/ResourceRequestCFNet.h:

(WebCore::toPlatformRequestPriority):

  • platform/network/mac/ResourceHandleMac.mm:

(WebCore::ResourceHandle::createNSURLConnection):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):

  • platform/network/mac/ResourceRequestMac.mm:

(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::ResourceRequest::doUpdatePlatformRequest):

Source/WebKit/mac:

Reviewed by Sam Weinig.

  • WebCoreSupport/WebSystemInterface.mm: (InitWebCoreSystemInterface): Updated

for new WKSI function names.

Source/WebKit2:

Reviewed by Sam Weinig.

  • NetworkProcess/mac/NetworkResourceLoadSchedulerMac.mm:

(WebKit::NetworkResourceLoadScheduler::platformInitializeMaximumHTTPConnectionCountPerHost):
We no longer need the trick with 7 connections, as synchronous requests always have
the right of way.

  • UIProcess/API/C/WKContext.cpp: Removed long obsolete functions.
  • WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface):

Updated for new WKSI function names.

WebKitLibraries:

Update WKSI.

  • WebKitSystemInterface.h:
  • libWebKitSystemInterfaceLion.a:
  • libWebKitSystemInterfaceMavericks.a:
  • libWebKitSystemInterfaceMountainLion.a:
Location:
trunk
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r161795 r161796  
     12014-01-11  Alexey Proskuryakov  <ap@apple.com>
     2
     3        [Mac] [Windows] Stop scheduling network requests in WebCore
     4        https://bugs.webkit.org/show_bug.cgi?id=126789
     5        <rdar://problem/15114727>
     6
     7        Reviewed by Sam Weinig.
     8
     9        We'll just send all requests to CFNetwork now, along with associated priorities.
     10
     11        * WebCore.exp.in: WebKitSystemInterface functions are changing to support priorities
     12        for more than just pipelining.
     13        * loader/ResourceLoadScheduler.cpp:
     14        (WebCore::ResourceLoadScheduler::scheduleLoad):
     15        * platform/ios/WebCoreSystemInterfaceIOS.mm:
     16        * platform/mac/WebCoreSystemInterface.h:
     17        * platform/mac/WebCoreSystemInterface.mm:
     18        * platform/network/ResourceHandle.h: For syncronous requests, make it so that they
     19        don't count against HTTP connection limit, to avoid the possibility of hanging the process.
     20        * platform/network/cf/ResourceHandleCFNet.cpp:
     21        (WebCore::ResourceHandle::createCFURLConnection):
     22        (WebCore::ResourceHandle::start):
     23        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
     24        * platform/network/cf/ResourceRequestCFNet.cpp:
     25        (WebCore::ResourceRequest::doUpdatePlatformRequest):
     26        (WebCore::ResourceRequest::doUpdateResourceRequest):
     27        (WebCore::initializeMaximumHTTPConnectionCountPerHost):
     28        (WebCore::initializeHTTPConnectionSettingsOnStartup):
     29        * platform/network/cf/ResourceRequestCFNet.h:
     30        (WebCore::toPlatformRequestPriority):
     31        * platform/network/mac/ResourceHandleMac.mm:
     32        (WebCore::ResourceHandle::createNSURLConnection):
     33        (WebCore::ResourceHandle::start):
     34        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
     35        * platform/network/mac/ResourceRequestMac.mm:
     36        (WebCore::ResourceRequest::doUpdateResourceRequest):
     37        (WebCore::ResourceRequest::doUpdatePlatformRequest):
     38
    1392014-01-11  David Kilzer  <ddkilzer@apple.com>
    240
  • trunk/Source/WebCore/WebCore.exp.in

    r161779 r161796  
    18941894_wkGetCFURLResponseURL
    18951895_wkGetHTTPCookieAcceptPolicy
    1896 _wkGetHTTPPipeliningPriority
     1896_wkGetHTTPRequestPriority
    18971897_wkGetMIMETypeForExtension
    18981898_wkGetNSURLResponseLastModifiedDate
     
    19001900_wkHTTPCookies
    19011901_wkHTTPCookiesForURL
     1902_wkHTTPRequestEnablePipelining
    19021903_wkInitializeMaximumHTTPConnectionCountPerHost
    19031904_wkSetBaseCTM
     
    19071908_wkSetHTTPCookieAcceptPolicy
    19081909_wkSetHTTPCookiesForURL
    1909 _wkSetHTTPPipeliningMaximumPriority
    1910 _wkSetHTTPPipeliningMinimumFastLanePriority
    1911 _wkSetHTTPPipeliningPriority
     1910_wkSetHTTPRequestMaximumPriority
     1911_wkSetHTTPRequestMinimumFastLanePriority
     1912_wkSetHTTPRequestPriority
    19121913_wkSetNSURLConnectionDefersCallbacks
    19131914_wkSetNSURLRequestShouldContentSniff
  • trunk/Source/WebCore/loader/ResourceLoadScheduler.cpp

    r161768 r161796  
    163163    host->schedule(resourceLoader, priority);
    164164
    165 #if PLATFORM(IOS)
    166     if (ResourceRequest::httpPipeliningEnabled() && !isSuspendingPendingRequests()) {
     165#if PLATFORM(MAC) || USE(CFNETWORK)
     166    if (!isSuspendingPendingRequests()) {
    167167        // Serve all requests at once to keep the pipeline full at the network layer.
     168        // FIXME: Does this code do anything useful, given that we also set maxRequestsInFlightPerHost to effectively unlimited on these platforms?
    168169        servePendingRequests(host, ResourceLoadPriorityVeryLow);
    169170        return;
  • trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.mm

    r161589 r161796  
    5959unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned preferredConnectionCount);
    6060int (*wkGetHTTPPipeliningPriority)(CFURLRequestRef);
    61 void (*wkSetHTTPPipeliningMaximumPriority)(int priority);
    62 void (*wkSetHTTPPipeliningPriority)(CFURLRequestRef, int priority);
    63 void (*wkSetHTTPPipeliningMinimumFastLanePriority)(int priority);
     61void (*wkSetHTTPRequestMaximumPriority)(int priority);
     62void (*wkSetHTTPRequestPriority)(CFURLRequestRef, int priority);
     63void (*wkSetHTTPRequestMinimumFastLanePriority)(int priority);
     64void (*wkHTTPRequestEnablePipelining)(CFURLRequestRef);
    6465void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
    6566void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
  • trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h

    r161589 r161796  
    227227extern void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream);
    228228extern unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned preferredConnectionCount);
    229 extern int (*wkGetHTTPPipeliningPriority)(CFURLRequestRef);
    230 extern void (*wkSetHTTPPipeliningMaximumPriority)(int maximumPriority);
    231 extern void (*wkSetHTTPPipeliningPriority)(CFURLRequestRef, int priority);
    232 extern void (*wkSetHTTPPipeliningMinimumFastLanePriority)(int priority);
     229extern int (*wkGetHTTPRequestPriority)(CFURLRequestRef);
     230extern void (*wkSetHTTPRequestMaximumPriority)(int maximumPriority);
     231extern void (*wkSetHTTPRequestPriority)(CFURLRequestRef, int priority);
     232extern void (*wkSetHTTPRequestMinimumFastLanePriority)(int priority);
     233extern void (*wkHTTPRequestEnablePipelining)(CFURLRequestRef);
    233234extern void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
    234235extern void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
  • trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm

    r160877 r161796  
    106106void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
    107107unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned preferredConnectionCount);
    108 int (*wkGetHTTPPipeliningPriority)(CFURLRequestRef);
    109 void (*wkSetHTTPPipeliningMaximumPriority)(int priority);
    110 void (*wkSetHTTPPipeliningPriority)(CFURLRequestRef, int priority);
    111 void (*wkSetHTTPPipeliningMinimumFastLanePriority)(int priority);
     108int (*wkGetHTTPRequestPriority)(CFURLRequestRef);
     109void (*wkSetHTTPRequestMaximumPriority)(int priority);
     110void (*wkSetHTTPRequestPriority)(CFURLRequestRef, int priority);
     111void (*wkSetHTTPRequestMinimumFastLanePriority)(int priority);
     112void (*wkHTTPRequestEnablePipelining)(CFURLRequestRef);
    112113void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
    113114void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
  • trunk/Source/WebCore/platform/network/ResourceHandle.h

    r161768 r161796  
    273273    virtual void derefAuthenticationClient() OVERRIDE { deref(); }
    274274
    275 #if PLATFORM(MAC) && !USE(CFNETWORK)
    276     void createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff);
    277 #elif USE(CFNETWORK)
    278     void createCFURLConnection(bool shouldUseCredentialStorage, bool shouldContentSniff, CFDictionaryRef clientProperties);
     275#if PLATFORM(MAC) || USE(CFNETWORK)
     276    enum class SchedulingBehavior {
     277        Asynchronous,
     278        Synchronous
     279    };
     280
     281#if USE(CFNETWORK)
     282    void createCFURLConnection(bool shouldUseCredentialStorage, bool shouldContentSniff, SchedulingBehavior, CFDictionaryRef clientProperties);
     283#else
     284    void createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff, SchedulingBehavior);
     285#endif
    279286#endif
    280287
  • trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp

    r160836 r161796  
    116116}
    117117
    118 void ResourceHandle::createCFURLConnection(bool shouldUseCredentialStorage, bool shouldContentSniff, CFDictionaryRef clientProperties)
     118void ResourceHandle::createCFURLConnection(bool shouldUseCredentialStorage, bool shouldContentSniff, SchedulingBehavior schedulingBehavior, CFDictionaryRef clientProperties)
    119119{
    120120    if ((!d->m_user.isEmpty() || !d->m_pass.isEmpty()) && !firstRequest().url().protocolIsInHTTPFamily()) {
     
    186186
    187187    CFMutableDictionaryRef streamProperties  = CFDictionaryCreateMutable(0, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
    188     if (!shouldUseCredentialStorage)
     188
     189    if (!shouldUseCredentialStorage) {
     190        // Avoid using existing connections, because they may be already authenticated.
    189191        CFDictionarySetValue(streamProperties, CFSTR("_kCFURLConnectionSessionID"), CFSTR("WebKitPrivateSession"));
     192    }
     193
     194    if (schedulingBehavior == SchedulingBehavior::Synchronous) {
     195        // Synchronous requests should not be subject to regular connection count limit to avoid deadlocks.
     196        // If we are using all available connections for async requests, and make a sync request, then prior
     197        // requests may get stuck waiting for delegate calls while we are in nested run loop, and the sync
     198        // request won't start because there are no available connections.
     199        // Connections are grouped by their socket stream properties, with each group having a separate count.
     200        CFDictionarySetValue(streamProperties, CFSTR("_WebKitSynchronousRequest"), kCFBooleanTrue);
     201    }
    190202
    191203#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090)
     
    201213    else
    202214        propertiesDictionary = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
     215
     216    // FIXME: This code is different from iOS code in ResourceHandleMac.mm in that here we ignore stream properties that were present in client properties.
    203217    CFDictionaryAddValue(propertiesDictionary.get(), kCFURLConnectionSocketStreamProperties, streamProperties);
    204218    CFRelease(streamProperties);
    205 
    206 
    207219
    208220#if PLATFORM(MAC)
     
    235247    bool shouldUseCredentialStorage = !client() || client()->shouldUseCredentialStorage(this);
    236248
    237     createCFURLConnection(shouldUseCredentialStorage, d->m_shouldContentSniff, client()->connectionProperties(this).get());
     249    createCFURLConnection(shouldUseCredentialStorage, d->m_shouldContentSniff, SchedulingBehavior::Asynchronous, client()->connectionProperties(this).get());
    238250
    239251    d->m_connectionDelegate->setupConnectionScheduling(d->m_connection.get());
     
    481493    }
    482494
    483     handle->createCFURLConnection(storedCredentials == AllowStoredCredentials, ResourceHandle::shouldContentSniffURL(request.url()), handle->client()->connectionProperties(handle.get()).get());
     495    handle->createCFURLConnection(storedCredentials == AllowStoredCredentials, ResourceHandle::shouldContentSniffURL(request.url()),
     496        SchedulingBehavior::Synchronous, handle->client()->connectionProperties(handle.get()).get());
    484497
    485498    CFURLConnectionScheduleWithRunLoop(handle->connection(), CFRunLoopGetCurrent(), synchronousLoadRunLoopMode());
  • trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp

    r161589 r161796  
    5454namespace WebCore {
    5555
     56// FIXME: Make this a NetworkingContext property.
    5657#if PLATFORM(IOS)
    5758bool ResourceRequest::s_httpPipeliningEnabled = true;
     
    152153
    153154    if (httpPipeliningEnabled())
    154         wkSetHTTPPipeliningPriority(cfRequest, toHTTPPipeliningPriority(m_priority));
     155        wkHTTPRequestEnablePipelining(cfRequest);
     156
     157    wkSetHTTPRequestPriority(cfRequest, toPlatformRequestPriority(m_priority));
     158
    155159#if !PLATFORM(WIN)
    156160    wkCFURLRequestAllowAllPostCaching(cfRequest);
     
    271275    m_allowCookies = CFURLRequestShouldHandleHTTPCookies(m_cfRequest.get());
    272276
    273     if (httpPipeliningEnabled())
    274         m_priority = toResourceLoadPriority(wkGetHTTPPipeliningPriority(m_cfRequest.get()));
     277    m_priority = toResourceLoadPriority(wkGetHTTPRequestPriority(m_cfRequest.get()));
    275278
    276279    m_httpHeaderFields.clear();
     
    393396{
    394397    static const unsigned preferredConnectionCount = 6;
    395 
    396     // Always set the connection count per host, even when pipelining.
    397     unsigned maximumHTTPConnectionCountPerHost = wkInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount);
    398 
    399398    static const unsigned unlimitedConnectionCount = 10000;
     399
     400    wkInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount);
    400401
    401402    Boolean keyExistsAndHasValidFormat = false;
     
    404405        ResourceRequest::setHTTPPipeliningEnabled(prefValue);
    405406
    406     if (ResourceRequest::httpPipeliningEnabled()) {
    407         wkSetHTTPPipeliningMaximumPriority(toHTTPPipeliningPriority(ResourceLoadPriorityHighest));
     407    wkSetHTTPRequestMaximumPriority(toPlatformRequestPriority(ResourceLoadPriorityHighest));
    408408#if !PLATFORM(WIN)
    409         // FIXME: <rdar://problem/9375609> Implement minimum fast lane priority setting on Windows
    410         wkSetHTTPPipeliningMinimumFastLanePriority(toHTTPPipeliningPriority(ResourceLoadPriorityMedium));
    411 #endif
    412         // When pipelining do not rate-limit requests sent from WebCore since CFNetwork handles that.
    413         return unlimitedConnectionCount;
    414     }
    415 
    416     return maximumHTTPConnectionCountPerHost;
     409    // FIXME: <rdar://problem/9375609> Implement minimum fast lane priority setting on Windows
     410    wkSetHTTPRequestMinimumFastLanePriority(toPlatformRequestPriority(ResourceLoadPriorityMedium));
     411#endif
     412
     413    return unlimitedConnectionCount;
    417414}
    418415   
     
    427424    static const unsigned fastLaneConnectionCount = 1;
    428425    wkInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount);
    429     wkSetHTTPPipeliningMaximumPriority(ResourceLoadPriorityHighest);
    430     wkSetHTTPPipeliningMinimumFastLanePriority(ResourceLoadPriorityMedium);
     426    wkSetHTTPRequestMaximumPriority(ResourceLoadPriorityHighest);
     427    wkSetHTTPRequestMinimumFastLanePriority(ResourceLoadPriorityMedium);
    431428    _CFNetworkHTTPConnectionCacheSetLimit(kHTTPNumFastLanes, fastLaneConnectionCount);
    432429}
  • trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.h

    r132520 r161796  
    6363}
    6464
    65 inline int toHTTPPipeliningPriority(ResourceLoadPriority priority)
     65inline int toPlatformRequestPriority(ResourceLoadPriority priority)
    6666{
    6767    switch (priority) {
  • trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm

    r161589 r161796  
    119119
    120120#if !PLATFORM(IOS)
    121 void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff)
     121void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff, SchedulingBehavior schedulingBehavior)
    122122#else
    123 void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff, NSDictionary *connectionProperties)
     123void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff, SchedulingBehavior schedulingBehavior, NSDictionary *connectionProperties)
    124124#endif
    125125{
     
    163163
    164164#if PLATFORM(IOS)
     165    // FIXME: This code is different from iOS code in ResourceHandleCFNet.cpp in that here we respect stream properties that were present in client properties.
    165166    NSDictionary *streamPropertiesFromClient = [connectionProperties objectForKey:@"kCFURLConnectionSocketStreamProperties"];
    166167    NSMutableDictionary *streamProperties = streamPropertiesFromClient ? [[streamPropertiesFromClient mutableCopy] autorelease] : [NSMutableDictionary dictionary];
     
    169170#endif
    170171
    171     if (!shouldUseCredentialStorage)
     172    if (!shouldUseCredentialStorage) {
     173        // Avoid using existing connections, because they may be already authenticated.
    172174        [streamProperties setObject:@"WebKitPrivateSession" forKey:@"_kCFURLConnectionSessionID"];
     175    }
     176
     177    if (schedulingBehavior == SchedulingBehavior::Synchronous) {
     178        // Synchronous requests should not be subject to regular connection count limit to avoid deadlocks.
     179        // If we are using all available connections for async requests, and make a sync request, then prior
     180        // requests may get stuck waiting for delegate calls while we are in nested run loop, and the sync
     181        // request won't start because there are no available connections.
     182        // Connections are grouped by their socket stream properties, with each group having a separate count.
     183        [streamProperties setObject:@TRUE forKey:@"_WebKitSynchronousRequest"];
     184    }
    173185
    174186#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     
    214226        ResourceHandle::delegate(),
    215227        shouldUseCredentialStorage,
    216         d->m_shouldContentSniff || d->m_context->localFileContentSniffingEnabled());
     228        d->m_shouldContentSniff || d->m_context->localFileContentSniffingEnabled(),
     229        SchedulingBehavior::Asynchronous);
    217230#else
    218231    createNSURLConnection(
     
    220233        shouldUseCredentialStorage,
    221234        d->m_shouldContentSniff || d->m_context->localFileContentSniffingEnabled(),
     235        SchedulingBehavior::Asynchronous,
    222236        (NSDictionary *)client()->connectionProperties(this));
    223237#endif
     
    367381        handle->delegate(),
    368382        storedCredentials == AllowStoredCredentials,
    369         handle->shouldContentSniff() || context->localFileContentSniffingEnabled());
     383        handle->shouldContentSniff() || context->localFileContentSniffingEnabled(),
     384        SchedulingBehavior::Synchronous);
    370385#else
    371386    handle->createNSURLConnection(
     
    374389        shouldRelaxThirdPartyCookiePolicy(context, request.url()),
    375390        handle->shouldContentSniff() || (context && context->localFileContentSniffingEnabled()),
     391        SchedulingBehavior::Synchronous,
    376392        (NSDictionary *)handle->client()->connectionProperties(handle.get()));
    377393#endif
  • trunk/Source/WebCore/platform/network/mac/ResourceRequestMac.mm

    r161589 r161796  
    109109    m_allowCookies = [m_nsRequest.get() HTTPShouldHandleCookies];
    110110
    111     if (ResourceRequest::httpPipeliningEnabled())
    112         m_priority = toResourceLoadPriority(wkGetHTTPPipeliningPriority([m_nsRequest.get() _CFURLRequest]));
     111    m_priority = toResourceLoadPriority(wkGetHTTPRequestPriority([m_nsRequest.get() _CFURLRequest]));
    113112
    114113    NSDictionary *headers = [m_nsRequest.get() allHTTPHeaderFields];
     
    166165
    167166    if (ResourceRequest::httpPipeliningEnabled())
    168         wkSetHTTPPipeliningPriority([nsRequest _CFURLRequest], toHTTPPipeliningPriority(m_priority));
     167        wkHTTPRequestEnablePipelining([nsRequest _CFURLRequest]);
     168
     169    wkSetHTTPRequestPriority([nsRequest _CFURLRequest], toPlatformRequestPriority(m_priority));
    169170
    170171    [nsRequest setCachePolicy:(NSURLRequestCachePolicy)cachePolicy()];
  • trunk/Source/WebKit/mac/ChangeLog

    r161751 r161796  
     12014-01-11  Alexey Proskuryakov  <ap@apple.com>
     2
     3        [Mac] [Windows] Stop scheduling network requests in WebCore
     4        https://bugs.webkit.org/show_bug.cgi?id=126789
     5        <rdar://problem/15114727>
     6
     7        Reviewed by Sam Weinig.
     8
     9        * WebCoreSupport/WebSystemInterface.mm: (InitWebCoreSystemInterface): Updated
     10        for new WKSI function names.
     11
    1122014-01-10  Anders Carlsson  <andersca@apple.com>
    213
  • trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm

    r161185 r161796  
    7878    INIT(GetGlyphTransformedAdvances);
    7979#endif
    80     INIT(GetHTTPPipeliningPriority);
     80    INIT(GetHTTPRequestPriority);
    8181    INIT(GetMIMETypeForExtension);
    8282    INIT(GetNSURLResponseLastModifiedDate);
     
    106106    INIT(SetDragImage);
    107107#endif
    108     INIT(SetHTTPPipeliningMaximumPriority);
    109     INIT(SetHTTPPipeliningPriority);
    110     INIT(SetHTTPPipeliningMinimumFastLanePriority);
     108    INIT(SetHTTPRequestMaximumPriority);
     109    INIT(SetHTTPRequestPriority);
     110    INIT(SetHTTPRequestMinimumFastLanePriority);
     111    INIT(HTTPRequestEnablePipelining);
    111112    INIT(SetNSURLConnectionDefersCallbacks);
    112113    INIT(SetNSURLRequestShouldContentSniff);
  • trunk/Source/WebKit2/ChangeLog

    r161779 r161796  
     12014-01-11  Alexey Proskuryakov  <ap@apple.com>
     2
     3        [Mac] [Windows] Stop scheduling network requests in WebCore
     4        https://bugs.webkit.org/show_bug.cgi?id=126789
     5        <rdar://problem/15114727>
     6
     7        Reviewed by Sam Weinig.
     8
     9        * NetworkProcess/mac/NetworkResourceLoadSchedulerMac.mm:
     10        (WebKit::NetworkResourceLoadScheduler::platformInitializeMaximumHTTPConnectionCountPerHost):
     11        We no longer need the trick with 7 connections, as synchronous requests always have
     12        the right of way.
     13
     14        * UIProcess/API/C/WKContext.cpp: Removed long obsolete functions.
     15
     16        * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface):
     17        Updated for new WKSI function names.
     18
    1192014-01-11  Simon Fraser  <simon.fraser@apple.com>
    220
  • trunk/Source/WebKit2/NetworkProcess/mac/NetworkResourceLoadSchedulerMac.mm

    r151795 r161796  
    4040void NetworkResourceLoadScheduler::platformInitializeMaximumHTTPConnectionCountPerHost()
    4141{
    42     wkInitializeMaximumHTTPConnectionCountPerHost = WKInitializeMaximumHTTPConnectionCountPerHost;
    43     wkSetHTTPPipeliningMaximumPriority = WKSetHTTPPipeliningMaximumPriority;
    44     wkSetHTTPPipeliningMinimumFastLanePriority = WKSetHTTPPipeliningMinimumFastLanePriority;
    45 
    46     // Our preferred connection-per-host limit is the standard 6, but we need to let CFNetwork handle a 7th
    47     // in case a synchronous XHRs is made while 6 loads are already outstanding.
    48     static const unsigned preferredConnectionCount = 7;
     42    static const unsigned preferredConnectionCount = 6;
    4943    static const unsigned unlimitedConnectionCount = 10000;
    5044
    51     // Always set the connection count per host, even when pipelining.
    52     unsigned maximumHTTPConnectionCountPerHost = wkInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount);
     45    WKInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount);
    5346
    5447    Boolean keyExistsAndHasValidFormat = false;
    5548    Boolean prefValue = CFPreferencesGetAppBooleanValue(CFSTR("WebKitEnableHTTPPipelining"), kCFPreferencesCurrentApplication, &keyExistsAndHasValidFormat);
    56    
    5749    if (keyExistsAndHasValidFormat)
    5850        ResourceRequest::setHTTPPipeliningEnabled(prefValue);
    5951
    60     if (ResourceRequest::httpPipeliningEnabled()) {
    61         wkSetHTTPPipeliningMaximumPriority(toHTTPPipeliningPriority(ResourceLoadPriorityHighest));
    62         wkSetHTTPPipeliningMinimumFastLanePriority(toHTTPPipeliningPriority(ResourceLoadPriorityMedium));
     52    WKSetHTTPRequestMaximumPriority(toPlatformRequestPriority(ResourceLoadPriorityHighest));
     53    WKSetHTTPRequestMinimumFastLanePriority(toPlatformRequestPriority(ResourceLoadPriorityMedium));
    6354
    64         // When pipelining do not rate-limit requests sent from WebCore since CFNetwork handles that.
    65         m_maxRequestsInFlightPerHost = unlimitedConnectionCount;
    66 
    67         return;
    68     }
    69 
    70     // We've asked for one more connection per host than we intend to use in most cases so synch XHRs can bypass that limit.
    71     m_maxRequestsInFlightPerHost = maximumHTTPConnectionCountPerHost - 1;
     55    m_maxRequestsInFlightPerHost = unlimitedConnectionCount;
    7256}
    7357
  • trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp

    r160940 r161796  
    5656using namespace WebKit;
    5757
    58 extern "C" {
    59 // For binary compatibility with Safari 5.1. Should be removed eventually.
    60 WK_EXPORT void _WKContextSetAdditionalPluginsDirectory(WKContextRef context, WKStringRef pluginsDirectory);
    61 WK_EXPORT void _WKContextRegisterURLSchemeAsEmptyDocument(WKContextRef context, WKStringRef urlScheme);
    62 WK_EXPORT void _WKContextSetAlwaysUsesComplexTextCodePath(WKContextRef context, bool alwaysUseComplexTextCodePath);
    63 WK_EXPORT void _WKContextSetHTTPPipeliningEnabled(WKContextRef context, bool enabled);
    64 }
    65 
    6658WKTypeID WKContextGetTypeID()
    6759{
     
    410402    WebContext::setInvalidMessageCallback(invalidMessageFunction);
    411403}
    412 
    413 // Deprecated functions.
    414 void _WKContextSetAdditionalPluginsDirectory(WKContextRef context, WKStringRef pluginsDirectory)
    415 {
    416     WKContextSetAdditionalPluginsDirectory(context, pluginsDirectory);
    417 }
    418 
    419 void _WKContextRegisterURLSchemeAsEmptyDocument(WKContextRef context, WKStringRef urlScheme)
    420 {
    421     WKContextRegisterURLSchemeAsEmptyDocument(context, urlScheme);
    422 }
    423 
    424 void _WKContextSetAlwaysUsesComplexTextCodePath(WKContextRef context, bool alwaysUseComplexTextCodePath)
    425 {
    426     WKContextSetAlwaysUsesComplexTextCodePath(context, alwaysUseComplexTextCodePath);
    427 }
    428 
    429 void _WKContextSetHTTPPipeliningEnabled(WKContextRef context, bool enabled)
    430 {
    431     WKContextSetHTTPPipeliningEnabled(context, enabled);
    432 }
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm

    r160877 r161796  
    7171#endif
    7272        INIT(GetVerticalGlyphsForCharacters);
    73         INIT(GetHTTPPipeliningPriority);
     73        INIT(GetHTTPRequestPriority);
    7474        INIT(GetMIMETypeForExtension);
    7575        INIT(GetNSURLResponseLastModifiedDate);
     
    8686#endif
    8787        INIT(InitializeMaximumHTTPConnectionCountPerHost);
     88        INIT(HTTPRequestEnablePipelining);
    8889#if !PLATFORM(IOS)
    8990        INIT(MeasureMediaUIPart);
     
    112113        INIT(SetDragImage);
    113114#endif
    114         INIT(SetHTTPPipeliningMaximumPriority);
    115         INIT(SetHTTPPipeliningPriority);
    116         INIT(SetHTTPPipeliningMinimumFastLanePriority);
     115        INIT(SetHTTPRequestMaximumPriority);
     116        INIT(SetHTTPRequestPriority);
     117        INIT(SetHTTPRequestMinimumFastLanePriority);
    117118        INIT(SetNSURLConnectionDefersCallbacks);
    118119        INIT(SetNSURLRequestShouldContentSniff);
  • trunk/WebKitLibraries/ChangeLog

    r161640 r161796  
     12014-01-11  Alexey Proskuryakov  <ap@apple.com>
     2
     3        [Mac] [Windows] Stop scheduling network requests in WebCore
     4        https://bugs.webkit.org/show_bug.cgi?id=126789
     5        <rdar://problem/15114727>
     6
     7        Update WKSI.
     8
     9        * WebKitSystemInterface.h:
     10        * libWebKitSystemInterfaceLion.a:
     11        * libWebKitSystemInterfaceMavericks.a:
     12        * libWebKitSystemInterfaceMountainLion.a:
     13
    1142014-01-10  peavo@outlook.com  <peavo@outlook.com>
    215
  • trunk/WebKitLibraries/WebKitSystemInterface.h

    r154528 r161796  
    66*/
    77
    8 #import <Cocoa/Cocoa.h>
     8#import <Foundation/Foundation.h>
     9#import <dispatch/dispatch.h>
     10
     11#if !TARGET_OS_IPHONE
     12#import <AppKit/AppKit.h>
    913#import <Carbon/Carbon.h>
    10 #import <dispatch/dispatch.h>
     14#else
     15#import <CoreImage/CoreImage.h>
     16#import <CoreText/CoreText.h>
     17#if !TARGET_IPHONE_SIMULATOR
     18#import <IOSurface/IOSurface.h>
     19#endif
     20#import <WebKitSystemInterfaceIOS.h>
     21#endif
    1122
    1223@class AVAsset;
     
    5162void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
    5263
     64#if !TARGET_OS_IPHONE
    5365void WKShowKeyAndMain(void);
    5466#ifndef __LP64__
     
    6173
    6274void WKDisableCGDeferredUpdates(void);
     75#endif
    6376
    6477Class WKNSURLProtocolClassForRequest(NSURLRequest *request);
    6578void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
    6679
     80#if !TARGET_OS_IPHONE
    6781#ifndef __LP64__
    6882unsigned WKGetNSAutoreleasePoolCount(void);
     
    89103NSArray *WKSpeechSynthesisGetVoiceIdentifiers(void);
    90104NSString *WKSpeechSynthesisGetDefaultVoiceIdentifierForLocale(NSLocale*);
     105#endif
    91106   
    92107BOOL WKShouldBlockPlugin(NSString *bundleIdentifier, NSString *bundleVersionString);
     
    118133    void *context);
    119134
     135#if !TARGET_OS_IPHONE
    120136void WKDrawCapsLockIndicator(CGContextRef, CGRect);
    121137
     
    143159NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
    144160void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font, BOOL shouldSubpixelQuantize);
     161#endif
     162
    145163BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
    146164
     
    170188CGSize WKCTRunGetInitialAdvance(CTRunRef);
    171189
     190#if !TARGET_IPHONE_SIMULATOR
    172191CGContextRef WKIOSurfaceContextCreate(IOSurfaceRef, unsigned width, unsigned height, CGColorSpaceRef);
    173192CGImageRef WKIOSurfaceContextCreateImage(CGContextRef context);
     193#endif
    174194
    175195typedef enum {
     
    186206#endif
    187207
     208#if !TARGET_OS_IPHONE
    188209#ifndef __LP64__
    189210NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
     
    207228
    208229OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef inContext, int inArrowStyle);
     230#endif
    209231
    210232
     
    212234bool WKCGContextIsPDFContext(CGContextRef context);
    213235
     236#if !TARGET_OS_IPHONE
    214237void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
    215238
     
    238261void WKQTMovieDisableComponent(uint32_t[5]);
    239262NSURL *WKQTMovieResolvedURL(QTMovie* movie);
     263#endif
    240264
    241265CFStringRef WKCopyFoundationCacheDirectory(void);
     
    263287void WKCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bodyParts);
    264288
     289#if !TARGET_OS_IPHONE
    265290void WKSetVisibleApplicationName(CFStringRef);
    266291void WKSetApplicationInformationItem(CFStringRef key, CFTypeRef value);
     292#endif
    267293
    268294CFURLRef WKCopyBundleURLForExecutableURL(CFURLRef);
    269295
     296#if !TARGET_OS_IPHONE
    270297typedef enum {
    271298    WKMediaUIPartFullscreenButton   = 0,
     
    329356   
    330357mach_port_t WKInitializeRenderServer(void);
    331    
     358#endif
     359
    332360@class CALayer;
    333361
    334362CALayer *WKMakeRenderLayer(uint32_t contextID);
    335363   
     364#if !TARGET_OS_IPHONE
    336365typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
    337366
     
    339368void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
    340369void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
     370#endif
    341371
    342372typedef struct __WKCAContextRef *WKCAContextRef;
    343373
    344374WKCAContextRef WKCAContextMakeRemoteWithServerPort(mach_port_t port);
     375#if !TARGET_OS_IPHONE
    345376WKCAContextRef WKCAContextMakeRemoteForWindowServer(void);
     377#endif
    346378void WKCAContextInvalidate(WKCAContextRef);
    347379uint32_t WKCAContextGetContextId(WKCAContextRef);
     
    359391void WKCARendererRemoveChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
    360392
     393#if !TARGET_OS_IPHONE
    361394typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef;
    362395
     
    370403#import <mach/mig.h>
    371404CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
    372 #endif // defined(__x86_64__)
     405#endif
    373406
    374407NSUInteger WKGetInputPanelWindowStyle(void);
    375408UInt8 WKGetNSEventKeyChar(NSEvent *);
     409#endif
    376410
    377411@class CAPropertyAnimation;
     
    379413
    380414unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
    381 int WKGetHTTPPipeliningPriority(CFURLRequestRef);
    382 void WKSetHTTPPipeliningMaximumPriority(int maximumPriority);
    383 void WKSetHTTPPipeliningPriority(CFURLRequestRef, int priority);
    384 void WKSetHTTPPipeliningMinimumFastLanePriority(int priority);
     415int WKGetHTTPRequestPriority(CFURLRequestRef);
     416void WKSetHTTPRequestMaximumPriority(int maximumPriority);
     417void WKSetHTTPRequestPriority(CFURLRequestRef, int priority);
     418void WKSetHTTPRequestMinimumFastLanePriority(int priority);
     419void WKHTTPRequestEnablePipelining(CFURLRequestRef);
    385420
    386421void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
     
    388423CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL, CFStringRef proxyHost, CFNumberRef proxyPort);
    389424
     425#if !TARGET_OS_IPHONE
    390426void WKWindowSetAlpha(NSWindow *window, float alphaValue);
    391427void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
     
    394430
    395431void WKEnableSettingCursorWhenInBackground(void);
     432#endif
    396433
    397434CFDictionaryRef WKNSURLRequestCreateSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull);
     
    401438NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
    402439
    403 #ifndef __LP64__
     440#if !TARGET_OS_IPHONE && !defined(__LP64__)
    404441ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
    405442#endif
     
    416453CIFormat WKCIGetRGBA8Format(void);
    417454
     455#if !TARGET_OS_IPHONE
    418456typedef enum {
    419457    WKSandboxExtensionTypeReadOnly,
     
    440478void WKShowWordDefinitionWindow(NSAttributedString *term, NSPoint screenPoint, NSDictionary *options);
    441479void WKHideWordDefinitionWindow(void);
    442 
     480#endif
     481
     482#if !TARGET_OS_IPHONE
    443483CFStringRef WKCopyDefaultSearchProviderDisplayName(void);
     484#endif
    444485
    445486void WKSetCrashReportApplicationSpecificInformation(CFStringRef);
     
    447488NSURL* WKAVAssetResolvedURL(AVAsset*);
    448489
     490#if !TARGET_OS_IPHONE
    449491NSCursor *WKCursor(const char *name);
     492#endif
    450493
    451494dispatch_source_t WKCreateVMPressureDispatchOnMainQueue(void);
     
    467510
    468511#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
    469 @class WebFilterEvaluator;
    470 
    471 BOOL WKFilterIsManagedSession(void);
    472 WebFilterEvaluator *WKFilterCreateInstance(NSURLResponse *);
    473 BOOL WKFilterIsBuffering(WebFilterEvaluator *);
    474 BOOL WKFilterWasBlocked(WebFilterEvaluator *);
    475 NSData *WKFilterAddData(WebFilterEvaluator *, NSData *);
    476 NSData *WKFilterDataComplete(WebFilterEvaluator *);
    477 
    478512CGFloat WKNSElasticDeltaForTimeDelta(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
    479513CGFloat WKNSElasticDeltaForReboundDelta(CGFloat delta);
Note: See TracChangeset for help on using the changeset viewer.