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

Unified Diff: chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_android.cc

Issue 2241673002: Make UnsafeResource hold a WebContents getter instead of RenderFrame ids (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: android Created 4 years, 4 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: chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_android.cc
diff --git a/chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_android.cc b/chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_android.cc
index 907099a2b495271020d7ff9be86ae791e8d7bf20..f26dd7ba2e8a5a780c3ff3f700d04ad915b394d6 100644
--- a/chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_android.cc
+++ b/chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_android.cc
@@ -98,8 +98,7 @@ void DataReductionProxyResourceThrottle::WillRedirectRequest(
unsafe_resource.callback_thread =
content::BrowserThread::GetTaskRunnerForThread(
content::BrowserThread::IO);
- unsafe_resource.render_process_host_id = info->GetChildID();
- unsafe_resource.render_frame_id = info->GetRenderFrameID();
+ unsafe_resource.web_contents_getter = info->GetWebContentsGetterForRequest();
unsafe_resource.threat_source = safe_browsing::ThreatSource::DATA_SAVER;
*defer = true;
@@ -108,7 +107,8 @@ void DataReductionProxyResourceThrottle::WillRedirectRequest(
content::BrowserThread::UI, FROM_HERE,
base::Bind(
&DataReductionProxyResourceThrottle::StartDisplayingBlockingPage,
- AsWeakPtr(), safe_browsing_->ui_manager(), unsafe_resource));
+ AsWeakPtr(), safe_browsing_->ui_manager(), unsafe_resource,
+ info->GetChildID(), info->GetRenderFrameID()));
}
const char* DataReductionProxyResourceThrottle::GetNameForLogging() const {
@@ -119,22 +119,21 @@ const char* DataReductionProxyResourceThrottle::GetNameForLogging() const {
void DataReductionProxyResourceThrottle::StartDisplayingBlockingPage(
const base::WeakPtr<DataReductionProxyResourceThrottle>& throttle,
scoped_refptr<SafeBrowsingUIManager> ui_manager,
- const SafeBrowsingUIManager::UnsafeResource& resource) {
+ const SafeBrowsingUIManager::UnsafeResource& resource,
+ int child_id,
+ int render_frame_id) {
jam 2016/08/15 19:49:10 ditto
scottmg 2016/08/15 19:57:18 Done.
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- content::RenderFrameHost* rfh = content::RenderFrameHost::FromID(
- resource.render_process_host_id, resource.render_frame_id);
+ content::RenderFrameHost* rfh =
+ content::RenderFrameHost::FromID(child_id, render_frame_id);
if (rfh) {
- content::WebContents* web_contents =
- content::WebContents::FromRenderFrameHost(rfh);
+ content::WebContents* web_contents = resource.web_contents_getter.Run();
prerender::PrerenderContents* prerender_contents =
prerender::PrerenderContents::FromWebContents(web_contents);
if (prerender_contents) {
prerender_contents->Destroy(prerender::FINAL_STATUS_SAFE_BROWSING);
- content::BrowserThread::PostTask(
- content::BrowserThread::IO,
- FROM_HERE,
- base::Bind(resource.callback, false));
+ content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
+ base::Bind(resource.callback, false));
return;
}
}

Powered by Google App Engine
This is Rietveld 408576698