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

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: . 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
« no previous file with comments | « no previous file | chrome/browser/renderer_host/safe_browsing_resource_throttle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..1bcd2067654d4fdcd33b230c5a76c706734af3cd 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;
@@ -122,19 +121,14 @@ void DataReductionProxyResourceThrottle::StartDisplayingBlockingPage(
const SafeBrowsingUIManager::UnsafeResource& resource) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- content::RenderFrameHost* rfh = content::RenderFrameHost::FromID(
- resource.render_process_host_id, resource.render_frame_id);
- if (rfh) {
- content::WebContents* web_contents =
- content::WebContents::FromRenderFrameHost(rfh);
+ content::WebContents* web_contents = resource.web_contents_getter.Run();
+ if (web_contents) {
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;
}
}
« no previous file with comments | « no previous file | chrome/browser/renderer_host/safe_browsing_resource_throttle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698