summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/web_application_cache_host_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/appcache/web_application_cache_host_impl.cc')
-rw-r--r--webkit/appcache/web_application_cache_host_impl.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/webkit/appcache/web_application_cache_host_impl.cc b/webkit/appcache/web_application_cache_host_impl.cc
index 981894d..4fbcc21 100644
--- a/webkit/appcache/web_application_cache_host_impl.cc
+++ b/webkit/appcache/web_application_cache_host_impl.cc
@@ -53,7 +53,7 @@ WebApplicationCacheHostImpl* WebApplicationCacheHostImpl::FromId(int id) {
}
WebApplicationCacheHostImpl* WebApplicationCacheHostImpl::FromFrame(
- WebFrame* frame) {
+ const WebFrame* frame) {
if (!frame)
return NULL;
WebDataSource* data_source = frame->dataSource();
@@ -166,10 +166,15 @@ void WebApplicationCacheHostImpl::willStartMainResourceRequest(
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());
}
}