+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()
_wkGetCFURLResponseMIMEType
_wkGetCFURLResponseURL
_wkGetHTTPCookieAcceptPolicy
-_wkGetHTTPPipeliningPriority
+_wkGetHTTPRequestPriority
_wkGetMIMETypeForExtension
_wkGetNSURLResponseLastModifiedDate
_wkGetUserToBaseCTM
_wkHTTPCookies
_wkHTTPCookiesForURL
+_wkHTTPRequestEnablePipelining
_wkInitializeMaximumHTTPConnectionCountPerHost
_wkSetBaseCTM
_wkSetCFURLResponseMIMEType
_wkSetCONNECTProxyForStream
_wkSetHTTPCookieAcceptPolicy
_wkSetHTTPCookiesForURL
-_wkSetHTTPPipeliningMaximumPriority
-_wkSetHTTPPipeliningMinimumFastLanePriority
-_wkSetHTTPPipeliningPriority
+_wkSetHTTPRequestMaximumPriority
+_wkSetHTTPRequestMinimumFastLanePriority
+_wkSetHTTPRequestPriority
_wkSetNSURLConnectionDefersCallbacks
_wkSetNSURLRequestShouldContentSniff
_wkSetPatternPhaseInUserSpace
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;
}
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);
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);
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);
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;
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.
#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();
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));
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());
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());
namespace WebCore {
+// FIXME: Make this a NetworkingContext property.
#if PLATFORM(IOS)
bool ResourceRequest::s_httpPipeliningEnabled = true;
#else
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
}
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())) {
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)
static const unsigned preferredConnectionCount = 6;
static const unsigned fastLaneConnectionCount = 1;
wkInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount);
- wkSetHTTPPipeliningMaximumPriority(ResourceLoadPriorityHighest);
- wkSetHTTPPipeliningMinimumFastLanePriority(ResourceLoadPriorityMedium);
+ wkSetHTTPRequestMaximumPriority(ResourceLoadPriorityHighest);
+ wkSetHTTPRequestMinimumFastLanePriority(ResourceLoadPriorityMedium);
_CFNetworkHTTPConnectionCacheSetLimit(kHTTPNumFastLanes, fastLaneConnectionCount);
}
#endif
}
}
-inline int toHTTPPipeliningPriority(ResourceLoadPriority priority)
+inline int toPlatformRequestPriority(ResourceLoadPriority priority)
{
switch (priority) {
case ResourceLoadPriorityUnresolved:
#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.
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();
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
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
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];
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]);
+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
INIT(GetFontInLanguageForRange);
INIT(GetGlyphTransformedAdvances);
#endif
- INIT(GetHTTPPipeliningPriority);
+ INIT(GetHTTPRequestPriority);
INIT(GetMIMETypeForExtension);
INIT(GetNSURLResponseLastModifiedDate);
#if !PLATFORM(IOS)
#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);
+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
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
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);
{
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);
-}
INIT(GetGlyphsForCharacters);
#endif
INIT(GetVerticalGlyphsForCharacters);
- INIT(GetHTTPPipeliningPriority);
+ INIT(GetHTTPRequestPriority);
INIT(GetMIMETypeForExtension);
INIT(GetNSURLResponseLastModifiedDate);
#if !PLATFORM(IOS)
INIT(HitTestMediaUIPart);
#endif
INIT(InitializeMaximumHTTPConnectionCountPerHost);
+ INIT(HTTPRequestEnablePipelining);
#if !PLATFORM(IOS)
INIT(MeasureMediaUIPart);
INIT(PopupMenu);
#if !PLATFORM(IOS)
INIT(SetDragImage);
#endif
- INIT(SetHTTPPipeliningMaximumPriority);
- INIT(SetHTTPPipeliningPriority);
- INIT(SetHTTPPipeliningMinimumFastLanePriority);
+ INIT(SetHTTPRequestMaximumPriority);
+ INIT(SetHTTPRequestPriority);
+ INIT(SetHTTPRequestMinimumFastLanePriority);
INIT(SetNSURLConnectionDefersCallbacks);
INIT(SetNSURLRequestShouldContentSniff);
INIT(SetPatternPhaseInUserSpace);
+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)
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;
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);
#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
NSArray *WKSpeechSynthesisGetVoiceIdentifiers(void);
NSString *WKSpeechSynthesisGetDefaultVoiceIdentifierForLocale(NSLocale*);
+#endif
BOOL WKShouldBlockPlugin(NSString *bundleIdentifier, NSString *bundleVersionString);
BOOL WKIsPluginUpdateAvailable(NSString *bundleIdentifier);
void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
void *context);
+#if !TARGET_OS_IPHONE
void WKDrawCapsLockIndicator(CGContextRef, CGRect);
void WKDrawFocusRing(CGContextRef context, CGColorRef color, int radius);
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);
CGSize WKCTRunGetInitialAdvance(CTRunRef);
+#if !TARGET_IPHONE_SIMULATOR
CGContextRef WKIOSurfaceContextCreate(IOSurfaceRef, unsigned width, unsigned height, CGColorSpaceRef);
CGImageRef WKIOSurfaceContextCreateImage(CGContextRef context);
+#endif
typedef enum {
WKPatternTilingNoDistortion,
bool WKCGContextDrawsWithCorrectShadowOffsets(CGContextRef);
#endif
+#if !TARGET_OS_IPHONE
#ifndef __LP64__
NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
} 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);
void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
void WKQTMovieDisableComponent(uint32_t[5]);
NSURL *WKQTMovieResolvedURL(QTMovie* movie);
+#endif
CFStringRef WKCopyFoundationCacheDirectory(void);
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,
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 *);
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);
#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);
CFDictionaryRef WKNSURLResponseCreateSerializableRepresentation(NSURLResponse *response, CFTypeRef tokenNull);
NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
-#ifndef __LP64__
+#if !TARGET_OS_IPHONE && !defined(__LP64__)
ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
#endif
CIFormat WKCIGetRGBA8Format(void);
+#if !TARGET_OS_IPHONE
typedef enum {
WKSandboxExtensionTypeReadOnly,
WKSandboxExtensionTypeReadWrite,
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
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);