Reland "Add in-place reload behavior to ImagesEnabled setting" with optimizations
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Sep 2012 06:51:39 +0000 (06:51 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Sep 2012 06:51:39 +0000 (06:51 +0000)
commit3d314b6c2112040ea0870f508d3334f1339c74a6
treeb87726027ca02feb60ab3d5778ab0e795c1401e0
parent0f635123b99c986b97ee82b12a64edc46eff1d4f
Reland "Add in-place reload behavior to ImagesEnabled setting" with optimizations
https://bugs.webkit.org/show_bug.cgi?id=97055

Patch by Bo Liu <boliu@chromium.org> on 2012-09-24
Reviewed by Adam Barth.

Relanding 128780, 128676, 128645. Was reverted in 128914 due to
performance regression in Chromium.

New changes in addition to previously reverted patches:

Refactored CachedResource::requestResource, loadResource, and
revalidateResource. Moved CachedResource::load method to end of
requestResource so there is one place where load is called for all
resources.

Added a enum parameter for requestResource and
determineRevalidationPolicy so that FrameLoaderClient::allowImage call
do not need to be called multiple times.

Removed CachedImage::load call in requestImage so it is not called
twice.

Removed unnecessary Frame.h includes in CachedResource and
CachedImage.

Removed dead load() method declaration in CachedImage.

Updated text expectation for two image-permissions tests to reflect
the removed calls to allowImage.

.:

* Source/autotools/symbols.filter:

Source/WebCore:

Tests: fast/loader/display-image-unset-allows-cached-image-load.html
       fast/loader/display-image-unset-can-block-image-and-can-reload-in-place.html
       fast/loader/images-enabled-unset-can-block-image-and-can-reload-in-place.html

* WebCore.exp.in:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequest):
* loader/cache/CachedImage.cpp:
* loader/cache/CachedImage.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::didAddClient):
* loader/cache/CachedResource.h:
(WebCore):
(WebCore::CachedResource::stillNeedsLoad):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::CachedResourceLoader):
(WebCore::CachedResourceLoader::requestImage):
(WebCore::CachedResourceLoader::canRequest):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::revalidateResource):
(WebCore::CachedResourceLoader::loadResource):
(WebCore::CachedResourceLoader::determineRevalidationPolicy):
(WebCore::CachedResourceLoader::setAutoLoadImages):
(WebCore):
(WebCore::CachedResourceLoader::setImagesEnabled):
(WebCore::CachedResourceLoader::clientDefersImage):
(WebCore::CachedResourceLoader::shouldDeferImageLoad):
(WebCore::CachedResourceLoader::reloadImagesIfNotDeferred):
* loader/cache/CachedResourceLoader.h:
(CachedResourceLoader):
* page/Settings.cpp:
(WebCore::setImageLoadingSettings):
(WebCore::Settings::Settings):
(WebCore::Settings::setLoadsImagesAutomatically):
(WebCore::Settings::imageLoadingSettingsTimerFired):
(WebCore::Settings::setImagesEnabled):
* page/Settings.h:
(Settings):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setImagesEnabled):
(WebCore):
* testing/InternalSettings.h:
(Backup):
(InternalSettings):
* testing/InternalSettings.idl:

Source/WebKit2:

* win/WebKit2.def:

LayoutTests:

* fast/loader/display-image-unset-allows-cached-image-load-expected.txt: Added.
* fast/loader/display-image-unset-allows-cached-image-load.html: Added.
* fast/loader/display-image-unset-can-block-image-and-can-reload-in-place-expected.txt: Added.
* fast/loader/display-image-unset-can-block-image-and-can-reload-in-place.html: Added.
* fast/loader/images-enabled-unset-can-block-image-and-can-reload-in-place-expected.txt: Added.
* fast/loader/images-enabled-unset-can-block-image-and-can-reload-in-place.html: Added.
* fast/loader/resources/image1.html: Added.
* fast/loader/resources/image2.html: Added.
* platform/chromium/permissionclient/image-permissions-expected.txt:
* platform/chromium/permissionclient/image-permissions.html:
* platform/chromium/permissionclient/resources/image.html:
* platform/wk2/Skipped:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129462 268f45cc-cd09-0410-ab3c-d52691b4dbfc
32 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/fast/loader/display-image-unset-allows-cached-image-load-expected.txt [new file with mode: 0644]
LayoutTests/fast/loader/display-image-unset-allows-cached-image-load.html [new file with mode: 0644]
LayoutTests/fast/loader/display-image-unset-can-block-image-and-can-reload-in-place-expected.txt [new file with mode: 0644]
LayoutTests/fast/loader/display-image-unset-can-block-image-and-can-reload-in-place.html [new file with mode: 0644]
LayoutTests/fast/loader/images-enabled-unset-can-block-image-and-can-reload-in-place-expected.txt [new file with mode: 0644]
LayoutTests/fast/loader/images-enabled-unset-can-block-image-and-can-reload-in-place.html [new file with mode: 0644]
LayoutTests/fast/loader/resources/image1.html [new file with mode: 0644]
LayoutTests/fast/loader/resources/image2.html [new file with mode: 0644]
LayoutTests/platform/chromium/permissionclient/image-permissions-expected.txt
LayoutTests/platform/chromium/permissionclient/image-permissions.html
LayoutTests/platform/chromium/permissionclient/resources/image.html
LayoutTests/platform/wk2/Skipped
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/SubresourceLoader.cpp
Source/WebCore/loader/cache/CachedImage.cpp
Source/WebCore/loader/cache/CachedImage.h
Source/WebCore/loader/cache/CachedResource.cpp
Source/WebCore/loader/cache/CachedResource.h
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebCore/loader/cache/CachedResourceLoader.h
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/InternalSettings.h
Source/WebCore/testing/InternalSettings.idl
Source/WebKit2/ChangeLog
Source/WebKit2/win/WebKit2.def
Source/autotools/symbols.filter