Skip to content
  • japhet@chromium.org's avatar
    .: Enable reuse of cached main resources · 3e317182
    japhet@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=105667
    
    Reviewed by Adam Barth.
    
    * Source/autotools/symbols.filter: Expose MemoryCache::resourceForURL().
    
    Source/WebCore: Enable reuse of cached main resources
    https://bugs.webkit.org/show_bug.cgi?id=105667
    
    Reviewed by Adam Barth.
    
    Test: http/tests/cache/cached-main-resource.html
    
    * WebCore.exp.in:
    * dom/Document.cpp:
    (WebCore::Document::hasManifest): Returns true if the <html> element has a non-empty manifest attribute.
    (WebCore):
    * dom/Document.h:
    (Document):
    * loader/FrameLoader.cpp:
    (WebCore::FrameLoader::loadedResourceFromMemoryCache): Don't send delegate callbacks for cache hit here, since
        MainResourceLoader will take care of it.
    * loader/MainResourceLoader.cpp:
    (WebCore::MainResourceLoader::MainResourceLoader):
    (WebCore::MainResourceLoader::receivedError):
    (WebCore::MainResourceLoader::willSendRequest):
    (WebCore::MainResourceLoader::responseReceived): Don't try to cache loads from the application cache.
    (WebCore::MainResourceLoader::didFinishLoading): Don't try to cache loads from the application cache.
    (WebCore::MainResourceLoader::load): Ensure we create a resource load identifier for cache hits. Also,
        ensure we correctly popualate fragment identifiers in the ResourceRequest reported to DocumentLoader.
    (WebCore::MainResourceLoader::identifier):
    * loader/MainResourceLoader.h: Rename m_substituteDataLoadIdentifier to m_identifierForLoadWithoutResourceLoader
        to better describe when it is used.
    * loader/cache/CachedRawResource.cpp:
    (WebCore::CachedRawResource::didAddClient): Synthesize redirect notifications for cache hits if necessary.
    (WebCore::CachedRawResource::willSendRequest): Note the redirects we received.
    (WebCore::CachedRawResource::canReuse): Don't reuse a resource if the redirect chain included a "Cache-control: no-store".
    * loader/cache/CachedRawResource.h:
    (CachedRawResource):
    (RedirectPair):
    (WebCore::CachedRawResource::RedirectPair::RedirectPair):
    * loader/cache/CachedResource.cpp:
    (WebCore::CachedResource::addClientToSet): Don't return cached data for a main resource synchronously
    * loader/cache/CachedResource.h:
    (WebCore::CachedResource::canReuse):
    (CachedResource):
    * loader/cache/CachedResourceLoader.cpp:
    (WebCore::CachedResourceLoader::requestResource): Leave cahce reuse of main resources off for chromium for now.
    (WebCore::CachedResourceLoader::determineRevalidationPolicy): Permit cache reuse for main resources.
    * testing/Internals.cpp:
    (WebCore::Internals::isPreloaded):
    (WebCore):
    (WebCore::Internals::isLoadingFromMemoryCache):
    * testing/Internals.h:
    (Internals):
    * testing/Internals.idl:
    
    Source/WebKit/win: Enable reuse of cached main resources
    https://bugs.webkit.org/show_bug.cgi?id=105667
    
    Reviewed by Adam Barth.
    
    * WebKit.vcproj/WebKitExports.def.in: Expose some MemoryCache symbols for use in Internals.
    
    LayoutTests: Enable reuse of cached main resources
    https://bugs.webkit.org/show_bug.cgi?id=105667.
    
    Reviewed by Adam Barth.
    
    * http/tests/cache/cached-main-resource-expected.txt: Added.
    * http/tests/cache/cached-main-resource.html: Added.
    * http/tests/cache/resources/cacheable-iframe.php: Added.
    * http/tests/inspector/resource-har-pages-expected.txt:
    * http/tests/loading/redirect-methods-expected.txt:
    * http/tests/misc/favicon-loads-with-images-disabled-expected.txt:
    * http/tests/misc/link-rel-icon-beforeload-expected.txt:
    * platform/chromium/TestExpectations:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141136 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    3e317182