• commit-queue@webkit.org's avatar
    Reland "Add in-place reload behavior to ImagesEnabled setting" with optimizations · 2a1dff26
    commit-queue@webkit.org authored
    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: http://svn.webkit.org/repository/webkit/trunk@129388 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    2a1dff26
ChangeLog 4.16 MB
The source could not be displayed because it is larger than 1 MB. You can load it anyway or download it instead.