Changeset 252431 in webkit
- Timestamp:
- Nov 13, 2019 2:41:08 PM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r252423 r252431 1 2019-11-13 Benjamin Nham <nham@apple.com> 2 3 VeryHigh priority loads are actually loading at VeryLow priority 4 https://bugs.webkit.org/show_bug.cgi?id=203423 5 <rdar://problem/56621789> 6 7 Reviewed by Antti Koivisto. 8 9 There are two issues with the way we translate ResourceLoadPriority to 10 CFURLRequestPriority: 11 12 1. We call _CFNetworkHTTPConnectionCacheSetLimit and set 1 too few 13 priority levels. This means VeryHigh priority loads are actually out 14 of bounds, which causes CFNetwork to set the priority level back to 0 15 in HTTPConnectionCacheEntry::_prepareNewRequest. After this patch we'll 16 call _CFNetworkHTTPConnectionCacheSetLimit with the correct number of 17 levels. 18 19 2. _CFNetworkHTTPConnectionCacheSetLimit doesn't work for NSURLSession 20 right now (<rdar://problem/56621205>), so we have to map to the default 21 number of CFURLRequestPriority levels, which is 4. Right now we have 5 22 ResourceLoadPriority levels, so there will be some aliasing involved. 23 After this patch VeryLow gets a priority of -1 and Low gets a priority 24 of 0, but due to the aforementioned clamping behavior both VeryLow and 25 Low will effectively both have a CFURLRequestPriority of 0. 26 27 * platform/network/cf/ResourceRequestCFNet.cpp: 28 (WebCore::initializeMaximumHTTPConnectionCountPerHost): 29 (WebCore::initializeHTTPConnectionSettingsOnStartup): 30 * platform/network/cf/ResourceRequestCFNet.h: 31 (WebCore::toResourceLoadPriority): 32 (WebCore::toPlatformRequestPriority): 33 1 34 2019-11-13 Dean Jackson <dino@apple.com> 2 35 -
trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp
r251954 r252431 415 415 return maximumHTTPConnectionCountPerHost; 416 416 417 _CFNetworkHTTPConnectionCacheSetLimit(kHTTPPriorityNumLevels, toPlatformRequestPriority(ResourceLoadPriority::Highest));417 _CFNetworkHTTPConnectionCacheSetLimit(kHTTPPriorityNumLevels, resourceLoadPriorityCount); 418 418 #if !PLATFORM(WIN) 419 419 // FIXME: <rdar://problem/9375609> Implement minimum fast lane priority setting on Windows … … 434 434 static const unsigned fastLaneConnectionCount = 1; 435 435 _CFNetworkHTTPConnectionCacheSetLimit(kHTTPLoadWidth, preferredConnectionCount); 436 _CFNetworkHTTPConnectionCacheSetLimit(kHTTPPriorityNumLevels, toPlatformRequestPriority(ResourceLoadPriority::Highest));436 _CFNetworkHTTPConnectionCacheSetLimit(kHTTPPriorityNumLevels, resourceLoadPriorityCount); 437 437 _CFNetworkHTTPConnectionCacheSetLimit(kHTTPMinimumFastLanePriority, toPlatformRequestPriority(ResourceLoadPriority::Medium)); 438 438 _CFNetworkHTTPConnectionCacheSetLimit(kHTTPNumFastLanes, fastLaneConnectionCount); -
trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.h
r220243 r252431 41 41 inline ResourceLoadPriority toResourceLoadPriority(CFURLRequestPriority priority) 42 42 { 43 // FIXME: switch VeryLow back to 0 priority when CFNetwork fixes <rdar://problem/56621205> 43 44 switch (priority) { 44 45 case -1: 46 return ResourceLoadPriority::VeryLow; 45 47 case 0: 46 return ResourceLoadPriority:: VeryLow;48 return ResourceLoadPriority::Low; 47 49 case 1: 48 return ResourceLoadPriority:: Low;50 return ResourceLoadPriority::Medium; 49 51 case 2: 50 return ResourceLoadPriority:: Medium;52 return ResourceLoadPriority::High; 51 53 case 3: 52 return ResourceLoadPriority::High;53 case 4:54 54 return ResourceLoadPriority::VeryHigh; 55 55 default: … … 61 61 inline CFURLRequestPriority toPlatformRequestPriority(ResourceLoadPriority priority) 62 62 { 63 // FIXME: switch VeryLow back to 0 priority when CFNetwork fixes <rdar://problem/56621205> 63 64 switch (priority) { 64 65 case ResourceLoadPriority::VeryLow: 66 return -1; 67 case ResourceLoadPriority::Low: 65 68 return 0; 66 case ResourceLoadPriority:: Low:69 case ResourceLoadPriority::Medium: 67 70 return 1; 68 case ResourceLoadPriority:: Medium:71 case ResourceLoadPriority::High: 69 72 return 2; 70 case ResourceLoadPriority:: High:73 case ResourceLoadPriority::VeryHigh: 71 74 return 3; 72 case ResourceLoadPriority::VeryHigh:73 return 4;74 75 } 75 76 -
trunk/Source/WebKit/ChangeLog
r252428 r252431 1 2019-11-13 Benjamin Nham <nham@apple.com> 2 3 VeryHigh priority loads are actually loading at VeryLow priority 4 https://bugs.webkit.org/show_bug.cgi?id=203423 5 <rdar://problem/56621789> 6 7 Reviewed by Antti Koivisto. 8 9 There are two issues with the way we translate ResourceLoadPriority to 10 CFURLRequestPriority: 11 12 1. We call _CFNetworkHTTPConnectionCacheSetLimit and set 1 too few 13 priority levels. This means VeryHigh priority loads are actually out 14 of bounds, which causes CFNetwork to set the priority level back to 0 15 in HTTPConnectionCacheEntry::_prepareNewRequest. After this patch we'll 16 call _CFNetworkHTTPConnectionCacheSetLimit with the correct number of 17 levels. 18 19 2. _CFNetworkHTTPConnectionCacheSetLimit doesn't work for NSURLSession 20 right now (<rdar://problem/56621205>), so we have to map to the default 21 number of CFURLRequestPriority levels, which is 4. Right now we have 5 22 ResourceLoadPriority levels, so there will be some aliasing involved. 23 After this patch VeryLow gets a priority of -1 and Low gets a priority 24 of 0, but due to the aforementioned clamping behavior both VeryLow and 25 Low will effectively both have a CFURLRequestPriority of 0. 26 27 * NetworkProcess/cocoa/NetworkProcessCocoa.mm: 28 (WebKit::initializeNetworkSettings): 29 1 30 2019-11-13 Youenn Fablet <youenn@apple.com> 2 31 -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm
r252368 r252431 63 63 const unsigned fastLaneConnectionCount = 1; 64 64 65 _CFNetworkHTTPConnectionCacheSetLimit(kHTTPPriorityNumLevels, toPlatformRequestPriority(WebCore::ResourceLoadPriority::Highest));65 _CFNetworkHTTPConnectionCacheSetLimit(kHTTPPriorityNumLevels, WebCore::resourceLoadPriorityCount); 66 66 _CFNetworkHTTPConnectionCacheSetLimit(kHTTPMinimumFastLanePriority, toPlatformRequestPriority(WebCore::ResourceLoadPriority::Medium)); 67 67 _CFNetworkHTTPConnectionCacheSetLimit(kHTTPNumFastLanes, fastLaneConnectionCount);
Note: See TracChangeset
for help on using the changeset viewer.