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

Unified Diff: webkit/appcache/appcache_host.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_host.cc
===================================================================
--- webkit/appcache/appcache_host.cc (revision 64524)
+++ webkit/appcache/appcache_host.cc (working copy)
@@ -39,7 +39,8 @@
frontend_(frontend), service_(service),
pending_get_status_callback_(NULL), pending_start_update_callback_(NULL),
pending_swap_cache_callback_(NULL), pending_callback_param_(NULL),
- main_resource_blocked_(false), associated_cache_info_pending_(false) {
+ main_resource_was_fallback_(false), main_resource_blocked_(false),
+ associated_cache_info_pending_(false) {
}
AppCacheHost::~AppCacheHost() {
@@ -144,8 +145,10 @@
// TODO(michaeln): change method name to MarkEntryAsForeign for consistency
void AppCacheHost::MarkAsForeignEntry(const GURL& document_url,
int64 cache_document_was_loaded_from) {
+ // The document url is not the resource url in the fallback case.
service_->storage()->MarkEntryAsForeign(
- document_url, cache_document_was_loaded_from);
+ main_resource_was_fallback_ ? fallback_url_ : document_url,
+ cache_document_was_loaded_from);
SelectCache(document_url, kNoCacheId, GURL());
}
@@ -452,6 +455,11 @@
service_->storage()->LoadCache(cache_id, this);
}
+void AppCacheHost::NotifyMainResourceFallback(const GURL& fallback_url) {
+ main_resource_was_fallback_ = true;
+ fallback_url_ = fallback_url;
+}
+
void AppCacheHost::NotifyMainResourceBlocked(const GURL& manifest_url) {
main_resource_blocked_ = true;
blocked_manifest_url_ = manifest_url;

Powered by Google App Engine
This is Rietveld 408576698