summaryrefslogtreecommitdiffstats
path: root/webkit/appcache
diff options
context:
space:
mode:
authorjennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-02 01:47:43 +0000
committerjennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-02 01:47:43 +0000
commit17b4f9a87ce73e5f6d87c21c5b593cbd23f797fa (patch)
tree5d9b9569a1a758f21f9f795bb3e195436913f814 /webkit/appcache
parent7c87290fed96e7620b3702bc9435db6bc957d92c (diff)
downloadchromium_src-17b4f9a87ce73e5f6d87c21c5b593cbd23f797fa.zip
chromium_src-17b4f9a87ce73e5f6d87c21c5b593cbd23f797fa.tar.gz
chromium_src-17b4f9a87ce73e5f6d87c21c5b593cbd23f797fa.tar.bz2
Ignore URL fragment when looking up URL in application cache.
TEST=no new tests; covered by existing layout test BUG=none Review URL: http://codereview.chromium.org/459004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33532 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache')
-rw-r--r--webkit/appcache/appcache.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/webkit/appcache/appcache.cc b/webkit/appcache/appcache.cc
index 6a943c8b..38d3228 100644
--- a/webkit/appcache/appcache.cc
+++ b/webkit/appcache/appcache.cc
@@ -82,13 +82,22 @@ void AppCache::InitializeWithManifest(Manifest* manifest) {
bool AppCache::FindResponseForRequest(const GURL& url,
AppCacheEntry* found_entry, AppCacheEntry* found_fallback_entry,
GURL* found_fallback_namespace, bool* found_network_namespace) {
- AppCacheEntry* entry = GetEntry(url);
+ // Ignore fragments when looking up URL in the cache.
+ GURL url_no_ref;
+ if (url.has_ref()) {
+ GURL::Replacements replacements;
+ replacements.ClearRef();
+ url_no_ref = url.ReplaceComponents(replacements);
+ } else {
+ url_no_ref = url;
+ }
+ AppCacheEntry* entry = GetEntry(url_no_ref);
if (entry) {
*found_entry = *entry;
return true;
}
- FallbackNamespace* fallback_namespace = FindFallbackNamespace(url);
+ FallbackNamespace* fallback_namespace = FindFallbackNamespace(url_no_ref);
if (fallback_namespace) {
entry = GetEntry(fallback_namespace->second);
DCHECK(entry);
@@ -97,7 +106,7 @@ bool AppCache::FindResponseForRequest(const GURL& url,
return true;
}
- *found_network_namespace = IsInNetworkNamespace(url);
+ *found_network_namespace = IsInNetworkNamespace(url_no_ref);
return *found_network_namespace;
}