<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 02d3bff..55d7b9b 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 d9fa98c..8e41567 100644 (file)
@@ -1366,6 +1366,7 @@ _wkSetCONNECTProxyForStream
 _wkSetCookieStoragePrivateBrowsingEnabled
 _wkSetDragImage
 _wkSetHTTPCookiesForURL
+_wkSetHTTPPipeliningMaximumPriority
 _wkSetHTTPPipeliningPriority
 _wkSetNSURLConnectionDefersCallbacks
 _wkSetNSURLRequestShouldContentSniff
index ea23ae5..11aae00 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 e6fc47e..e27bf2f 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 fdccc11..af287c7 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 271dcd2..987508f 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 8446782..33ff490 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 73455b7..f64835a 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 77ca3e7..e2f1759 100644 (file)
@@ -76,6 +76,7 @@ void InitWebCoreSystemInterface(void)
     INIT(SetCONNECTProxyForStream);
     INIT(SetCookieStoragePrivateBrowsingEnabled);
     INIT(SetDragImage);
+    INIT(SetHTTPPipeliningMaximumPriority);
     INIT(SetHTTPPipeliningPriority);
     INIT(SetNSURLConnectionDefersCallbacks);
     INIT(SetNSURLRequestShouldContentSniff);
index fe3edf7..e8e0a60 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 5fd6702..f201a4f 100644 (file)
@@ -84,6 +84,7 @@ void InitWebCoreSystemInterface(void)
         INIT(SetCONNECTProxyForStream);
         INIT(SetCookieStoragePrivateBrowsingEnabled);
         INIT(SetDragImage);
+        INIT(SetHTTPPipeliningMaximumPriority);
         INIT(SetHTTPPipeliningPriority);
         INIT(SetNSURLConnectionDefersCallbacks);
         INIT(SetNSURLRequestShouldContentSniff);
index bc1e08d..5c4c5ed 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 6f9c243..4a8b541 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 a854587..676ea0f 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a differ
index 895cd88..e5881db 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a differ