Changeset 161796 in webkit
- Timestamp:
- Jan 11, 2014 8:20:13 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r161795 r161796 1 2014-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 1 39 2014-01-11 David Kilzer <ddkilzer@apple.com> 2 40 -
trunk/Source/WebCore/WebCore.exp.in
r161779 r161796 1894 1894 _wkGetCFURLResponseURL 1895 1895 _wkGetHTTPCookieAcceptPolicy 1896 _wkGetHTTP PipeliningPriority1896 _wkGetHTTPRequestPriority 1897 1897 _wkGetMIMETypeForExtension 1898 1898 _wkGetNSURLResponseLastModifiedDate … … 1900 1900 _wkHTTPCookies 1901 1901 _wkHTTPCookiesForURL 1902 _wkHTTPRequestEnablePipelining 1902 1903 _wkInitializeMaximumHTTPConnectionCountPerHost 1903 1904 _wkSetBaseCTM … … 1907 1908 _wkSetHTTPCookieAcceptPolicy 1908 1909 _wkSetHTTPCookiesForURL 1909 _wkSetHTTP PipeliningMaximumPriority1910 _wkSetHTTP PipeliningMinimumFastLanePriority1911 _wkSetHTTP PipeliningPriority1910 _wkSetHTTPRequestMaximumPriority 1911 _wkSetHTTPRequestMinimumFastLanePriority 1912 _wkSetHTTPRequestPriority 1912 1913 _wkSetNSURLConnectionDefersCallbacks 1913 1914 _wkSetNSURLRequestShouldContentSniff -
trunk/Source/WebCore/loader/ResourceLoadScheduler.cpp
r161768 r161796 163 163 host->schedule(resourceLoader, priority); 164 164 165 #if PLATFORM( IOS)166 if ( ResourceRequest::httpPipeliningEnabled() &&!isSuspendingPendingRequests()) {165 #if PLATFORM(MAC) || USE(CFNETWORK) 166 if (!isSuspendingPendingRequests()) { 167 167 // 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? 168 169 servePendingRequests(host, ResourceLoadPriorityVeryLow); 169 170 return; -
trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.mm
r161589 r161796 59 59 unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned preferredConnectionCount); 60 60 int (*wkGetHTTPPipeliningPriority)(CFURLRequestRef); 61 void (*wkSetHTTPPipeliningMaximumPriority)(int priority); 62 void (*wkSetHTTPPipeliningPriority)(CFURLRequestRef, int priority); 63 void (*wkSetHTTPPipeliningMinimumFastLanePriority)(int priority); 61 void (*wkSetHTTPRequestMaximumPriority)(int priority); 62 void (*wkSetHTTPRequestPriority)(CFURLRequestRef, int priority); 63 void (*wkSetHTTPRequestMinimumFastLanePriority)(int priority); 64 void (*wkHTTPRequestEnablePipelining)(CFURLRequestRef); 64 65 void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort); 65 66 void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString); -
trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h
r161589 r161796 227 227 extern void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream); 228 228 extern 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); 229 extern int (*wkGetHTTPRequestPriority)(CFURLRequestRef); 230 extern void (*wkSetHTTPRequestMaximumPriority)(int maximumPriority); 231 extern void (*wkSetHTTPRequestPriority)(CFURLRequestRef, int priority); 232 extern void (*wkSetHTTPRequestMinimumFastLanePriority)(int priority); 233 extern void (*wkHTTPRequestEnablePipelining)(CFURLRequestRef); 233 234 extern void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort); 234 235 extern void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString); -
trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm
r160877 r161796 106 106 void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL); 107 107 unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned preferredConnectionCount); 108 int (*wkGetHTTPPipeliningPriority)(CFURLRequestRef); 109 void (*wkSetHTTPPipeliningMaximumPriority)(int priority); 110 void (*wkSetHTTPPipeliningPriority)(CFURLRequestRef, int priority); 111 void (*wkSetHTTPPipeliningMinimumFastLanePriority)(int priority); 108 int (*wkGetHTTPRequestPriority)(CFURLRequestRef); 109 void (*wkSetHTTPRequestMaximumPriority)(int priority); 110 void (*wkSetHTTPRequestPriority)(CFURLRequestRef, int priority); 111 void (*wkSetHTTPRequestMinimumFastLanePriority)(int priority); 112 void (*wkHTTPRequestEnablePipelining)(CFURLRequestRef); 112 113 void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort); 113 114 void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString); -
trunk/Source/WebCore/platform/network/ResourceHandle.h
r161768 r161796 273 273 virtual void derefAuthenticationClient() OVERRIDE { deref(); } 274 274 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 279 286 #endif 280 287 -
trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
r160836 r161796 116 116 } 117 117 118 void ResourceHandle::createCFURLConnection(bool shouldUseCredentialStorage, bool shouldContentSniff, CFDictionaryRef clientProperties)118 void ResourceHandle::createCFURLConnection(bool shouldUseCredentialStorage, bool shouldContentSniff, SchedulingBehavior schedulingBehavior, CFDictionaryRef clientProperties) 119 119 { 120 120 if ((!d->m_user.isEmpty() || !d->m_pass.isEmpty()) && !firstRequest().url().protocolIsInHTTPFamily()) { … … 186 186 187 187 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. 189 191 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 } 190 202 191 203 #if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090) … … 201 213 else 202 214 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. 203 217 CFDictionaryAddValue(propertiesDictionary.get(), kCFURLConnectionSocketStreamProperties, streamProperties); 204 218 CFRelease(streamProperties); 205 206 207 219 208 220 #if PLATFORM(MAC) … … 235 247 bool shouldUseCredentialStorage = !client() || client()->shouldUseCredentialStorage(this); 236 248 237 createCFURLConnection(shouldUseCredentialStorage, d->m_shouldContentSniff, client()->connectionProperties(this).get());249 createCFURLConnection(shouldUseCredentialStorage, d->m_shouldContentSniff, SchedulingBehavior::Asynchronous, client()->connectionProperties(this).get()); 238 250 239 251 d->m_connectionDelegate->setupConnectionScheduling(d->m_connection.get()); … … 481 493 } 482 494 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()); 484 497 485 498 CFURLConnectionScheduleWithRunLoop(handle->connection(), CFRunLoopGetCurrent(), synchronousLoadRunLoopMode()); -
trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp
r161589 r161796 54 54 namespace WebCore { 55 55 56 // FIXME: Make this a NetworkingContext property. 56 57 #if PLATFORM(IOS) 57 58 bool ResourceRequest::s_httpPipeliningEnabled = true; … … 152 153 153 154 if (httpPipeliningEnabled()) 154 wkSetHTTPPipeliningPriority(cfRequest, toHTTPPipeliningPriority(m_priority)); 155 wkHTTPRequestEnablePipelining(cfRequest); 156 157 wkSetHTTPRequestPriority(cfRequest, toPlatformRequestPriority(m_priority)); 158 155 159 #if !PLATFORM(WIN) 156 160 wkCFURLRequestAllowAllPostCaching(cfRequest); … … 271 275 m_allowCookies = CFURLRequestShouldHandleHTTPCookies(m_cfRequest.get()); 272 276 273 if (httpPipeliningEnabled()) 274 m_priority = toResourceLoadPriority(wkGetHTTPPipeliningPriority(m_cfRequest.get())); 277 m_priority = toResourceLoadPriority(wkGetHTTPRequestPriority(m_cfRequest.get())); 275 278 276 279 m_httpHeaderFields.clear(); … … 393 396 { 394 397 static const unsigned preferredConnectionCount = 6; 395 396 // Always set the connection count per host, even when pipelining.397 unsigned maximumHTTPConnectionCountPerHost = wkInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount);398 399 398 static const unsigned unlimitedConnectionCount = 10000; 399 400 wkInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount); 400 401 401 402 Boolean keyExistsAndHasValidFormat = false; … … 404 405 ResourceRequest::setHTTPPipeliningEnabled(prefValue); 405 406 406 if (ResourceRequest::httpPipeliningEnabled()) { 407 wkSetHTTPPipeliningMaximumPriority(toHTTPPipeliningPriority(ResourceLoadPriorityHighest)); 407 wkSetHTTPRequestMaximumPriority(toPlatformRequestPriority(ResourceLoadPriorityHighest)); 408 408 #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; 417 414 } 418 415 … … 427 424 static const unsigned fastLaneConnectionCount = 1; 428 425 wkInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount); 429 wkSetHTTP PipeliningMaximumPriority(ResourceLoadPriorityHighest);430 wkSetHTTP PipeliningMinimumFastLanePriority(ResourceLoadPriorityMedium);426 wkSetHTTPRequestMaximumPriority(ResourceLoadPriorityHighest); 427 wkSetHTTPRequestMinimumFastLanePriority(ResourceLoadPriorityMedium); 431 428 _CFNetworkHTTPConnectionCacheSetLimit(kHTTPNumFastLanes, fastLaneConnectionCount); 432 429 } -
trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.h
r132520 r161796 63 63 } 64 64 65 inline int to HTTPPipeliningPriority(ResourceLoadPriority priority)65 inline int toPlatformRequestPriority(ResourceLoadPriority priority) 66 66 { 67 67 switch (priority) { -
trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm
r161589 r161796 119 119 120 120 #if !PLATFORM(IOS) 121 void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff )121 void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff, SchedulingBehavior schedulingBehavior) 122 122 #else 123 void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff, NSDictionary *connectionProperties)123 void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff, SchedulingBehavior schedulingBehavior, NSDictionary *connectionProperties) 124 124 #endif 125 125 { … … 163 163 164 164 #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. 165 166 NSDictionary *streamPropertiesFromClient = [connectionProperties objectForKey:@"kCFURLConnectionSocketStreamProperties"]; 166 167 NSMutableDictionary *streamProperties = streamPropertiesFromClient ? [[streamPropertiesFromClient mutableCopy] autorelease] : [NSMutableDictionary dictionary]; … … 169 170 #endif 170 171 171 if (!shouldUseCredentialStorage) 172 if (!shouldUseCredentialStorage) { 173 // Avoid using existing connections, because they may be already authenticated. 172 174 [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 } 173 185 174 186 #if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 … … 214 226 ResourceHandle::delegate(), 215 227 shouldUseCredentialStorage, 216 d->m_shouldContentSniff || d->m_context->localFileContentSniffingEnabled()); 228 d->m_shouldContentSniff || d->m_context->localFileContentSniffingEnabled(), 229 SchedulingBehavior::Asynchronous); 217 230 #else 218 231 createNSURLConnection( … … 220 233 shouldUseCredentialStorage, 221 234 d->m_shouldContentSniff || d->m_context->localFileContentSniffingEnabled(), 235 SchedulingBehavior::Asynchronous, 222 236 (NSDictionary *)client()->connectionProperties(this)); 223 237 #endif … … 367 381 handle->delegate(), 368 382 storedCredentials == AllowStoredCredentials, 369 handle->shouldContentSniff() || context->localFileContentSniffingEnabled()); 383 handle->shouldContentSniff() || context->localFileContentSniffingEnabled(), 384 SchedulingBehavior::Synchronous); 370 385 #else 371 386 handle->createNSURLConnection( … … 374 389 shouldRelaxThirdPartyCookiePolicy(context, request.url()), 375 390 handle->shouldContentSniff() || (context && context->localFileContentSniffingEnabled()), 391 SchedulingBehavior::Synchronous, 376 392 (NSDictionary *)handle->client()->connectionProperties(handle.get())); 377 393 #endif -
trunk/Source/WebCore/platform/network/mac/ResourceRequestMac.mm
r161589 r161796 109 109 m_allowCookies = [m_nsRequest.get() HTTPShouldHandleCookies]; 110 110 111 if (ResourceRequest::httpPipeliningEnabled()) 112 m_priority = toResourceLoadPriority(wkGetHTTPPipeliningPriority([m_nsRequest.get() _CFURLRequest])); 111 m_priority = toResourceLoadPriority(wkGetHTTPRequestPriority([m_nsRequest.get() _CFURLRequest])); 113 112 114 113 NSDictionary *headers = [m_nsRequest.get() allHTTPHeaderFields]; … … 166 165 167 166 if (ResourceRequest::httpPipeliningEnabled()) 168 wkSetHTTPPipeliningPriority([nsRequest _CFURLRequest], toHTTPPipeliningPriority(m_priority)); 167 wkHTTPRequestEnablePipelining([nsRequest _CFURLRequest]); 168 169 wkSetHTTPRequestPriority([nsRequest _CFURLRequest], toPlatformRequestPriority(m_priority)); 169 170 170 171 [nsRequest setCachePolicy:(NSURLRequestCachePolicy)cachePolicy()]; -
trunk/Source/WebKit/mac/ChangeLog
r161751 r161796 1 2014-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 1 12 2014-01-10 Anders Carlsson <andersca@apple.com> 2 13 -
trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
r161185 r161796 78 78 INIT(GetGlyphTransformedAdvances); 79 79 #endif 80 INIT(GetHTTP PipeliningPriority);80 INIT(GetHTTPRequestPriority); 81 81 INIT(GetMIMETypeForExtension); 82 82 INIT(GetNSURLResponseLastModifiedDate); … … 106 106 INIT(SetDragImage); 107 107 #endif 108 INIT(SetHTTPPipeliningMaximumPriority); 109 INIT(SetHTTPPipeliningPriority); 110 INIT(SetHTTPPipeliningMinimumFastLanePriority); 108 INIT(SetHTTPRequestMaximumPriority); 109 INIT(SetHTTPRequestPriority); 110 INIT(SetHTTPRequestMinimumFastLanePriority); 111 INIT(HTTPRequestEnablePipelining); 111 112 INIT(SetNSURLConnectionDefersCallbacks); 112 113 INIT(SetNSURLRequestShouldContentSniff); -
trunk/Source/WebKit2/ChangeLog
r161779 r161796 1 2014-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 1 19 2014-01-11 Simon Fraser <simon.fraser@apple.com> 2 20 -
trunk/Source/WebKit2/NetworkProcess/mac/NetworkResourceLoadSchedulerMac.mm
r151795 r161796 40 40 void NetworkResourceLoadScheduler::platformInitializeMaximumHTTPConnectionCountPerHost() 41 41 { 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; 49 43 static const unsigned unlimitedConnectionCount = 10000; 50 44 51 // Always set the connection count per host, even when pipelining. 52 unsigned maximumHTTPConnectionCountPerHost = wkInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount); 45 WKInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount); 53 46 54 47 Boolean keyExistsAndHasValidFormat = false; 55 48 Boolean prefValue = CFPreferencesGetAppBooleanValue(CFSTR("WebKitEnableHTTPPipelining"), kCFPreferencesCurrentApplication, &keyExistsAndHasValidFormat); 56 57 49 if (keyExistsAndHasValidFormat) 58 50 ResourceRequest::setHTTPPipeliningEnabled(prefValue); 59 51 60 if (ResourceRequest::httpPipeliningEnabled()) { 61 wkSetHTTPPipeliningMaximumPriority(toHTTPPipeliningPriority(ResourceLoadPriorityHighest)); 62 wkSetHTTPPipeliningMinimumFastLanePriority(toHTTPPipeliningPriority(ResourceLoadPriorityMedium)); 52 WKSetHTTPRequestMaximumPriority(toPlatformRequestPriority(ResourceLoadPriorityHighest)); 53 WKSetHTTPRequestMinimumFastLanePriority(toPlatformRequestPriority(ResourceLoadPriorityMedium)); 63 54 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; 72 56 } 73 57 -
trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp
r160940 r161796 56 56 using namespace WebKit; 57 57 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 66 58 WKTypeID WKContextGetTypeID() 67 59 { … … 410 402 WebContext::setInvalidMessageCallback(invalidMessageFunction); 411 403 } 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 71 71 #endif 72 72 INIT(GetVerticalGlyphsForCharacters); 73 INIT(GetHTTP PipeliningPriority);73 INIT(GetHTTPRequestPriority); 74 74 INIT(GetMIMETypeForExtension); 75 75 INIT(GetNSURLResponseLastModifiedDate); … … 86 86 #endif 87 87 INIT(InitializeMaximumHTTPConnectionCountPerHost); 88 INIT(HTTPRequestEnablePipelining); 88 89 #if !PLATFORM(IOS) 89 90 INIT(MeasureMediaUIPart); … … 112 113 INIT(SetDragImage); 113 114 #endif 114 INIT(SetHTTP PipeliningMaximumPriority);115 INIT(SetHTTP PipeliningPriority);116 INIT(SetHTTP PipeliningMinimumFastLanePriority);115 INIT(SetHTTPRequestMaximumPriority); 116 INIT(SetHTTPRequestPriority); 117 INIT(SetHTTPRequestMinimumFastLanePriority); 117 118 INIT(SetNSURLConnectionDefersCallbacks); 118 119 INIT(SetNSURLRequestShouldContentSniff); -
trunk/WebKitLibraries/ChangeLog
r161640 r161796 1 2014-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 1 14 2014-01-10 peavo@outlook.com <peavo@outlook.com> 2 15 -
trunk/WebKitLibraries/WebKitSystemInterface.h
r154528 r161796 6 6 */ 7 7 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> 9 13 #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 11 22 12 23 @class AVAsset; … … 51 62 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers); 52 63 64 #if !TARGET_OS_IPHONE 53 65 void WKShowKeyAndMain(void); 54 66 #ifndef __LP64__ … … 61 73 62 74 void WKDisableCGDeferredUpdates(void); 75 #endif 63 76 64 77 Class WKNSURLProtocolClassForRequest(NSURLRequest *request); 65 78 void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff); 66 79 80 #if !TARGET_OS_IPHONE 67 81 #ifndef __LP64__ 68 82 unsigned WKGetNSAutoreleasePoolCount(void); … … 89 103 NSArray *WKSpeechSynthesisGetVoiceIdentifiers(void); 90 104 NSString *WKSpeechSynthesisGetDefaultVoiceIdentifierForLocale(NSLocale*); 105 #endif 91 106 92 107 BOOL WKShouldBlockPlugin(NSString *bundleIdentifier, NSString *bundleVersionString); … … 118 133 void *context); 119 134 135 #if !TARGET_OS_IPHONE 120 136 void WKDrawCapsLockIndicator(CGContextRef, CGRect); 121 137 … … 143 159 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch); 144 160 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font, BOOL shouldSubpixelQuantize); 161 #endif 162 145 163 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext); 146 164 … … 170 188 CGSize WKCTRunGetInitialAdvance(CTRunRef); 171 189 190 #if !TARGET_IPHONE_SIMULATOR 172 191 CGContextRef WKIOSurfaceContextCreate(IOSurfaceRef, unsigned width, unsigned height, CGColorSpaceRef); 173 192 CGImageRef WKIOSurfaceContextCreateImage(CGContextRef context); 193 #endif 174 194 175 195 typedef enum { … … 186 206 #endif 187 207 208 #if !TARGET_OS_IPHONE 188 209 #ifndef __LP64__ 189 210 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef); … … 207 228 208 229 OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef inContext, int inArrowStyle); 230 #endif 209 231 210 232 … … 212 234 bool WKCGContextIsPDFContext(CGContextRef context); 213 235 236 #if !TARGET_OS_IPHONE 214 237 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous); 215 238 … … 238 261 void WKQTMovieDisableComponent(uint32_t[5]); 239 262 NSURL *WKQTMovieResolvedURL(QTMovie* movie); 263 #endif 240 264 241 265 CFStringRef WKCopyFoundationCacheDirectory(void); … … 263 287 void WKCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bodyParts); 264 288 289 #if !TARGET_OS_IPHONE 265 290 void WKSetVisibleApplicationName(CFStringRef); 266 291 void WKSetApplicationInformationItem(CFStringRef key, CFTypeRef value); 292 #endif 267 293 268 294 CFURLRef WKCopyBundleURLForExecutableURL(CFURLRef); 269 295 296 #if !TARGET_OS_IPHONE 270 297 typedef enum { 271 298 WKMediaUIPartFullscreenButton = 0, … … 329 356 330 357 mach_port_t WKInitializeRenderServer(void); 331 358 #endif 359 332 360 @class CALayer; 333 361 334 362 CALayer *WKMakeRenderLayer(uint32_t contextID); 335 363 364 #if !TARGET_OS_IPHONE 336 365 typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef; 337 366 … … 339 368 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef); 340 369 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect); 370 #endif 341 371 342 372 typedef struct __WKCAContextRef *WKCAContextRef; 343 373 344 374 WKCAContextRef WKCAContextMakeRemoteWithServerPort(mach_port_t port); 375 #if !TARGET_OS_IPHONE 345 376 WKCAContextRef WKCAContextMakeRemoteForWindowServer(void); 377 #endif 346 378 void WKCAContextInvalidate(WKCAContextRef); 347 379 uint32_t WKCAContextGetContextId(WKCAContextRef); … … 359 391 void WKCARendererRemoveChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context); 360 392 393 #if !TARGET_OS_IPHONE 361 394 typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef; 362 395 … … 370 403 #import <mach/mig.h> 371 404 CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort); 372 #endif // defined(__x86_64__)405 #endif 373 406 374 407 NSUInteger WKGetInputPanelWindowStyle(void); 375 408 UInt8 WKGetNSEventKeyChar(NSEvent *); 409 #endif 376 410 377 411 @class CAPropertyAnimation; … … 379 413 380 414 unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount); 381 int WKGetHTTPPipeliningPriority(CFURLRequestRef); 382 void WKSetHTTPPipeliningMaximumPriority(int maximumPriority); 383 void WKSetHTTPPipeliningPriority(CFURLRequestRef, int priority); 384 void WKSetHTTPPipeliningMinimumFastLanePriority(int priority); 415 int WKGetHTTPRequestPriority(CFURLRequestRef); 416 void WKSetHTTPRequestMaximumPriority(int maximumPriority); 417 void WKSetHTTPRequestPriority(CFURLRequestRef, int priority); 418 void WKSetHTTPRequestMinimumFastLanePriority(int priority); 419 void WKHTTPRequestEnablePipelining(CFURLRequestRef); 385 420 386 421 void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort); … … 388 423 CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL, CFStringRef proxyHost, CFNumberRef proxyPort); 389 424 425 #if !TARGET_OS_IPHONE 390 426 void WKWindowSetAlpha(NSWindow *window, float alphaValue); 391 427 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame); … … 394 430 395 431 void WKEnableSettingCursorWhenInBackground(void); 432 #endif 396 433 397 434 CFDictionaryRef WKNSURLRequestCreateSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull); … … 401 438 NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull); 402 439 403 #if ndef __LP64__440 #if !TARGET_OS_IPHONE && !defined(__LP64__) 404 441 ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void); 405 442 #endif … … 416 453 CIFormat WKCIGetRGBA8Format(void); 417 454 455 #if !TARGET_OS_IPHONE 418 456 typedef enum { 419 457 WKSandboxExtensionTypeReadOnly, … … 440 478 void WKShowWordDefinitionWindow(NSAttributedString *term, NSPoint screenPoint, NSDictionary *options); 441 479 void WKHideWordDefinitionWindow(void); 442 480 #endif 481 482 #if !TARGET_OS_IPHONE 443 483 CFStringRef WKCopyDefaultSearchProviderDisplayName(void); 484 #endif 444 485 445 486 void WKSetCrashReportApplicationSpecificInformation(CFStringRef); … … 447 488 NSURL* WKAVAssetResolvedURL(AVAsset*); 448 489 490 #if !TARGET_OS_IPHONE 449 491 NSCursor *WKCursor(const char *name); 492 #endif 450 493 451 494 dispatch_source_t WKCreateVMPressureDispatchOnMainQueue(void); … … 467 510 468 511 #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 478 512 CGFloat WKNSElasticDeltaForTimeDelta(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime); 479 513 CGFloat WKNSElasticDeltaForReboundDelta(CGFloat delta);
Note: See TracChangeset
for help on using the changeset viewer.