summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/mock_appcache_storage.cc
diff options
context:
space:
mode:
authormichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-03 02:29:14 +0000
committermichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-03 02:29:14 +0000
commit6ed2a5a54b7bb8ccd33da7bc948fee169f128459 (patch)
tree3752c15899760eef346dc2c1f66768aa2f3e676a /webkit/appcache/mock_appcache_storage.cc
parentd6bb669008e0308f3ee6e04e77fe903698864e7b (diff)
downloadchromium_src-6ed2a5a54b7bb8ccd33da7bc948fee169f128459.zip
chromium_src-6ed2a5a54b7bb8ccd33da7bc948fee169f128459.tar.gz
chromium_src-6ed2a5a54b7bb8ccd33da7bc948fee169f128459.tar.bz2
Fix for WKBug 47000: a failure mode given bad content (in an unlikely form). The error occurs when an html page is put in an appcache as a fallback resource (so it's listed in a fallback section), but it contains a manifest attribute that refers to a different manifest file. The system should mark the resource as foreign and exclude it from main resource loads, but it was failing to do so. The fix is to do that.
BUG=WK47000 TEST=http/tests/appcache/foreign-fallback.html Review URL: http://codereview.chromium.org/3529009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64868 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/mock_appcache_storage.cc')
-rw-r--r--webkit/appcache/mock_appcache_storage.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/webkit/appcache/mock_appcache_storage.cc b/webkit/appcache/mock_appcache_storage.cc
index 13ae899..7cd3842 100644
--- a/webkit/appcache/mock_appcache_storage.cc
+++ b/webkit/appcache/mock_appcache_storage.cc
@@ -212,6 +212,7 @@ void MockAppCacheStorage::ProcessStoreGroupAndNewestCache(
namespace {
struct FoundCandidate {
+ GURL url;
AppCacheEntry entry;
int64 cache_id;
GURL manifest_url;
@@ -228,7 +229,8 @@ void MockAppCacheStorage::ProcessFindResponseForMainRequest(
simulate_find_main_resource_ = false;
if (delegate_ref->delegate) {
delegate_ref->delegate->OnMainResponseFound(
- url, simulated_found_entry_, simulated_found_fallback_entry_,
+ url, simulated_found_entry_,
+ simulated_found_fallback_url_, simulated_found_fallback_entry_,
simulated_found_cache_id_, simulated_found_manifest_url_, false);
}
return;
@@ -283,6 +285,7 @@ void MockAppCacheStorage::ProcessFindResponseForMainRequest(
bool is_in_use = IsCacheStored(cache) && !cache->HasOneRef();
if (found_entry.has_response_id()) {
+ found_candidate.url = url;
found_candidate.entry = found_entry;
found_candidate.cache_id = cache->cache_id();
found_candidate.manifest_url = group->manifest_url();
@@ -313,6 +316,8 @@ void MockAppCacheStorage::ProcessFindResponseForMainRequest(
}
if (take_new_candidate) {
+ found_fallback_candidate.url =
+ cache->GetFallbackEntryUrl(found_fallback_namespace);
found_fallback_candidate.entry = found_fallback_entry;
found_fallback_candidate.cache_id = cache->cache_id();
found_fallback_candidate.manifest_url = group->manifest_url();
@@ -325,7 +330,7 @@ void MockAppCacheStorage::ProcessFindResponseForMainRequest(
// Found a direct hit.
if (found_candidate.entry.has_response_id()) {
delegate_ref->delegate->OnMainResponseFound(
- url, found_candidate.entry, AppCacheEntry(),
+ url, found_candidate.entry, GURL(), AppCacheEntry(),
found_candidate.cache_id, found_candidate.manifest_url, false);
return;
}
@@ -333,7 +338,9 @@ void MockAppCacheStorage::ProcessFindResponseForMainRequest(
// Found a fallback namespace.
if (found_fallback_candidate.entry.has_response_id()) {
delegate_ref->delegate->OnMainResponseFound(
- url, AppCacheEntry(), found_fallback_candidate.entry,
+ url, AppCacheEntry(),
+ found_fallback_candidate.url,
+ found_fallback_candidate.entry,
found_fallback_candidate.cache_id,
found_fallback_candidate.manifest_url, false);
return;
@@ -341,7 +348,7 @@ void MockAppCacheStorage::ProcessFindResponseForMainRequest(
// Didn't find anything.
delegate_ref->delegate->OnMainResponseFound(
- url, AppCacheEntry(), AppCacheEntry(), kNoCacheId, GURL(), false);
+ url, AppCacheEntry(), GURL(), AppCacheEntry(), kNoCacheId, GURL(), false);
}
void MockAppCacheStorage::ProcessMakeGroupObsolete(