Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Unified Diff: webkit/appcache/appcache_storage_impl.cc

Issue 3529009: Fix http/tests/appcache/foreign-fallback.html (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/appcache/appcache_storage_impl.cc
===================================================================
--- webkit/appcache/appcache_storage_impl.cc (revision 64524)
+++ webkit/appcache/appcache_storage_impl.cc (working copy)
@@ -553,6 +553,7 @@
std::set<int64> cache_ids_in_use_;
AppCacheEntry entry_;
AppCacheEntry fallback_entry_;
+ GURL fallback_url_;
int64 cache_id_;
GURL manifest_url_;
};
@@ -636,7 +637,10 @@
NOTREACHED() << "A cache without a group is not expected.";
continue;
}
+ if (entry_record.flags & AppCacheEntry::FOREIGN)
+ continue;
kinuko 2010/11/02 07:47:23 do we want to check this before looking up a group
michaeln 2010/11/02 20:25:36 Yes, thank you!
cache_id_ = iter->cache_id;
+ fallback_url_ = iter->fallback_entry_url;
manifest_url_ = group_record.manifest_url;
fallback_entry_ = AppCacheEntry(
entry_record.flags, entry_record.response_id);
@@ -651,7 +655,8 @@
void AppCacheStorageImpl::FindMainResponseTask::RunCompleted() {
storage_->CheckPolicyAndCallOnMainResponseFound(
- &delegates_, url_, entry_, fallback_entry_, cache_id_, manifest_url_);
+ &delegates_, url_, entry_, fallback_url_, fallback_entry_,
+ cache_id_, manifest_url_);
}
// MarkEntryAsForeignTask -------
@@ -1047,15 +1052,17 @@
if (delegate_ref->delegate) {
DelegateReferenceVector delegates(1, delegate_ref);
CheckPolicyAndCallOnMainResponseFound(
- &delegates, url, found_entry, AppCacheEntry(),
+ &delegates, url, found_entry,
+ GURL(), AppCacheEntry(),
cache.get() ? cache->cache_id() : kNoCacheId,
group.get() ? group->manifest_url() : GURL());
}
}
void AppCacheStorageImpl::CheckPolicyAndCallOnMainResponseFound(
- DelegateReferenceVector* delegates, const GURL& url,
- const AppCacheEntry& entry, const AppCacheEntry& fallback_entry,
+ DelegateReferenceVector* delegates,
+ const GURL& url, const AppCacheEntry& entry,
+ const GURL& fallback_url, const AppCacheEntry& fallback_entry,
int64 cache_id, const GURL& manifest_url) {
if (!manifest_url.is_empty()) {
// Check the policy prior to returning a main resource from the appcache.
@@ -1063,7 +1070,8 @@
if (policy && !policy->CanLoadAppCache(manifest_url)) {
FOR_EACH_DELEGATE(
(*delegates),
- OnMainResponseFound(url, AppCacheEntry(), AppCacheEntry(),
+ OnMainResponseFound(url, AppCacheEntry(),
+ GURL(), AppCacheEntry(),
kNoCacheId, manifest_url, true));
return;
}
@@ -1071,7 +1079,8 @@
FOR_EACH_DELEGATE(
(*delegates),
- OnMainResponseFound(url, entry, fallback_entry,
+ OnMainResponseFound(url, entry,
+ fallback_url, fallback_entry,
cache_id, manifest_url, false));
}

Powered by Google App Engine
This is Rietveld 408576698