[chromium] Lower priority of preloaded images
authorsimonjam@chromium.org <simonjam@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Feb 2013 23:47:52 +0000 (23:47 +0000)
committersimonjam@chromium.org <simonjam@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Feb 2013 23:47:52 +0000 (23:47 +0000)
commit053c15fb0932c3421c0b2f1d98d88714d0828fac
tree81f4b92fbae339b24e809f184f06c55924f097e9
parent553d2b27b810e990f18e615c30e4edb94635a5c2
[chromium] Lower priority of preloaded images
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: https://svn.webkit.org/repository/webkit/trunk@144248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/loading/promote-img-preload-priority-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/loading/promote-img-preload-priority.html [new file with mode: 0644]
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/qt/TestExpectations
LayoutTests/platform/win/TestExpectations
LayoutTests/platform/wincairo/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/loader/FrameLoaderClient.h
Source/WebCore/loader/ResourceLoader.cpp
Source/WebCore/loader/ResourceLoader.h
Source/WebCore/loader/cache/CachedResource.cpp
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebFrameClient.h
Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
Source/WebKit/chromium/src/FrameLoaderClientImpl.h
Tools/ChangeLog
Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h
Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp
Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h
Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp