[Mac] [Windows] Stop scheduling network requests in WebCore
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 12 Jan 2014 04:20:13 +0000 (04:20 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 12 Jan 2014 04:20:13 +0000 (04:20 +0000)
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161796 268f45cc-cd09-0410-ab3c-d52691b4dbfc

23 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/loader/ResourceLoadScheduler.cpp
Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.mm
Source/WebCore/platform/mac/WebCoreSystemInterface.h
Source/WebCore/platform/mac/WebCoreSystemInterface.mm
Source/WebCore/platform/network/ResourceHandle.h
Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp
Source/WebCore/platform/network/cf/ResourceRequestCFNet.h
Source/WebCore/platform/network/mac/ResourceHandleMac.mm
Source/WebCore/platform/network/mac/ResourceRequestMac.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/mac/NetworkResourceLoadSchedulerMac.mm
Source/WebKit2/UIProcess/API/C/WKContext.cpp
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h
WebKitLibraries/libWebKitSystemInterfaceLion.a
WebKitLibraries/libWebKitSystemInterfaceMavericks.a
WebKitLibraries/libWebKitSystemInterfaceMountainLion.a

index 77d7b37..f7e387f 100644 (file)
@@ -1,3 +1,41 @@
+2014-01-11  Alexey Proskuryakov  <ap@apple.com>
+
+        [Mac] [Windows] Stop scheduling network requests in WebCore
+        https://bugs.webkit.org/show_bug.cgi?id=126789
+        <rdar://problem/15114727>
+
+        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):
+
 2014-01-11  David Kilzer  <ddkilzer@apple.com>
 
         [iOS] Fix build failure in WebCore::findEndWordBoundary()
index 643c661..e74a158 100644 (file)
@@ -1893,12 +1893,13 @@ _wkGetCFURLResponseHTTPResponse
 _wkGetCFURLResponseMIMEType
 _wkGetCFURLResponseURL
 _wkGetHTTPCookieAcceptPolicy
-_wkGetHTTPPipeliningPriority
+_wkGetHTTPRequestPriority
 _wkGetMIMETypeForExtension
 _wkGetNSURLResponseLastModifiedDate
 _wkGetUserToBaseCTM
 _wkHTTPCookies
 _wkHTTPCookiesForURL
+_wkHTTPRequestEnablePipelining
 _wkInitializeMaximumHTTPConnectionCountPerHost
 _wkSetBaseCTM
 _wkSetCFURLResponseMIMEType
@@ -1906,9 +1907,9 @@ _wkSetCONNECTProxyAuthorizationForStream
 _wkSetCONNECTProxyForStream
 _wkSetHTTPCookieAcceptPolicy
 _wkSetHTTPCookiesForURL
-_wkSetHTTPPipeliningMaximumPriority
-_wkSetHTTPPipeliningMinimumFastLanePriority
-_wkSetHTTPPipeliningPriority
+_wkSetHTTPRequestMaximumPriority
+_wkSetHTTPRequestMinimumFastLanePriority
+_wkSetHTTPRequestPriority
 _wkSetNSURLConnectionDefersCallbacks
 _wkSetNSURLRequestShouldContentSniff
 _wkSetPatternPhaseInUserSpace
index a56f922..e8fee1d 100644 (file)
@@ -162,9 +162,10 @@ void ResourceLoadScheduler::scheduleLoad(ResourceLoader* resourceLoader, Resourc
     bool hadRequests = host->hasRequests();
     host->schedule(resourceLoader, priority);
 
-#if PLATFORM(IOS)
-    if (ResourceRequest::httpPipeliningEnabled() && !isSuspendingPendingRequests()) {
+#if PLATFORM(MAC) || USE(CFNETWORK)
+    if (!isSuspendingPendingRequests()) {
         // Serve all requests at once to keep the pipeline full at the network layer.
+        // FIXME: Does this code do anything useful, given that we also set maxRequestsInFlightPerHost to effectively unlimited on these platforms?
         servePendingRequests(host, ResourceLoadPriorityVeryLow);
         return;
     }
index ab764a5..25359e5 100644 (file)
@@ -58,9 +58,10 @@ void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
 id (*wkCreateNSURLConnectionDelegateProxy)(void);
 unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned preferredConnectionCount);
 int (*wkGetHTTPPipeliningPriority)(CFURLRequestRef);
-void (*wkSetHTTPPipeliningMaximumPriority)(int priority);
-void (*wkSetHTTPPipeliningPriority)(CFURLRequestRef, int priority);
-void (*wkSetHTTPPipeliningMinimumFastLanePriority)(int priority);
+void (*wkSetHTTPRequestMaximumPriority)(int priority);
+void (*wkSetHTTPRequestPriority)(CFURLRequestRef, int priority);
+void (*wkSetHTTPRequestMinimumFastLanePriority)(int priority);
+void (*wkHTTPRequestEnablePipelining)(CFURLRequestRef);
 void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
 void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
 void (*wkSetCookieStoragePrivateBrowsingEnabled)(BOOL);
index 5331289..1f53d40 100644 (file)
@@ -226,10 +226,11 @@ extern void (*wkSignalCFReadStreamEnd)(CFReadStreamRef stream);
 extern void (*wkSignalCFReadStreamError)(CFReadStreamRef stream, CFStreamError *error);
 extern void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream);
 extern unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned preferredConnectionCount);
-extern int (*wkGetHTTPPipeliningPriority)(CFURLRequestRef);
-extern void (*wkSetHTTPPipeliningMaximumPriority)(int maximumPriority);
-extern void (*wkSetHTTPPipeliningPriority)(CFURLRequestRef, int priority);
-extern void (*wkSetHTTPPipeliningMinimumFastLanePriority)(int priority);
+extern int (*wkGetHTTPRequestPriority)(CFURLRequestRef);
+extern void (*wkSetHTTPRequestMaximumPriority)(int maximumPriority);
+extern void (*wkSetHTTPRequestPriority)(CFURLRequestRef, int priority);
+extern void (*wkSetHTTPRequestMinimumFastLanePriority)(int priority);
+extern void (*wkHTTPRequestEnablePipelining)(CFURLRequestRef);
 extern void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
 extern void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
 extern CFHTTPMessageRef (*wkCopyCONNECTProxyResponse)(CFReadStreamRef, CFURLRef responseURL, CFStringRef proxyHost, CFNumberRef proxyPort);
index cd3e8c9..e637631 100644 (file)
@@ -105,10 +105,11 @@ CFReadStreamRef (*wkCreateCustomCFReadStream)(void *(*formCreate)(CFReadStreamRe
 void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
 void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
 unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned preferredConnectionCount);
-int (*wkGetHTTPPipeliningPriority)(CFURLRequestRef);
-void (*wkSetHTTPPipeliningMaximumPriority)(int priority);
-void (*wkSetHTTPPipeliningPriority)(CFURLRequestRef, int priority);
-void (*wkSetHTTPPipeliningMinimumFastLanePriority)(int priority);
+int (*wkGetHTTPRequestPriority)(CFURLRequestRef);
+void (*wkSetHTTPRequestMaximumPriority)(int priority);
+void (*wkSetHTTPRequestPriority)(CFURLRequestRef, int priority);
+void (*wkSetHTTPRequestMinimumFastLanePriority)(int priority);
+void (*wkHTTPRequestEnablePipelining)(CFURLRequestRef);
 void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
 void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
 CFHTTPMessageRef (*wkCopyCONNECTProxyResponse)(CFReadStreamRef, CFURLRef responseURL, CFStringRef proxyHost, CFNumberRef proxyPort);
index a2a56b2..7d53b90 100644 (file)
@@ -272,10 +272,17 @@ private:
     virtual void refAuthenticationClient() OVERRIDE { ref(); }
     virtual void derefAuthenticationClient() OVERRIDE { deref(); }
 
-#if PLATFORM(MAC) && !USE(CFNETWORK)
-    void createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff);
-#elif USE(CFNETWORK)
-    void createCFURLConnection(bool shouldUseCredentialStorage, bool shouldContentSniff, CFDictionaryRef clientProperties);
+#if PLATFORM(MAC) || USE(CFNETWORK)
+    enum class SchedulingBehavior {
+        Asynchronous,
+        Synchronous
+    };
+
+#if USE(CFNETWORK)
+    void createCFURLConnection(bool shouldUseCredentialStorage, bool shouldContentSniff, SchedulingBehavior, CFDictionaryRef clientProperties);
+#else
+    void createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff, SchedulingBehavior);
+#endif
 #endif
 
     friend class ResourceHandleInternal;
index e394c00..3284f21 100644 (file)
@@ -115,7 +115,7 @@ ResourceHandle::~ResourceHandle()
     LOG(Network, "CFNet - Destroying job %p (%s)", this, d->m_firstRequest.url().string().utf8().data());
 }
 
-void ResourceHandle::createCFURLConnection(bool shouldUseCredentialStorage, bool shouldContentSniff, CFDictionaryRef clientProperties)
+void ResourceHandle::createCFURLConnection(bool shouldUseCredentialStorage, bool shouldContentSniff, SchedulingBehavior schedulingBehavior, CFDictionaryRef clientProperties)
 {
     if ((!d->m_user.isEmpty() || !d->m_pass.isEmpty()) && !firstRequest().url().protocolIsInHTTPFamily()) {
         // Credentials for ftp can only be passed in URL, the didReceiveAuthenticationChallenge delegate call won't be made.
@@ -185,8 +185,20 @@ void ResourceHandle::createCFURLConnection(bool shouldUseCredentialStorage, bool
 #endif
 
     CFMutableDictionaryRef streamProperties  = CFDictionaryCreateMutable(0, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
-    if (!shouldUseCredentialStorage)
+
+    if (!shouldUseCredentialStorage) {
+        // Avoid using existing connections, because they may be already authenticated.
         CFDictionarySetValue(streamProperties, CFSTR("_kCFURLConnectionSessionID"), CFSTR("WebKitPrivateSession"));
+    }
+
+    if (schedulingBehavior == SchedulingBehavior::Synchronous) {
+        // Synchronous requests should not be subject to regular connection count limit to avoid deadlocks.
+        // If we are using all available connections for async requests, and make a sync request, then prior
+        // requests may get stuck waiting for delegate calls while we are in nested run loop, and the sync
+        // request won't start because there are no available connections.
+        // Connections are grouped by their socket stream properties, with each group having a separate count.
+        CFDictionarySetValue(streamProperties, CFSTR("_WebKitSynchronousRequest"), kCFBooleanTrue);
+    }
 
 #if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090)
     RetainPtr<CFDataRef> sourceApplicationAuditData = d->m_context->sourceApplicationAuditData();
@@ -200,11 +212,11 @@ void ResourceHandle::createCFURLConnection(bool shouldUseCredentialStorage, bool
         propertiesDictionary = adoptCF(CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, clientProperties));
     else
         propertiesDictionary = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+
+    // FIXME: This code is different from iOS code in ResourceHandleMac.mm in that here we ignore stream properties that were present in client properties.
     CFDictionaryAddValue(propertiesDictionary.get(), kCFURLConnectionSocketStreamProperties, streamProperties);
     CFRelease(streamProperties);
 
-
-
 #if PLATFORM(MAC)
     if (client() && client()->usesAsyncCallbacks())
         d->m_connectionDelegate = adoptRef(new ResourceHandleCFURLConnectionDelegateWithOperationQueue(this));
@@ -234,7 +246,7 @@ bool ResourceHandle::start()
 
     bool shouldUseCredentialStorage = !client() || client()->shouldUseCredentialStorage(this);
 
-    createCFURLConnection(shouldUseCredentialStorage, d->m_shouldContentSniff, client()->connectionProperties(this).get());
+    createCFURLConnection(shouldUseCredentialStorage, d->m_shouldContentSniff, SchedulingBehavior::Asynchronous, client()->connectionProperties(this).get());
 
     d->m_connectionDelegate->setupConnectionScheduling(d->m_connection.get());
     CFURLConnectionStart(d->m_connection.get());
@@ -480,7 +492,8 @@ void ResourceHandle::platformLoadResourceSynchronously(NetworkingContext* contex
         return;
     }
 
-    handle->createCFURLConnection(storedCredentials == AllowStoredCredentials, ResourceHandle::shouldContentSniffURL(request.url()), handle->client()->connectionProperties(handle.get()).get());
+    handle->createCFURLConnection(storedCredentials == AllowStoredCredentials, ResourceHandle::shouldContentSniffURL(request.url()),
+        SchedulingBehavior::Synchronous, handle->client()->connectionProperties(handle.get()).get());
 
     CFURLConnectionScheduleWithRunLoop(handle->connection(), CFRunLoopGetCurrent(), synchronousLoadRunLoopMode());
     CFURLConnectionScheduleDownloadWithRunLoop(handle->connection(), CFRunLoopGetCurrent(), synchronousLoadRunLoopMode());
index 4a2623f..a81a95f 100644 (file)
@@ -53,6 +53,7 @@
 
 namespace WebCore {
 
+// FIXME: Make this a NetworkingContext property.
 #if PLATFORM(IOS)
 bool ResourceRequest::s_httpPipeliningEnabled = true;
 #else
@@ -151,7 +152,10 @@ void ResourceRequest::doUpdatePlatformRequest()
     CFURLRequestSetHTTPRequestMethod(cfRequest, httpMethod().createCFString().get());
 
     if (httpPipeliningEnabled())
-        wkSetHTTPPipeliningPriority(cfRequest, toHTTPPipeliningPriority(m_priority));
+        wkHTTPRequestEnablePipelining(cfRequest);
+
+    wkSetHTTPRequestPriority(cfRequest, toPlatformRequestPriority(m_priority));
+
 #if !PLATFORM(WIN)
     wkCFURLRequestAllowAllPostCaching(cfRequest);
 #endif
@@ -270,8 +274,7 @@ void ResourceRequest::doUpdateResourceRequest()
     }
     m_allowCookies = CFURLRequestShouldHandleHTTPCookies(m_cfRequest.get());
 
-    if (httpPipeliningEnabled())
-        m_priority = toResourceLoadPriority(wkGetHTTPPipeliningPriority(m_cfRequest.get()));
+    m_priority = toResourceLoadPriority(wkGetHTTPRequestPriority(m_cfRequest.get()));
 
     m_httpHeaderFields.clear();
     if (CFDictionaryRef headers = CFURLRequestCopyAllHTTPHeaderFields(m_cfRequest.get())) {
@@ -392,28 +395,22 @@ void ResourceRequest::doPlatformAdopt(PassOwnPtr<CrossThreadResourceRequestData>
 unsigned initializeMaximumHTTPConnectionCountPerHost()
 {
     static const unsigned preferredConnectionCount = 6;
-
-    // Always set the connection count per host, even when pipelining.
-    unsigned maximumHTTPConnectionCountPerHost = wkInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount);
-
     static const unsigned unlimitedConnectionCount = 10000;
 
+    wkInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount);
+
     Boolean keyExistsAndHasValidFormat = false;
     Boolean prefValue = CFPreferencesGetAppBooleanValue(CFSTR("WebKitEnableHTTPPipelining"), kCFPreferencesCurrentApplication, &keyExistsAndHasValidFormat);
     if (keyExistsAndHasValidFormat)
         ResourceRequest::setHTTPPipeliningEnabled(prefValue);
 
-    if (ResourceRequest::httpPipeliningEnabled()) {
-        wkSetHTTPPipeliningMaximumPriority(toHTTPPipeliningPriority(ResourceLoadPriorityHighest));
+    wkSetHTTPRequestMaximumPriority(toPlatformRequestPriority(ResourceLoadPriorityHighest));
 #if !PLATFORM(WIN)
-        // FIXME: <rdar://problem/9375609> Implement minimum fast lane priority setting on Windows
-        wkSetHTTPPipeliningMinimumFastLanePriority(toHTTPPipeliningPriority(ResourceLoadPriorityMedium));
+    // FIXME: <rdar://problem/9375609> Implement minimum fast lane priority setting on Windows
+    wkSetHTTPRequestMinimumFastLanePriority(toPlatformRequestPriority(ResourceLoadPriorityMedium));
 #endif
-        // When pipelining do not rate-limit requests sent from WebCore since CFNetwork handles that.
-        return unlimitedConnectionCount;
-    }
 
-    return maximumHTTPConnectionCountPerHost;
+    return unlimitedConnectionCount;
 }
     
 #if PLATFORM(IOS)
@@ -426,8 +423,8 @@ void initializeHTTPConnectionSettingsOnStartup()
     static const unsigned preferredConnectionCount = 6;
     static const unsigned fastLaneConnectionCount = 1;
     wkInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount);
-    wkSetHTTPPipeliningMaximumPriority(ResourceLoadPriorityHighest);
-    wkSetHTTPPipeliningMinimumFastLanePriority(ResourceLoadPriorityMedium);
+    wkSetHTTPRequestMaximumPriority(ResourceLoadPriorityHighest);
+    wkSetHTTPRequestMinimumFastLanePriority(ResourceLoadPriorityMedium);
     _CFNetworkHTTPConnectionCacheSetLimit(kHTTPNumFastLanes, fastLaneConnectionCount);
 }
 #endif
index 919b236..b912108 100644 (file)
@@ -62,7 +62,7 @@ inline ResourceLoadPriority toResourceLoadPriority(int priority)
     }
 }
 
-inline int toHTTPPipeliningPriority(ResourceLoadPriority priority)
+inline int toPlatformRequestPriority(ResourceLoadPriority priority)
 {
     switch (priority) {
     case ResourceLoadPriorityUnresolved:
index 3d04518..3b708f1 100644 (file)
@@ -118,9 +118,9 @@ static bool synchronousWillSendRequestEnabled()
 #endif
 
 #if !PLATFORM(IOS)
-void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff)
+void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff, SchedulingBehavior schedulingBehavior)
 #else
-void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff, NSDictionary *connectionProperties)
+void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff, SchedulingBehavior schedulingBehavior, NSDictionary *connectionProperties)
 #endif
 {
     // Credentials for ftp can only be passed in URL, the connection:didReceiveAuthenticationChallenge: delegate call won't be made.
@@ -162,14 +162,26 @@ void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredential
     ASSERT([NSURLConnection instancesRespondToSelector:@selector(_initWithRequest:delegate:usesCache:maxContentLength:startImmediately:connectionProperties:)]);
 
 #if PLATFORM(IOS)
+    // FIXME: This code is different from iOS code in ResourceHandleCFNet.cpp in that here we respect stream properties that were present in client properties.
     NSDictionary *streamPropertiesFromClient = [connectionProperties objectForKey:@"kCFURLConnectionSocketStreamProperties"];
     NSMutableDictionary *streamProperties = streamPropertiesFromClient ? [[streamPropertiesFromClient mutableCopy] autorelease] : [NSMutableDictionary dictionary];
 #else
     NSMutableDictionary *streamProperties = [NSMutableDictionary dictionary];
 #endif
 
-    if (!shouldUseCredentialStorage)
+    if (!shouldUseCredentialStorage) {
+        // Avoid using existing connections, because they may be already authenticated.
         [streamProperties setObject:@"WebKitPrivateSession" forKey:@"_kCFURLConnectionSessionID"];
+    }
+
+    if (schedulingBehavior == SchedulingBehavior::Synchronous) {
+        // Synchronous requests should not be subject to regular connection count limit to avoid deadlocks.
+        // If we are using all available connections for async requests, and make a sync request, then prior
+        // requests may get stuck waiting for delegate calls while we are in nested run loop, and the sync
+        // request won't start because there are no available connections.
+        // Connections are grouped by their socket stream properties, with each group having a separate count.
+        [streamProperties setObject:@TRUE forKey:@"_WebKitSynchronousRequest"];
+    }
 
 #if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     RetainPtr<CFDataRef> sourceApplicationAuditData = d->m_context->sourceApplicationAuditData();
@@ -213,12 +225,14 @@ bool ResourceHandle::start()
     createNSURLConnection(
         ResourceHandle::delegate(),
         shouldUseCredentialStorage,
-        d->m_shouldContentSniff || d->m_context->localFileContentSniffingEnabled());
+        d->m_shouldContentSniff || d->m_context->localFileContentSniffingEnabled(),
+        SchedulingBehavior::Asynchronous);
 #else
     createNSURLConnection(
         d->m_proxy.get(),
         shouldUseCredentialStorage,
         d->m_shouldContentSniff || d->m_context->localFileContentSniffingEnabled(),
+        SchedulingBehavior::Asynchronous,
         (NSDictionary *)client()->connectionProperties(this));
 #endif
 
@@ -366,13 +380,15 @@ void ResourceHandle::platformLoadResourceSynchronously(NetworkingContext* contex
     handle->createNSURLConnection(
         handle->delegate(),
         storedCredentials == AllowStoredCredentials,
-        handle->shouldContentSniff() || context->localFileContentSniffingEnabled());
+        handle->shouldContentSniff() || context->localFileContentSniffingEnabled(),
+        SchedulingBehavior::Synchronous);
 #else
     handle->createNSURLConnection(
         handle->delegate(), // A synchronous request cannot turn into a download, so there is no need to proxy the delegate.
         storedCredentials == AllowStoredCredentials,
         shouldRelaxThirdPartyCookiePolicy(context, request.url()),
         handle->shouldContentSniff() || (context && context->localFileContentSniffingEnabled()),
+        SchedulingBehavior::Synchronous,
         (NSDictionary *)handle->client()->connectionProperties(handle.get()));
 #endif
 
index 3c78c68..75d894f 100644 (file)
@@ -108,8 +108,7 @@ void ResourceRequest::doUpdateResourceRequest()
         m_httpMethod = method;
     m_allowCookies = [m_nsRequest.get() HTTPShouldHandleCookies];
 
-    if (ResourceRequest::httpPipeliningEnabled())
-        m_priority = toResourceLoadPriority(wkGetHTTPPipeliningPriority([m_nsRequest.get() _CFURLRequest]));
+    m_priority = toResourceLoadPriority(wkGetHTTPRequestPriority([m_nsRequest.get() _CFURLRequest]));
 
     NSDictionary *headers = [m_nsRequest.get() allHTTPHeaderFields];
     NSEnumerator *e = [headers keyEnumerator];
@@ -165,7 +164,9 @@ void ResourceRequest::doUpdatePlatformRequest()
         nsRequest = [[NSMutableURLRequest alloc] initWithURL:url()];
 
     if (ResourceRequest::httpPipeliningEnabled())
-        wkSetHTTPPipeliningPriority([nsRequest _CFURLRequest], toHTTPPipeliningPriority(m_priority));
+        wkHTTPRequestEnablePipelining([nsRequest _CFURLRequest]);
+
+    wkSetHTTPRequestPriority([nsRequest _CFURLRequest], toPlatformRequestPriority(m_priority));
 
     [nsRequest setCachePolicy:(NSURLRequestCachePolicy)cachePolicy()];
     wkCFURLRequestAllowAllPostCaching([nsRequest _CFURLRequest]);
index ed0e4fa..832ea6d 100644 (file)
@@ -1,3 +1,14 @@
+2014-01-11  Alexey Proskuryakov  <ap@apple.com>
+
+        [Mac] [Windows] Stop scheduling network requests in WebCore
+        https://bugs.webkit.org/show_bug.cgi?id=126789
+        <rdar://problem/15114727>
+
+        Reviewed by Sam Weinig.
+
+        * WebCoreSupport/WebSystemInterface.mm: (InitWebCoreSystemInterface): Updated
+        for new WKSI function names.
+
 2014-01-10  Anders Carlsson  <andersca@apple.com>
 
         Tweak ProgressTrackerClient functions
index 35dcbf4..a26e576 100644 (file)
@@ -77,7 +77,7 @@ void InitWebCoreSystemInterface(void)
     INIT(GetFontInLanguageForRange);
     INIT(GetGlyphTransformedAdvances);
 #endif
-    INIT(GetHTTPPipeliningPriority);
+    INIT(GetHTTPRequestPriority);
     INIT(GetMIMETypeForExtension);
     INIT(GetNSURLResponseLastModifiedDate);
 #if !PLATFORM(IOS)
@@ -105,9 +105,10 @@ void InitWebCoreSystemInterface(void)
 #if !PLATFORM(IOS)
     INIT(SetDragImage);
 #endif
-    INIT(SetHTTPPipeliningMaximumPriority);
-    INIT(SetHTTPPipeliningPriority);
-    INIT(SetHTTPPipeliningMinimumFastLanePriority);
+    INIT(SetHTTPRequestMaximumPriority);
+    INIT(SetHTTPRequestPriority);
+    INIT(SetHTTPRequestMinimumFastLanePriority);
+    INIT(HTTPRequestEnablePipelining);
     INIT(SetNSURLConnectionDefersCallbacks);
     INIT(SetNSURLRequestShouldContentSniff);
     INIT(SetPatternPhaseInUserSpace);
index a85760c..6156cf8 100644 (file)
@@ -1,3 +1,21 @@
+2014-01-11  Alexey Proskuryakov  <ap@apple.com>
+
+        [Mac] [Windows] Stop scheduling network requests in WebCore
+        https://bugs.webkit.org/show_bug.cgi?id=126789
+        <rdar://problem/15114727>
+
+        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.
+
 2014-01-11  Simon Fraser  <simon.fraser@apple.com>
 
         Unfork GraphicsContext::drawNativeImage for iOS
index 15f21c4..f10ed38 100644 (file)
@@ -39,36 +39,20 @@ namespace WebKit {
 
 void NetworkResourceLoadScheduler::platformInitializeMaximumHTTPConnectionCountPerHost()
 {
-    wkInitializeMaximumHTTPConnectionCountPerHost = WKInitializeMaximumHTTPConnectionCountPerHost;
-    wkSetHTTPPipeliningMaximumPriority = WKSetHTTPPipeliningMaximumPriority;
-    wkSetHTTPPipeliningMinimumFastLanePriority = WKSetHTTPPipeliningMinimumFastLanePriority;
-
-    // Our preferred connection-per-host limit is the standard 6, but we need to let CFNetwork handle a 7th
-    // in case a synchronous XHRs is made while 6 loads are already outstanding.
-    static const unsigned preferredConnectionCount = 7;
+    static const unsigned preferredConnectionCount = 6;
     static const unsigned unlimitedConnectionCount = 10000;
 
-    // Always set the connection count per host, even when pipelining.
-    unsigned maximumHTTPConnectionCountPerHost = wkInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount);
+    WKInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount);
 
     Boolean keyExistsAndHasValidFormat = false;
     Boolean prefValue = CFPreferencesGetAppBooleanValue(CFSTR("WebKitEnableHTTPPipelining"), kCFPreferencesCurrentApplication, &keyExistsAndHasValidFormat);
-    
     if (keyExistsAndHasValidFormat)
         ResourceRequest::setHTTPPipeliningEnabled(prefValue);
 
-    if (ResourceRequest::httpPipeliningEnabled()) {
-        wkSetHTTPPipeliningMaximumPriority(toHTTPPipeliningPriority(ResourceLoadPriorityHighest));
-        wkSetHTTPPipeliningMinimumFastLanePriority(toHTTPPipeliningPriority(ResourceLoadPriorityMedium));
-
-        // When pipelining do not rate-limit requests sent from WebCore since CFNetwork handles that.
-        m_maxRequestsInFlightPerHost = unlimitedConnectionCount;
-
-        return;
-    }
+    WKSetHTTPRequestMaximumPriority(toPlatformRequestPriority(ResourceLoadPriorityHighest));
+    WKSetHTTPRequestMinimumFastLanePriority(toPlatformRequestPriority(ResourceLoadPriorityMedium));
 
-    // We've asked for one more connection per host than we intend to use in most cases so synch XHRs can bypass that limit.
-    m_maxRequestsInFlightPerHost = maximumHTTPConnectionCountPerHost - 1;
+    m_maxRequestsInFlightPerHost = unlimitedConnectionCount;
 }
 
 } // namespace WebKit
index ad9f252..e8d00f6 100644 (file)
 
 using namespace WebKit;
 
-extern "C" {
-// For binary compatibility with Safari 5.1. Should be removed eventually.
-WK_EXPORT void _WKContextSetAdditionalPluginsDirectory(WKContextRef context, WKStringRef pluginsDirectory);
-WK_EXPORT void _WKContextRegisterURLSchemeAsEmptyDocument(WKContextRef context, WKStringRef urlScheme);
-WK_EXPORT void _WKContextSetAlwaysUsesComplexTextCodePath(WKContextRef context, bool alwaysUseComplexTextCodePath);
-WK_EXPORT void _WKContextSetHTTPPipeliningEnabled(WKContextRef context, bool enabled);
-}
-
 WKTypeID WKContextGetTypeID()
 {
     return toAPI(WebContext::APIType);
@@ -409,24 +401,3 @@ void WKContextSetInvalidMessageFunction(WKContextInvalidMessageFunction invalidM
 {
     WebContext::setInvalidMessageCallback(invalidMessageFunction);
 }
-
-// Deprecated functions.
-void _WKContextSetAdditionalPluginsDirectory(WKContextRef context, WKStringRef pluginsDirectory)
-{
-    WKContextSetAdditionalPluginsDirectory(context, pluginsDirectory);
-}
-
-void _WKContextRegisterURLSchemeAsEmptyDocument(WKContextRef context, WKStringRef urlScheme)
-{
-    WKContextRegisterURLSchemeAsEmptyDocument(context, urlScheme);
-}
-
-void _WKContextSetAlwaysUsesComplexTextCodePath(WKContextRef context, bool alwaysUseComplexTextCodePath)
-{
-    WKContextSetAlwaysUsesComplexTextCodePath(context, alwaysUseComplexTextCodePath);
-}
-
-void _WKContextSetHTTPPipeliningEnabled(WKContextRef context, bool enabled)
-{
-    WKContextSetHTTPPipeliningEnabled(context, enabled);
-}
index dcdd40a..d2f625c 100644 (file)
@@ -70,7 +70,7 @@ void InitWebCoreSystemInterface(void)
         INIT(GetGlyphsForCharacters);
 #endif
         INIT(GetVerticalGlyphsForCharacters);
-        INIT(GetHTTPPipeliningPriority);
+        INIT(GetHTTPRequestPriority);
         INIT(GetMIMETypeForExtension);
         INIT(GetNSURLResponseLastModifiedDate);
 #if !PLATFORM(IOS)
@@ -85,6 +85,7 @@ void InitWebCoreSystemInterface(void)
         INIT(HitTestMediaUIPart);
 #endif
         INIT(InitializeMaximumHTTPConnectionCountPerHost);
+        INIT(HTTPRequestEnablePipelining);
 #if !PLATFORM(IOS)
         INIT(MeasureMediaUIPart);
         INIT(PopupMenu);
@@ -111,9 +112,9 @@ void InitWebCoreSystemInterface(void)
 #if !PLATFORM(IOS)
         INIT(SetDragImage);
 #endif
-        INIT(SetHTTPPipeliningMaximumPriority);
-        INIT(SetHTTPPipeliningPriority);
-        INIT(SetHTTPPipeliningMinimumFastLanePriority);
+        INIT(SetHTTPRequestMaximumPriority);
+        INIT(SetHTTPRequestPriority);
+        INIT(SetHTTPRequestMinimumFastLanePriority);
         INIT(SetNSURLConnectionDefersCallbacks);
         INIT(SetNSURLRequestShouldContentSniff);
         INIT(SetPatternPhaseInUserSpace);
index 0a944e5..723a247 100644 (file)
@@ -1,3 +1,16 @@
+2014-01-11  Alexey Proskuryakov  <ap@apple.com>
+
+        [Mac] [Windows] Stop scheduling network requests in WebCore
+        https://bugs.webkit.org/show_bug.cgi?id=126789
+        <rdar://problem/15114727>
+
+        Update WKSI.
+
+        * WebKitSystemInterface.h:
+        * libWebKitSystemInterfaceLion.a:
+        * libWebKitSystemInterfaceMavericks.a:
+        * libWebKitSystemInterfaceMountainLion.a:
+
 2014-01-10  peavo@outlook.com  <peavo@outlook.com>
 
         [WinCairo] Crash when rendering (in pixman dll)
index b1ce060..1054913 100644 (file)
@@ -5,10 +5,21 @@
     Public header file.
 */
 
-#import <Cocoa/Cocoa.h>
-#import <Carbon/Carbon.h>
+#import <Foundation/Foundation.h>
 #import <dispatch/dispatch.h>
 
+#if !TARGET_OS_IPHONE
+#import <AppKit/AppKit.h>
+#import <Carbon/Carbon.h>
+#else
+#import <CoreImage/CoreImage.h>
+#import <CoreText/CoreText.h>
+#if !TARGET_IPHONE_SIMULATOR
+#import <IOSurface/IOSurface.h>
+#endif
+#import <WebKitSystemInterfaceIOS.h>
+#endif
+
 @class AVAsset;
 @class QTMovie;
 @class QTMovieView;
@@ -50,6 +61,7 @@ CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
 void WKSetMetadataURL(NSString *URLString, NSString *referrer, NSString *path);
 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
 
+#if !TARGET_OS_IPHONE
 void WKShowKeyAndMain(void);
 #ifndef __LP64__
 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
@@ -60,10 +72,12 @@ OSType WKCarbonWindowPropertyTag(void);
 #endif
 
 void WKDisableCGDeferredUpdates(void);
+#endif
 
 Class WKNSURLProtocolClassForRequest(NSURLRequest *request);
 void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
 
+#if !TARGET_OS_IPHONE
 #ifndef __LP64__
 unsigned WKGetNSAutoreleasePoolCount(void);
 #endif
@@ -88,6 +102,7 @@ void WKUnregisterUniqueIdForElement(id element);
     
 NSArray *WKSpeechSynthesisGetVoiceIdentifiers(void);
 NSString *WKSpeechSynthesisGetDefaultVoiceIdentifierForLocale(NSLocale*);
+#endif
     
 BOOL WKShouldBlockPlugin(NSString *bundleIdentifier, NSString *bundleVersionString);
 BOOL WKIsPluginUpdateAvailable(NSString *bundleIdentifier);
@@ -117,6 +132,7 @@ CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef,
     void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
     void *context);
 
+#if !TARGET_OS_IPHONE
 void WKDrawCapsLockIndicator(CGContextRef, CGRect);
 
 void WKDrawFocusRing(CGContextRef context, CGColorRef color, int radius);
@@ -142,6 +158,8 @@ BOOL WKGetGlyphTransformedAdvances(CGFontRef, NSFont*, CGAffineTransform *m, ATS
 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font, BOOL shouldSubpixelQuantize);
+#endif
+
 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
 
 
@@ -169,8 +187,10 @@ CTTypesetterRef WKCreateCTTypesetterWithUniCharProviderAndOptions(const UniChar*
 
 CGSize WKCTRunGetInitialAdvance(CTRunRef);
 
+#if !TARGET_IPHONE_SIMULATOR
 CGContextRef WKIOSurfaceContextCreate(IOSurfaceRef, unsigned width, unsigned height, CGColorSpaceRef);
 CGImageRef WKIOSurfaceContextCreateImage(CGContextRef context);
+#endif
 
 typedef enum {
     WKPatternTilingNoDistortion,
@@ -185,6 +205,7 @@ void WKCGContextResetClip(CGContextRef);
 bool WKCGContextDrawsWithCorrectShadowOffsets(CGContextRef);
 #endif
 
+#if !TARGET_OS_IPHONE
 #ifndef __LP64__
 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
@@ -206,11 +227,13 @@ typedef enum {
 } WKThemeScrollBarArrowStyle;
 
 OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef inContext, int inArrowStyle);
+#endif
 
 
 BOOL WKCGContextIsBitmapContext(CGContextRef context);
 bool WKCGContextIsPDFContext(CGContextRef context);
 
+#if !TARGET_OS_IPHONE
 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
 
 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
@@ -237,6 +260,7 @@ NSString *WKQTMovieMaxTimeLoadedChangeNotification(void);
 void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
 void WKQTMovieDisableComponent(uint32_t[5]);
 NSURL *WKQTMovieResolvedURL(QTMovie* movie);
+#endif
 
 CFStringRef WKCopyFoundationCacheDirectory(void);
 
@@ -262,11 +286,14 @@ void WKSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool flag);
 CFArrayRef WKCFURLRequestCopyHTTPRequestBodyParts(CFURLRequestRef);
 void WKCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bodyParts);
 
+#if !TARGET_OS_IPHONE
 void WKSetVisibleApplicationName(CFStringRef);
 void WKSetApplicationInformationItem(CFStringRef key, CFTypeRef value);
+#endif
 
 CFURLRef WKCopyBundleURLForExecutableURL(CFURLRef);
 
+#if !TARGET_OS_IPHONE
 typedef enum {
     WKMediaUIPartFullscreenButton   = 0,
     WKMediaUIPartMuteButton,
@@ -328,21 +355,26 @@ void WKQTClearMediaDownloadCacheForSite(NSString *site);
 void WKQTClearMediaDownloadCache();
     
 mach_port_t WKInitializeRenderServer(void);
-    
+#endif
+
 @class CALayer;
 
 CALayer *WKMakeRenderLayer(uint32_t contextID);
     
+#if !TARGET_OS_IPHONE
 typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
 
 WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
+#endif
 
 typedef struct __WKCAContextRef *WKCAContextRef;
 
 WKCAContextRef WKCAContextMakeRemoteWithServerPort(mach_port_t port);
+#if !TARGET_OS_IPHONE
 WKCAContextRef WKCAContextMakeRemoteForWindowServer(void);
+#endif
 void WKCAContextInvalidate(WKCAContextRef);
 uint32_t WKCAContextGetContextId(WKCAContextRef);
 void WKCAContextSetLayer(WKCAContextRef, CALayer *);
@@ -358,6 +390,7 @@ void WKCALayerEnumerateRectsBeingDrawnWithBlock(CALayer *layer, CGContextRef con
 void WKCARendererAddChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
 void WKCARendererRemoveChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
 
+#if !TARGET_OS_IPHONE
 typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef;
 
 WKWindowBounceAnimationContextRef WKWindowBounceAnimationContextCreate(NSWindow *window);
@@ -369,30 +402,34 @@ void WKWindowSetClipRect(NSWindow*, NSRect);
 #if defined(__x86_64__)
 #import <mach/mig.h>
 CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
-#endif // defined(__x86_64__)
+#endif
 
 NSUInteger WKGetInputPanelWindowStyle(void);
 UInt8 WKGetNSEventKeyChar(NSEvent *);
+#endif
 
 @class CAPropertyAnimation;
 void WKSetCAAnimationValueFunction(CAPropertyAnimation*, NSString* function);
 
 unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
-int WKGetHTTPPipeliningPriority(CFURLRequestRef);
-void WKSetHTTPPipeliningMaximumPriority(int maximumPriority);
-void WKSetHTTPPipeliningPriority(CFURLRequestRef, int priority);
-void WKSetHTTPPipeliningMinimumFastLanePriority(int priority);
+int WKGetHTTPRequestPriority(CFURLRequestRef);
+void WKSetHTTPRequestMaximumPriority(int maximumPriority);
+void WKSetHTTPRequestPriority(CFURLRequestRef, int priority);
+void WKSetHTTPRequestMinimumFastLanePriority(int priority);
+void WKHTTPRequestEnablePipelining(CFURLRequestRef);
 
 void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
 void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
 CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL, CFStringRef proxyHost, CFNumberRef proxyPort);
 
+#if !TARGET_OS_IPHONE
 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
 
 void WKSyncSurfaceToView(NSView *view);
 
 void WKEnableSettingCursorWhenInBackground(void);
+#endif
 
 CFDictionaryRef WKNSURLRequestCreateSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull);
 NSURLRequest *WKNSURLRequestFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
@@ -400,7 +437,7 @@ NSURLRequest *WKNSURLRequestFromSerializableRepresentation(CFDictionaryRef repre
 CFDictionaryRef WKNSURLResponseCreateSerializableRepresentation(NSURLResponse *response, CFTypeRef tokenNull);
 NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
 
-#ifndef __LP64__
+#if !TARGET_OS_IPHONE && !defined(__LP64__)
 ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
 #endif
 
@@ -415,6 +452,7 @@ void WKSetCFURLResponseMIMEType(CFURLResponseRef, CFStringRef mimeType);
 
 CIFormat WKCIGetRGBA8Format(void);
 
+#if !TARGET_OS_IPHONE
 typedef enum {
     WKSandboxExtensionTypeReadOnly,
     WKSandboxExtensionTypeReadWrite,
@@ -439,14 +477,19 @@ bool WKExecutableWasLinkedOnOrBeforeSnowLeopard(void);
 NSRange WKExtractWordDefinitionTokenRangeFromContextualString(NSString *contextString, NSRange range, NSDictionary **options);
 void WKShowWordDefinitionWindow(NSAttributedString *term, NSPoint screenPoint, NSDictionary *options);
 void WKHideWordDefinitionWindow(void);
+#endif
 
+#if !TARGET_OS_IPHONE
 CFStringRef WKCopyDefaultSearchProviderDisplayName(void);
+#endif
 
 void WKSetCrashReportApplicationSpecificInformation(CFStringRef);
 
 NSURL* WKAVAssetResolvedURL(AVAsset*);
 
+#if !TARGET_OS_IPHONE
 NSCursor *WKCursor(const char *name);
+#endif
 
 dispatch_source_t WKCreateVMPressureDispatchOnMainQueue(void);
 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
@@ -466,15 +509,6 @@ void WKCGPathAddRoundedRect(CGMutablePathRef path, const CGAffineTransform* matr
 void WKCFURLRequestAllowAllPostCaching(CFURLRequestRef);
 
 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
-@class WebFilterEvaluator;
-
-BOOL WKFilterIsManagedSession(void);
-WebFilterEvaluator *WKFilterCreateInstance(NSURLResponse *);
-BOOL WKFilterIsBuffering(WebFilterEvaluator *);
-BOOL WKFilterWasBlocked(WebFilterEvaluator *);
-NSData *WKFilterAddData(WebFilterEvaluator *, NSData *);
-NSData *WKFilterDataComplete(WebFilterEvaluator *);
-
 CGFloat WKNSElasticDeltaForTimeDelta(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
 CGFloat WKNSElasticDeltaForReboundDelta(CGFloat delta);
 CGFloat WKNSReboundDeltaForElasticDelta(CGFloat delta);
index 1707bca..7d4dbfd 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLion.a and b/WebKitLibraries/libWebKitSystemInterfaceLion.a differ
index 75b72b3..b176f14 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceMavericks.a and b/WebKitLibraries/libWebKitSystemInterfaceMavericks.a differ
index 797a566..42f28d0 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceMountainLion.a and b/WebKitLibraries/libWebKitSystemInterfaceMountainLion.a differ