Skip to content
  • simonjam@chromium.org's avatar
    [chromium] Lower priority of preloaded images · 46617ac1
    simonjam@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=110527
    
    Source/WebCore:
    
    Reviewed by Nate Chapin.
    
    This improves Speed Index by ~5%, because it encourages us to load images that are needed for
    painting over speculative preloads. Ideally, all embedders would use this, but it relies on
    ResourceHandle::didChangePriority being implemented. Currently, only Chrome does that.
    
    Test: http/tests/loading/promote-img-preload-priority.html
    
    * loader/FrameLoaderClient.h:
    (FrameLoaderClient):
    (WebCore::FrameLoaderClient::dispatchDidChangeResourcePriority): Added callback to enable testing.
    * loader/cache/CachedResource.cpp:
    (WebCore::CachedResource::setLoadPriority): Signal callback.
    * loader/cache/CachedResourceLoader.cpp:
    (WebCore::CachedResourceLoader::preload): Actual behavior change.
    
    Source/WebKit/chromium:
    
    Plumb the didChangePriority signal into DRT so it can be tested.
    
    Reviewed by Nate Chapin.
    
    * public/WebFrameClient.h:
    (WebKit):
    (WebKit::WebFrameClient::didChangeResourcePriority):
    (WebFrameClient):
    * src/FrameLoaderClientImpl.cpp:
    (WebKit::FrameLoaderClientImpl::dispatchDidChangeResourcePriority):
    (WebKit):
    * src/FrameLoaderClientImpl.h:
    (FrameLoaderClientImpl):
    
    Tools:
    
    Plumb the didChangePriority signal into DRT so it can be tested.
    
    Reviewed by Nate Chapin.
    
    * DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h:
    (WebKit):
    (WebTestRunner::WebTestProxy::didChangeResourcePriority):
    * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
    (WebTestRunner::TestRunner::TestRunner):
    (WebTestRunner::TestRunner::reset):
    (WebTestRunner::TestRunner::shouldDumpResourcePriorities):
    (WebTestRunner):
    (WebTestRunner::TestRunner::dumpResourceRequestPriorities):
    * DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
    (TestRunner):
    * DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp:
    (WebTestRunner::WebTestProxyBase::assignIdentifierToRequest):
    (WebTestRunner::WebTestProxyBase::willSendRequest):
    (WebTestRunner::WebTestProxyBase::didChangeResourcePriority):
    (WebTestRunner):
    
    LayoutTests:
    
    Reviewed by Nate Chapin.
    
    * http/tests/loading/promote-img-preload-priority-expected.txt: Added.
    * http/tests/loading/promote-img-preload-priority.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    46617ac1