OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chromecast/browser/cast_content_browser_client.h" | 5 #include "chromecast/browser/cast_content_browser_client.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 // Otherwise, any fatal certificate errors will cause an abort. | 394 // Otherwise, any fatal certificate errors will cause an abort. |
395 if (!callback.is_null()) { | 395 if (!callback.is_null()) { |
396 callback.Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL); | 396 callback.Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL); |
397 } | 397 } |
398 return; | 398 return; |
399 } | 399 } |
400 | 400 |
401 void CastContentBrowserClient::SelectClientCertificate( | 401 void CastContentBrowserClient::SelectClientCertificate( |
402 content::WebContents* web_contents, | 402 content::WebContents* web_contents, |
403 net::SSLCertRequestInfo* cert_request_info, | 403 net::SSLCertRequestInfo* cert_request_info, |
| 404 net::CertificateList client_certs, |
404 std::unique_ptr<content::ClientCertificateDelegate> delegate) { | 405 std::unique_ptr<content::ClientCertificateDelegate> delegate) { |
405 GURL requesting_url("https://" + cert_request_info->host_and_port.ToString()); | 406 GURL requesting_url("https://" + cert_request_info->host_and_port.ToString()); |
406 | 407 |
407 if (!requesting_url.is_valid()) { | 408 if (!requesting_url.is_valid()) { |
408 LOG(ERROR) << "Invalid URL string: " | 409 LOG(ERROR) << "Invalid URL string: " |
409 << requesting_url.possibly_invalid_spec(); | 410 << requesting_url.possibly_invalid_spec(); |
410 delegate->ContinueWithCertificate(nullptr); | 411 delegate->ContinueWithCertificate(nullptr); |
411 return; | 412 return; |
412 } | 413 } |
413 | 414 |
414 // In our case there are no relevant certs in the cert_request_info. The cert | 415 // In our case there are no relevant certs in |client_certs|. The cert |
415 // we need to return (if permitted) is the Cast device cert, which we can | 416 // we need to return (if permitted) is the Cast device cert, which we can |
416 // access directly through the ClientAuthSigner instance. However, we need to | 417 // access directly through the ClientAuthSigner instance. However, we need to |
417 // be on the IO thread to determine whether the app is whitelisted to return | 418 // be on the IO thread to determine whether the app is whitelisted to return |
418 // it, because CastNetworkDelegate is bound to the IO thread. | 419 // it, because CastNetworkDelegate is bound to the IO thread. |
419 // Subsequently, the callback must then itself be performed back here | 420 // Subsequently, the callback must then itself be performed back here |
420 // on the UI thread. | 421 // on the UI thread. |
421 // | 422 // |
422 // TODO(davidben): Stop using child ID to identify an app. | 423 // TODO(davidben): Stop using child ID to identify an app. |
423 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 424 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
424 content::BrowserThread::PostTaskAndReplyWithResult( | 425 content::BrowserThread::PostTaskAndReplyWithResult( |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 process_type, dumps_path, false /* upload */); | 567 process_type, dumps_path, false /* upload */); |
567 // StartUploaderThread() even though upload is diferred. | 568 // StartUploaderThread() even though upload is diferred. |
568 // Breakpad-related memory is freed in the uploader thread. | 569 // Breakpad-related memory is freed in the uploader thread. |
569 crash_handler->StartUploaderThread(); | 570 crash_handler->StartUploaderThread(); |
570 return crash_handler; | 571 return crash_handler; |
571 } | 572 } |
572 #endif // !defined(OS_ANDROID) | 573 #endif // !defined(OS_ANDROID) |
573 | 574 |
574 } // namespace shell | 575 } // namespace shell |
575 } // namespace chromecast | 576 } // namespace chromecast |
OLD | NEW |