<http://webkit.org/b/59372> Restore user default for enabling HTTP pipelining
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Apr 2011 18:13:11 +0000 (18:13 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Apr 2011 18:13:11 +0000 (18:13 +0000)
Reviewed by Antti Koivisto.

To enable HTTP pipelining post-SnowLeopard, use this command:

    defaults write BUNDLE.ID WebKitEnableHTTPPipelining -bool YES

* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::readBooleanPreference): Re-added.  Originally added in
r76756 and removed in r84120.
(WebCore::initializeMaximumHTTPConnectionCountPerHost): Enable
HTTP pipelining if use default is set to true.  Added macro
guards to match those in ResourceRequestMac.mm.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp

index ee64b54..7602e97 100644 (file)
@@ -1,3 +1,20 @@
+2011-04-26  David Kilzer  <ddkilzer@apple.com>
+
+        <http://webkit.org/b/59372> Restore user default for enabling HTTP pipelining
+
+        Reviewed by Antti Koivisto.
+
+        To enable HTTP pipelining post-SnowLeopard, use this command:
+
+            defaults write BUNDLE.ID WebKitEnableHTTPPipelining -bool YES
+
+        * platform/network/cf/ResourceRequestCFNet.cpp:
+        (WebCore::readBooleanPreference): Re-added.  Originally added in
+        r76756 and removed in r84120.
+        (WebCore::initializeMaximumHTTPConnectionCountPerHost): Enable
+        HTTP pipelining if use default is set to true.  Added macro
+        guards to match those in ResourceRequestMac.mm.
+
 2011-04-26  Antti Koivisto  <antti@apple.com>
 
         Reviewed by Adele Peterson.
index d0ef1f9..0e0fb8f 100644 (file)
@@ -221,15 +221,28 @@ void ResourceRequest::setHTTPPipeliningEnabled(bool flag)
     s_httpPipeliningEnabled = flag;
 }
 
+#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+static inline bool readBooleanPreference(CFStringRef key)
+{
+    Boolean keyExistsAndHasValidFormat;
+    Boolean result = CFPreferencesGetAppBooleanValue(key, kCFPreferencesCurrentApplication, &keyExistsAndHasValidFormat);
+    return keyExistsAndHasValidFormat ? result : false;
+}
+#endif
+
 unsigned initializeMaximumHTTPConnectionCountPerHost()
 {
     static const unsigned preferredConnectionCount = 6;
-    static const unsigned unlimitedConnectionCount = 10000;
 
     // Always set the connection count per host, even when pipelining.
     unsigned maximumHTTPConnectionCountPerHost = wkInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount);
 
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+    static const unsigned unlimitedConnectionCount = 10000;
+
+    if (!ResourceRequest::httpPipeliningEnabled() && readBooleanPreference(CFSTR("WebKitEnableHTTPPipelining")))
+        ResourceRequest::setHTTPPipeliningEnabled(true);
+
     if (ResourceRequest::httpPipeliningEnabled()) {
         wkSetHTTPPipeliningMaximumPriority(ResourceLoadPriorityHighest);
         wkSetHTTPPipeliningMinimumFastLanePriority(ResourceLoadPriorityMedium);