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

Unified Diff: webkit/appcache/web_application_cache_host_impl.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/web_application_cache_host_impl.cc
===================================================================
--- webkit/appcache/web_application_cache_host_impl.cc (revision 81647)
+++ webkit/appcache/web_application_cache_host_impl.cc (working copy)
@@ -53,7 +53,7 @@
}
WebApplicationCacheHostImpl* WebApplicationCacheHostImpl::FromFrame(
- WebFrame* frame) {
+ const WebFrame* frame) {
if (!frame)
return NULL;
WebDataSource* data_source = frame->dataSource();
@@ -166,10 +166,15 @@
DCHECK(method == StringToUpperASCII(method));
if (frame) {
- if (WebApplicationCacheHostImpl* parent = FromFrame(frame->parent()))
- backend_->SetSpawningHostId(host_id_, parent->host_id());
- else if (WebApplicationCacheHostImpl* opener = FromFrame(frame->opener()))
- backend_->SetSpawningHostId(host_id_, opener->host_id());
+ const WebFrame* spawning_frame = frame->parent();
+ if (!spawning_frame)
+ spawning_frame = frame->opener();
+ if (!spawning_frame)
+ spawning_frame = frame;
+
+ WebApplicationCacheHostImpl* spawning_host = FromFrame(spawning_frame);
+ if (spawning_host && (spawning_host != this))
+ backend_->SetSpawningHostId(host_id_, spawning_host->host_id());
}
}
« webkit/appcache/appcache_host.h ('K') | « webkit/appcache/web_application_cache_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698