| Index: content/child/appcache/web_application_cache_host_impl.cc
|
| diff --git a/content/child/appcache/web_application_cache_host_impl.cc b/content/child/appcache/web_application_cache_host_impl.cc
|
| index 2088bc6ace88aa505cbb0c15535de611933d71bc..f0fb839ced3e4c0eac25dcbf4a27b399c937a319 100644
|
| --- a/content/child/appcache/web_application_cache_host_impl.cc
|
| +++ b/content/child/appcache/web_application_cache_host_impl.cc
|
| @@ -162,6 +162,21 @@ void WebApplicationCacheHostImpl::OnErrorEventRaised(
|
|
|
| void WebApplicationCacheHostImpl::willStartMainResourceRequest(
|
| WebURLRequest& request, const WebFrame* frame) {
|
| + WebApplicationCacheHostImpl* spawning_host = NULL;
|
| + if (frame) {
|
| + const WebFrame* spawning_frame = frame->parent();
|
| + if (!spawning_frame)
|
| + spawning_frame = frame->opener();
|
| + if (!spawning_frame)
|
| + spawning_frame = frame;
|
| +
|
| + spawning_host = FromFrame(spawning_frame);
|
| + }
|
| + willStartMainResourceRequest(request, spawning_host);
|
| +}
|
| +
|
| +void WebApplicationCacheHostImpl::willStartMainResourceRequest(
|
| + WebURLRequest& request, const WebApplicationCacheHost* spawning_host) {
|
| request.setAppCacheHostID(host_id_);
|
|
|
| original_main_resource_url_ = ClearUrlRef(request.url());
|
| @@ -170,18 +185,11 @@ void WebApplicationCacheHostImpl::willStartMainResourceRequest(
|
| is_get_method_ = (method == appcache::kHttpGETMethod);
|
| DCHECK(method == StringToUpperASCII(method));
|
|
|
| - if (frame) {
|
| - 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) &&
|
| - (spawning_host->status_ != appcache::UNCACHED)) {
|
| - backend_->SetSpawningHostId(host_id_, spawning_host->host_id());
|
| - }
|
| + const WebApplicationCacheHostImpl* spawning_host_impl =
|
| + static_cast<const WebApplicationCacheHostImpl*>(spawning_host);
|
| + if (spawning_host_impl && (spawning_host_impl != this) &&
|
| + (spawning_host_impl->status_ != appcache::UNCACHED)) {
|
| + backend_->SetSpawningHostId(host_id_, spawning_host_impl->host_id());
|
| }
|
| }
|
|
|
|
|