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

Unified Diff: content/child/appcache/web_application_cache_host_impl.cc

Issue 161573002: Implement new willStartMainResourceRequest method of blink::WebApplicationCacheHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add no-op worker overload Created 6 years, 10 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: 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());
}
}
« no previous file with comments | « content/child/appcache/web_application_cache_host_impl.h ('k') | content/worker/worker_webapplicationcachehost_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698