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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 1459473003: Add a WebContents getter callback in ResourceRequestInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Nasko's comment Created 5 years, 1 month 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 | « chrome/browser/chrome_content_browser_client.h ('k') | chromecast/browser/cast_content_browser_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 2956d6e5f0fa2485d8b33a215704cd59c107a27c..6ad606838d48c587c1c5023859950a63f83af59d 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1963,8 +1963,7 @@ ChromeContentBrowserClient::GetTemporaryStorageEvictionPolicy(
}
void ChromeContentBrowserClient::AllowCertificateError(
- int render_process_id,
- int render_frame_id,
+ content::WebContents* web_contents,
int cert_error,
const net::SSLInfo& ssl_info,
const GURL& request_url,
@@ -1974,6 +1973,7 @@ void ChromeContentBrowserClient::AllowCertificateError(
bool expired_previous_decision,
const base::Callback<void(bool)>& callback,
content::CertificateRequestResultType* result) {
+ DCHECK(web_contents);
if (resource_type != content::RESOURCE_TYPE_MAIN_FRAME) {
// A sub-resource has a certificate error. The user doesn't really
// have a context for making the right decision, so block the
@@ -1984,16 +1984,8 @@ void ChromeContentBrowserClient::AllowCertificateError(
}
// If the tab is being prerendered, cancel the prerender and the request.
- content::RenderFrameHost* render_frame_host =
- content::RenderFrameHost::FromID(render_process_id, render_frame_id);
- WebContents* tab = WebContents::FromRenderFrameHost(render_frame_host);
- if (!tab) {
- NOTREACHED();
- return;
- }
-
prerender::PrerenderContents* prerender_contents =
- prerender::PrerenderContents::FromWebContents(tab);
+ prerender::PrerenderContents::FromWebContents(web_contents);
if (prerender_contents) {
prerender_contents->Destroy(prerender::FINAL_STATUS_SSL_ERROR);
*result = content::CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL;
@@ -2016,8 +2008,9 @@ void ChromeContentBrowserClient::AllowCertificateError(
new SafeBrowsingSSLCertReporter(safe_browsing_service
? safe_browsing_service->ui_manager()
: nullptr));
- SSLErrorHandler::HandleSSLError(tab, cert_error, ssl_info, request_url,
- options_mask, cert_reporter.Pass(), callback);
+ SSLErrorHandler::HandleSSLError(web_contents, cert_error, ssl_info,
+ request_url, options_mask,
+ cert_reporter.Pass(), callback);
}
void ChromeContentBrowserClient::SelectClientCertificate(
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chromecast/browser/cast_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698