void initializeHTTPConnectionSettingsOnStartup() { // This need to be called from WebKitInitialize so the calls happen early enough, before any requests are made. <rdar://problem/9691871> // Desktop doesn't have early initialization so it is not clear how this should be done there. The CFNetwork SPI probably // needs to become more forgiving. // We can't read settings here as this is called too early for that. All values need to be constants. static const unsigned preferredConnectionCount = 6; static const unsigned fastLaneConnectionCount = 1; wkInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount); wkSetHTTPRequestMaximumPriority(ResourceLoadPriorityHighest); wkSetHTTPRequestMinimumFastLanePriority(ResourceLoadPriorityMedium); _CFNetworkHTTPConnectionCacheSetLimit(kHTTPNumFastLanes, fastLaneConnectionCount); }
unsigned initializeMaximumHTTPConnectionCountPerHost() { static const unsigned preferredConnectionCount = 6; static const unsigned unlimitedConnectionCount = 10000; wkInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount); Boolean keyExistsAndHasValidFormat = false; Boolean prefValue = CFPreferencesGetAppBooleanValue(CFSTR("WebKitEnableHTTPPipelining"), kCFPreferencesCurrentApplication, &keyExistsAndHasValidFormat); if (keyExistsAndHasValidFormat) ResourceRequest::setHTTPPipeliningEnabled(prefValue); wkSetHTTPRequestMaximumPriority(toPlatformRequestPriority(ResourceLoadPriorityHighest)); #if !PLATFORM(WIN) // FIXME: <rdar://problem/9375609> Implement minimum fast lane priority setting on Windows wkSetHTTPRequestMinimumFastLanePriority(toPlatformRequestPriority(ResourceLoadPriorityMedium)); #endif return unlimitedConnectionCount; }