CachedResourceLoader should not need to remove fragment identifier
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Oct 2016 12:30:40 +0000 (12:30 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Oct 2016 12:30:40 +0000 (12:30 +0000)
commitbfc757efd392d2cfc90c1c19d10002cdf319d087
treee8037066933e68f8e7f9a62927d9ba7e1192ae4d
parent4503bfc8eddaafc75107f08bdfb07c4cea03b16e
CachedResourceLoader should not need to remove fragment identifier
https://bugs.webkit.org/show_bug.cgi?id=163015

Patch by Youenn Fablet <youenn@apple.com> on 2016-10-18
Reviewed by Darin Adler.

No expected change for non-window port.
For window port, CachedResourceLoader will strip the fragment identifier of the URL passed to subresourceForURL
before querying the memory cache.

Removing the fragment identifier from the request stored in CachedResourceRequest.
The fragment identifier is stored in a separate field.

This allows CachedResourceLoader to not care about fragment identifier.
CachedResource can then get access to it.

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
(WebCore::CachedResource::finishRequestInitialization): Deleted.
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::cachedResource):
Updated the method taking a const String& to strip the fragment identifier if needed.
Updated the method taking a const URL& to assert if the fragment identifier is present.
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
(WebCore::CachedResourceLoader::requestResource):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::CachedResourceRequest):
(WebCore::CachedResourceRequest::splitFragmentIdentifierFromRequestURL):
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::releaseFragmentIdentifier):
(WebCore::CachedResourceRequest::clearFragmentIdentifier):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::shouldRemoveFragmentIdentifier):
(WebCore::MemoryCache::removeFragmentIdentifierIfNeeded):
(WebCore::MemoryCache::revalidationSucceeded):
(WebCore::MemoryCache::resourceForRequest):
* loader/cache/MemoryCache.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/loader/cache/CachedResource.cpp
Source/WebCore/loader/cache/CachedResource.h
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebCore/loader/cache/CachedResourceRequest.cpp
Source/WebCore/loader/cache/CachedResourceRequest.h
Source/WebCore/loader/cache/MemoryCache.cpp
Source/WebCore/loader/cache/MemoryCache.h