Changeset 141684 in webkit
- Timestamp:
- Feb 1, 2013 11:40:08 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/Platform/ChangeLog
r141652 r141684 1 2013-02-01 James Simonsen <simonjam@chromium.org> 2 3 Add didChangePriority() to ResourceHandle 4 https://bugs.webkit.org/show_bug.cgi?id=107995 5 6 Reviewed by Darin Fisher. 7 8 * chromium/public/WebURLLoader.h: 9 (WebKit): 10 (WebURLLoader): 11 (WebKit::WebURLLoader::didChangePriority): Added. 12 1 13 2013-02-01 Kevin Ellis <kevers@chromium.org> 2 14 -
trunk/Source/Platform/chromium/public/WebURLLoader.h
r112501 r141684 33 33 34 34 #include "WebCommon.h" 35 #include "WebURLRequest.h" 35 36 36 37 namespace WebKit { … … 38 39 class WebData; 39 40 class WebURLLoaderClient; 40 class WebURLRequest;41 41 class WebURLResponse; 42 42 struct WebURLError; … … 65 65 // Suspends/resumes an asynchronous load. 66 66 virtual void setDefersLoading(bool) = 0; 67 68 // Notifies the loader that the priority of a WebURLRequest has changed from 69 // its previous value. For example, a preload request starts with low 70 // priority, but may increase when the resource is needed for rendering. 71 virtual void didChangePriority(WebURLRequest::Priority newPriority) { } 67 72 }; 68 73 -
trunk/Source/WebCore/ChangeLog
r141679 r141684 1 2013-02-01 James Simonsen <simonjam@chromium.org> 2 3 Add didChangePriority() to ResourceHandle 4 https://bugs.webkit.org/show_bug.cgi?id=107995 5 6 Reviewed by Darin Fisher. 7 8 For PLT, it's important that preloads remain a lower priority than parser requested resources. 9 This can lead to a 5% improvement. 10 11 The plan is to use this plumbing to expose the desired behavior. This patch simply allows a 12 resource's priority to change and have it propagate to the network layer. An upcoming patch will 13 lower the priority of preloads and then increase the priority when the parser officially requests 14 it. 15 16 No new tests. No visible change, because priority doesn't change yet. 17 18 * loader/cache/CachedResource.cpp: 19 (WebCore): 20 (WebCore::CachedResource::setLoadPriority): 21 * loader/cache/CachedResourceLoader.cpp: 22 (WebCore::CachedResourceLoader::requestResource): Allow loads to modify priority. 23 * loader/cache/CachedResourceRequest.h: 24 (WebCore::CachedResourceRequest::setPriority): Notify when priority changes. 25 * platform/network/ResourceHandle.cpp: 26 (WebCore::ResourceHandle::didChangePriority): Added. 27 (WebCore): 28 * platform/network/ResourceHandle.h: 29 (ResourceHandle): 30 * platform/network/chromium/ResourceHandle.cpp: 31 (WebCore::ResourceHandleInternal::didChangePriority): 32 (WebCore): 33 (WebCore::ResourceHandle::didChangePriority): 34 * platform/network/chromium/ResourceHandleInternal.h: 35 (ResourceHandleInternal): 36 1 37 2013-02-01 Roger Fong <roger_fong@apple.com> 2 38 -
trunk/Source/WebCore/loader/cache/CachedResource.cpp
r141570 r141684 864 864 return sizeof(CachedResource) + m_response.memoryUsage() + kAverageClientsHashMapSize + m_resourceRequest.url().string().length() * 2; 865 865 } 866 867 void CachedResource::setLoadPriority(ResourceLoadPriority loadPriority) 868 { 866 867 void CachedResource::setLoadPriority(ResourceLoadPriority loadPriority) 868 { 869 869 if (loadPriority == ResourceLoadPriorityUnresolved) 870 loadPriority = defaultPriorityForResourceType(type()); 871 if (loadPriority == m_loadPriority) 870 872 return; 871 873 m_loadPriority = loadPriority; 874 if (m_loader && m_loader->handle()) 875 m_loader->handle()->didChangePriority(loadPriority); 872 876 } 873 877 -
trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp
r141570 r141684 466 466 return 0; 467 467 468 resource->setLoadPriority(request.priority()); 468 if (!request.forPreload() || policy != Use) 469 resource->setLoadPriority(request.priority()); 470 469 471 if ((policy != Use || resource->stillNeedsLoad()) && CachedResourceRequest::NoDefer == request.defer()) { 470 472 resource->load(this, request.options()); -
trunk/Source/WebCore/loader/cache/CachedResourceRequest.h
r135452 r141684 52 52 const ResourceLoaderOptions& options() const { return m_options; } 53 53 void setOptions(const ResourceLoaderOptions& options) { m_options = options; } 54 void setPriority(ResourceLoadPriority priority) { m_priority = priority; } 54 55 ResourceLoadPriority priority() const { return m_priority; } 55 56 bool forPreload() const { return m_forPreload; } -
trunk/Source/WebCore/platform/network/ResourceHandle.cpp
r138413 r141684 186 186 } 187 187 188 void ResourceHandle::didChangePriority(ResourceLoadPriority) 189 { 190 // Optionally implemented by platform. 191 } 192 188 193 void ResourceHandle::cacheMetadata(const ResourceResponse&, const Vector<char>&) 189 194 { -
trunk/Source/WebCore/platform/network/ResourceHandle.h
r140836 r141684 30 30 #include "HTTPHeaderMap.h" 31 31 #include "ResourceHandleTypes.h" 32 #include "ResourceLoadPriority.h" 32 33 #include <wtf/OwnPtr.h> 33 34 #include <wtf/RefCounted.h> … … 191 192 void pauseLoad(bool); 192 193 #endif 193 194 195 void didChangePriority(ResourceLoadPriority); 196 194 197 ResourceRequest& firstRequest(); 195 198 const String& lastHTTPMethod() const; -
trunk/Source/WebCore/platform/network/chromium/ResourceHandle.cpp
r138962 r141684 89 89 } 90 90 91 void ResourceHandleInternal::didChangePriority(WebURLRequest::Priority newPriority) 92 { 93 m_loader->didChangePriority(newPriority); 94 } 95 91 96 bool ResourceHandleInternal::allowStoredCredentials() const 92 97 { … … 277 282 } 278 283 284 void ResourceHandle::didChangePriority(ResourceLoadPriority newPriority) 285 { 286 d->didChangePriority(static_cast<WebURLRequest::Priority>(newPriority)); 287 } 288 279 289 // static 280 290 void ResourceHandle::cacheMetadata(const ResourceResponse& response, const Vector<char>& data) -
trunk/Source/WebCore/platform/network/chromium/ResourceHandleInternal.h
r112780 r141684 36 36 #include <public/WebURLLoader.h> 37 37 #include <public/WebURLLoaderClient.h> 38 #include <public/WebURLRequest.h> 38 39 39 40 namespace WebCore { … … 52 53 void setDefersLoading(bool); 53 54 bool allowStoredCredentials() const; 55 void didChangePriority(WebKit::WebURLRequest::Priority); 54 56 55 57 // WebURLLoaderClient methods:
Note: See TracChangeset
for help on using the changeset viewer.