<http://webkit.org/b/57384> CFNetwork and WebCore load priorities should match
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Apr 2011 04:37:05 +0000 (04:37 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Apr 2011 04:37:05 +0000 (04:37 +0000)
Reviewed by Alexey Proskuryakov.

Source/WebCore:

* WebCore.exp.in: Export wkSetHTTPPipeliningMaximumPriority().
* platform/mac/WebCoreSystemInterface.h:
(wkSetHTTPPipeliningMaximumPriority): Added function pointer
declaration.
* platform/mac/WebCoreSystemInterface.mm:
(wkSetHTTPPipeliningMaximumPriority): Added function pointer.
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::initializeMaximumHTTPConnectionCountPerHost): Call
wkSetHTTPPipeliningMaximumPriority() to set the maximum HTTP
pipelining priority.
* platform/network/cf/ResourceRequestCFNet.h:
(WebCore::toResourceLoadPriority): Renamed from
mapHTTPPipeliningPriorityToResourceLoadPriority().  Updated to
to handle Unresolved case.
(WebCore::toHTTPPipeliningPriority): Renamed from
mapResourceLoadPriorityToHTTPPipeliningPriority().  Updated to
handle Unresolved case.
* platform/network/mac/ResourceRequestMac.mm:
(WebCore::ResourceRequest::doUpdateResourceRequest): Switched to
use toResourceLoadPriority().
(WebCore::ResourceRequest::doUpdatePlatformRequest): Switched to
use toHTTPPipeliningPriority().  Moved
shouldForceHTTPPipeliningPriorityHigh() check into the argument
of toHTTPPipeliningPriority() instead of hard-coding a
now-incorrect value.

Source/WebKit/mac:

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Added initialization for
wkSetHTTPPipeliningMaximumPriority().

Source/WebKit2:

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Added initialization for
wkSetHTTPPipeliningMaximumPriority().

WebKitLibraries:

* WebKitSystemInterface.h:
(WKSetHTTPPipeliningMaximumPriority): Added declaration.
(WKExtractWordDefinitionTokenRangeFromContextualString): Added
missing declaration from r81890.
(WKShowWordDefinitionWindow): Ditto.
(WKHideWordDefinitionWindow): Ditto.
* libWebKitSystemInterfaceLeopard.a: Updated.
* libWebKitSystemInterfaceSnowLeopard.a: Updated.

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

15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/mac/WebCoreSystemInterface.h
Source/WebCore/platform/mac/WebCoreSystemInterface.mm
Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp
Source/WebCore/platform/network/cf/ResourceRequestCFNet.h
Source/WebCore/platform/network/mac/ResourceRequestMac.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h
WebKitLibraries/libWebKitSystemInterfaceLeopard.a
WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a

index 02d3bffce970cbee4e41e3415c6f89ddbbcb7456..55d7b9bd24c0cc409d0764d55f3d06e75a268081 100644 (file)
@@ -1,3 +1,35 @@
+2011-04-04  David Kilzer  <ddkilzer@apple.com>
+
+        <http://webkit.org/b/57384> CFNetwork and WebCore load priorities should match
+
+        Reviewed by Alexey Proskuryakov.
+
+        * WebCore.exp.in: Export wkSetHTTPPipeliningMaximumPriority().
+        * platform/mac/WebCoreSystemInterface.h:
+        (wkSetHTTPPipeliningMaximumPriority): Added function pointer
+        declaration.
+        * platform/mac/WebCoreSystemInterface.mm:
+        (wkSetHTTPPipeliningMaximumPriority): Added function pointer.
+        * platform/network/cf/ResourceRequestCFNet.cpp:
+        (WebCore::initializeMaximumHTTPConnectionCountPerHost): Call
+        wkSetHTTPPipeliningMaximumPriority() to set the maximum HTTP
+        pipelining priority.
+        * platform/network/cf/ResourceRequestCFNet.h:
+        (WebCore::toResourceLoadPriority): Renamed from
+        mapHTTPPipeliningPriorityToResourceLoadPriority().  Updated to
+        to handle Unresolved case.
+        (WebCore::toHTTPPipeliningPriority): Renamed from
+        mapResourceLoadPriorityToHTTPPipeliningPriority().  Updated to
+        handle Unresolved case.
+        * platform/network/mac/ResourceRequestMac.mm:
+        (WebCore::ResourceRequest::doUpdateResourceRequest): Switched to
+        use toResourceLoadPriority().
+        (WebCore::ResourceRequest::doUpdatePlatformRequest): Switched to
+        use toHTTPPipeliningPriority().  Moved
+        shouldForceHTTPPipeliningPriorityHigh() check into the argument
+        of toHTTPPipeliningPriority() instead of hard-coding a
+        now-incorrect value.
+
 2011-04-04  MORITA Hajime  <morrita@google.com>
 
         Reviewed by Kent Tamura.
index d9fa98c63aeb28ecf2492915fa32c4e30efbea04..8e415670c8b8726618c3db340bce2278db5a1a35 100644 (file)
@@ -1366,6 +1366,7 @@ _wkSetCONNECTProxyForStream
 _wkSetCookieStoragePrivateBrowsingEnabled
 _wkSetDragImage
 _wkSetHTTPCookiesForURL
+_wkSetHTTPPipeliningMaximumPriority
 _wkSetHTTPPipeliningPriority
 _wkSetNSURLConnectionDefersCallbacks
 _wkSetNSURLRequestShouldContentSniff
index ea23ae5e0021d9249cc81c66680132db72eb1579..11aae00b1f39cfb1739df3cfdcd9469f85d62c31 100644 (file)
@@ -155,6 +155,7 @@ extern void (*wkSignalCFReadStreamError)(CFReadStreamRef stream, CFStreamError *
 extern void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream);
 extern unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned preferredConnectionCount);
 extern int (*wkGetHTTPPipeliningPriority)(NSURLRequest *);
+extern void (*wkSetHTTPPipeliningMaximumPriority)(int maximumPriority);
 extern void (*wkSetHTTPPipeliningPriority)(NSMutableURLRequest *, int priority);
 extern void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
 extern void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
index e6fc47e395af73570e4eef40f35570568b492791..e27bf2fd49f588c9f3df7c07c23581ed5744b89a 100644 (file)
@@ -91,6 +91,7 @@ void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
 id (*wkCreateNSURLConnectionDelegateProxy)(void);
 unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned preferredConnectionCount);
 int (*wkGetHTTPPipeliningPriority)(NSURLRequest *);
+void (*wkSetHTTPPipeliningMaximumPriority)(int priority);
 void (*wkSetHTTPPipeliningPriority)(NSMutableURLRequest *, int priority);
 void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
 void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
index fdccc114c44ef56870d864e766daf70db7a3cc02..af287c72918a4493203836622882d6f2e36099ac 100644 (file)
@@ -29,6 +29,7 @@
 #include "ResourceRequest.h"
 
 #if PLATFORM(MAC)
+#include "ResourceLoadPriority.h"
 #include "WebCoreSystemInterface.h"
 #endif
 
@@ -218,6 +219,7 @@ unsigned initializeMaximumHTTPConnectionCountPerHost()
 
 #if PLATFORM(MAC)
     if (isHTTPPipeliningEnabled()) {
+        wkSetHTTPPipeliningMaximumPriority(ResourceLoadPriorityHighest);
         // When pipelining do not rate-limit requests sent from WebCore since CFNetwork handles that.
         return unlimitedConnectionCount;
     }
index 271dcd2e7cb89a016690bb1246d7beb5c11414bb..987508fe114e5ed639f8a830f84ff7af826b29e5 100644 (file)
@@ -41,34 +41,37 @@ void getResourceRequest(ResourceRequest&, CFURLRequestRef);
 CFURLRequestRef cfURLRequest(const ResourceRequest&);
 #endif
 
-inline ResourceLoadPriority mapHTTPPipeliningPriorityToResourceLoadPriority(int priority)
+inline ResourceLoadPriority toResourceLoadPriority(int priority)
 {
     switch (priority) {
+    case -1:
+        return ResourceLoadPriorityUnresolved;
     case 0:
-        return ResourceLoadPriorityLow;
+        return ResourceLoadPriorityVeryLow;
     case 1:
-        return ResourceLoadPriorityMedium;
+        return ResourceLoadPriorityLow;
     case 2:
-        return ResourceLoadPriorityHigh;
+        return ResourceLoadPriorityMedium;
     case 3:
-        return ResourceLoadPriorityUnresolved;
+        return ResourceLoadPriorityHigh;
     default:
         ASSERT_NOT_REACHED();
         return ResourceLoadPriorityLowest;
     }
 }
 
-inline int mapResourceLoadPriorityToHTTPPipeliningPriority(ResourceLoadPriority priority)
+inline int toHTTPPipeliningPriority(ResourceLoadPriority priority)
 {
     switch (priority) {
+    case ResourceLoadPriorityUnresolved:
+        return -1;
     case ResourceLoadPriorityVeryLow:
-    case ResourceLoadPriorityLow:
         return 0;
-    case ResourceLoadPriorityMedium:
+    case ResourceLoadPriorityLow:
         return 1;
-    case ResourceLoadPriorityHigh:
+    case ResourceLoadPriorityMedium:
         return 2;
-    case ResourceLoadPriorityUnresolved:
+    case ResourceLoadPriorityHigh:
         return 3;
     }
 
index 8446782d6aac704ca82249bb6b3465f89c627134..33ff4902939efb94d1ecf602173a73336c486598 100644 (file)
@@ -71,7 +71,7 @@ void ResourceRequest::doUpdateResourceRequest()
 
 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     if (isHTTPPipeliningEnabled() && !shouldForceHTTPPipeliningPriorityHigh())
-        m_priority = mapHTTPPipeliningPriorityToResourceLoadPriority(wkGetHTTPPipeliningPriority(m_nsRequest.get()));
+        m_priority = toResourceLoadPriority(wkGetHTTPPipeliningPriority(m_nsRequest.get()));
 #endif
 
     NSDictionary *headers = [m_nsRequest.get() allHTTPHeaderFields];
@@ -121,8 +121,8 @@ void ResourceRequest::doUpdatePlatformRequest()
 
 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     if (isHTTPPipeliningEnabled()) {
-        int priority = mapResourceLoadPriorityToHTTPPipeliningPriority(m_priority);
-        wkSetHTTPPipeliningPriority(nsRequest, shouldForceHTTPPipeliningPriorityHigh() ? 2 : priority);
+        int priority = toHTTPPipeliningPriority(shouldForceHTTPPipeliningPriorityHigh() ? ResourceLoadPriorityHigh : m_priority);
+        wkSetHTTPPipeliningPriority(nsRequest, priority);
     }
 #endif
 
index 73455b7dd1a745b08e87de5122853ae644411748..f64835ac31df8949b776c360a9f12fb75ef4f5e3 100644 (file)
@@ -1,3 +1,13 @@
+2011-04-04  David Kilzer  <ddkilzer@apple.com>
+
+        <http://webkit.org/b/57384> CFNetwork and WebCore load priorities should match
+
+        Reviewed by Alexey Proskuryakov.
+
+        * WebCoreSupport/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface): Added initialization for
+        wkSetHTTPPipeliningMaximumPriority().
+
 2011-04-04  Alexey Proskuryakov  <ap@apple.com>
 
         Reviewed by Dan Bernstein.
index 77ca3e76bc31d423ae09354b72bf1987bd6ddec2..e2f1759b6cb32cef31deb199092bd2def7e284e5 100644 (file)
@@ -76,6 +76,7 @@ void InitWebCoreSystemInterface(void)
     INIT(SetCONNECTProxyForStream);
     INIT(SetCookieStoragePrivateBrowsingEnabled);
     INIT(SetDragImage);
+    INIT(SetHTTPPipeliningMaximumPriority);
     INIT(SetHTTPPipeliningPriority);
     INIT(SetNSURLConnectionDefersCallbacks);
     INIT(SetNSURLRequestShouldContentSniff);
index fe3edf78d1186d693c2afd4aa7b63aa90e6b0c77..e8e0a60bac87f2d26998cc678d5f7c14b9cc4142 100644 (file)
@@ -1,3 +1,13 @@
+2011-04-04  David Kilzer  <ddkilzer@apple.com>
+
+        <http://webkit.org/b/57384> CFNetwork and WebCore load priorities should match
+
+        Reviewed by Alexey Proskuryakov.
+
+        * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface): Added initialization for
+        wkSetHTTPPipeliningMaximumPriority().
+
 2011-04-04  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Darin Adler.
index 5fd67027324f13ca72aa43fe965bb0b8414c3dba..f201a4ff1e8ee93c850bca7deaa5a630a0d0d6d2 100644 (file)
@@ -84,6 +84,7 @@ void InitWebCoreSystemInterface(void)
         INIT(SetCONNECTProxyForStream);
         INIT(SetCookieStoragePrivateBrowsingEnabled);
         INIT(SetDragImage);
+        INIT(SetHTTPPipeliningMaximumPriority);
         INIT(SetHTTPPipeliningPriority);
         INIT(SetNSURLConnectionDefersCallbacks);
         INIT(SetNSURLRequestShouldContentSniff);
index bc1e08d78e4721e0614b365e115b4c5274787af1..5c4c5edc090a5c75bccfee946f1afa569f8c895f 100644 (file)
@@ -1,3 +1,18 @@
+2011-04-04  David Kilzer  <ddkilzer@apple.com>
+
+        <http://webkit.org/b/57384> CFNetwork and WebCore load priorities should match
+
+        Reviewed by Alexey Proskuryakov.
+
+        * WebKitSystemInterface.h:
+        (WKSetHTTPPipeliningMaximumPriority): Added declaration.
+        (WKExtractWordDefinitionTokenRangeFromContextualString): Added
+        missing declaration from r81890.
+        (WKShowWordDefinitionWindow): Ditto.
+        (WKHideWordDefinitionWindow): Ditto.
+        * libWebKitSystemInterfaceLeopard.a: Updated.
+        * libWebKitSystemInterfaceSnowLeopard.a: Updated.
+
 2011-04-04  Steve Falkenburg  <sfalken@apple.com>
 
         Reviewed by Adam Roben.
index 6f9c243518225087472dc4ff27b92941500b13f9..4a8b54144dbfc5e2162aed36d8466b3bc647dc66 100644 (file)
@@ -352,6 +352,7 @@ void WKSetCAAnimationValueFunction(CAPropertyAnimation*, NSString* function);
 
 unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
 int WKGetHTTPPipeliningPriority(NSURLRequest *);
+void WKSetHTTPPipeliningMaximumPriority(int maximumPriority);
 void WKSetHTTPPipeliningPriority(NSMutableURLRequest *, int priority);
 
 void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
index a854587ed502e323a35775b4143d252ebd9abc3b..676ea0fcb99ea4bc408012e2ad5732bc39327af6 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a differ
index 895cd884728ca93ff240a172e00b4ad3f4b5efdd..e5881dbf2690cecbadfbedf53a5b567cd619cd92 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a differ