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

Unified Diff: chromecast/browser/cast_content_browser_client.cc

Issue 859213006: Cancel client auth requests when not promptable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@client-auth-cancel-1
Patch Set: worker_common.js was missing a license header (also a rebase) Created 5 years, 9 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 | « chromecast/browser/cast_content_browser_client.h ('k') | content/browser/loader/resource_loader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/browser/cast_content_browser_client.cc
diff --git a/chromecast/browser/cast_content_browser_client.cc b/chromecast/browser/cast_content_browser_client.cc
index 56a825022cfe7c55aeac3e9045bc78af0e5cc41c..9793e68b6f0885a7d5025d6f78afd7a83e6cbe08 100644
--- a/chromecast/browser/cast_content_browser_client.cc
+++ b/chromecast/browser/cast_content_browser_client.cc
@@ -29,6 +29,7 @@
#include "components/network_hints/browser/network_hints_message_filter.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/certificate_request_result_type.h"
+#include "content/public/browser/client_certificate_delegate.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/resource_dispatcher_host.h"
#include "content/public/common/content_descriptors.h"
@@ -194,16 +195,15 @@ void CastContentBrowserClient::AllowCertificateError(
}
void CastContentBrowserClient::SelectClientCertificate(
- int render_process_id,
- int render_view_id,
+ WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
- const base::Callback<void(net::X509Certificate*)>& callback) {
+ scoped_ptr<content::ClientCertificateDelegate> delegate) {
GURL requesting_url("https://" + cert_request_info->host_and_port.ToString());
if (!requesting_url.is_valid()) {
LOG(ERROR) << "Invalid URL string: "
<< requesting_url.possibly_invalid_spec();
- callback.Run(NULL);
+ delegate->SelectClientCertificate(nullptr);
return;
}
@@ -214,16 +214,16 @@ void CastContentBrowserClient::SelectClientCertificate(
// it, because CastNetworkDelegate is bound to the IO thread.
// Subsequently, the callback must then itself be performed back here
// on the UI thread.
+ //
+ // TODO(davidben): Stop using child ID to identify an app.
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
content::BrowserThread::PostTaskAndReplyWithResult(
- content::BrowserThread::IO,
- FROM_HERE,
- base::Bind(
- &CastContentBrowserClient::SelectClientCertificateOnIOThread,
- base::Unretained(this),
- requesting_url,
- render_process_id),
- callback);
+ content::BrowserThread::IO, FROM_HERE,
+ base::Bind(&CastContentBrowserClient::SelectClientCertificateOnIOThread,
+ base::Unretained(this), requesting_url,
+ web_contents->GetRenderProcessHost()->GetID()),
+ base::Bind(&content::ClientCertificateDelegate::ContinueWithCertificate,
+ delegate.Pass()));
}
net::X509Certificate*
« no previous file with comments | « chromecast/browser/cast_content_browser_client.h ('k') | content/browser/loader/resource_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698