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.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/webkit/appcache/web_application_cache_host_impl.cc b/webkit/appcache/web_application_cache_host_impl.cc
index 0bdc11f..981894d 100644
--- a/webkit/appcache/web_application_cache_host_impl.cc
+++ b/webkit/appcache/web_application_cache_host_impl.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -156,7 +156,7 @@ void WebApplicationCacheHostImpl::OnErrorEventRaised(
}
void WebApplicationCacheHostImpl::willStartMainResourceRequest(
- WebURLRequest& request) {
+ WebURLRequest& request, const WebFrame* frame) {
request.setAppCacheHostID(host_id_);
original_main_resource_url_ = ClearUrlRef(request.url());
@@ -164,6 +164,13 @@ void WebApplicationCacheHostImpl::willStartMainResourceRequest(
std::string method = request.httpMethod().utf8();
is_get_method_ = (method == kHttpGETMethod);
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());
+ }
}
void WebApplicationCacheHostImpl::willStartSubResourceRequest(