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

Unified Diff: webkit/appcache/appcache_request_handler.cc

Issue 6727006: Select a more appropiate appcache based on the opener or the parent of the new document. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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_request_handler.cc
===================================================================
--- webkit/appcache/appcache_request_handler.cc (revision 81647)
+++ webkit/appcache/appcache_request_handler.cc (working copy)
@@ -188,11 +188,19 @@
void AppCacheRequestHandler::MaybeLoadMainResource(net::URLRequest* request) {
DCHECK(!job_);
+ DCHECK(host_);
+ const AppCacheHost* spawning_host =
+ ResourceType::IsSharedWorker(resource_type_) ?
+ host_ : host_->GetSpawningHost();
+ GURL preferred_manifest_url = spawning_host ?
+ spawning_host->preferred_manifest_url() : GURL();
+
// We may have to wait for our storage query to complete, but
// this query can also complete syncrhonously.
job_ = new AppCacheURLRequestJob(request, storage());
- storage()->FindResponseForMainRequest(request->url(), this);
+ storage()->FindResponseForMainRequest(
+ request->url(), preferred_manifest_url, this);
}
void AppCacheRequestHandler::OnMainResponseFound(
@@ -216,6 +224,7 @@
// in advance of subresource loads happening, secondly to prevent the
// AppCache from falling out of the working set on frame navigations.
host_->LoadMainResourceCache(cache_id);
+ host_->set_preferred_manifest_url(manifest_url);
}
} else {
DCHECK(ResourceType::IsSharedWorker(resource_type_));

Powered by Google App Engine
This is Rietveld 408576698