| 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, | |
| 405 std::unique_ptr<content::ClientCertificateDelegate> delegate) { | 404 std::unique_ptr<content::ClientCertificateDelegate> delegate) { |
| 406 GURL requesting_url("https://" + cert_request_info->host_and_port.ToString()); | 405 GURL requesting_url("https://" + cert_request_info->host_and_port.ToString()); |
| 407 | 406 |
| 408 if (!requesting_url.is_valid()) { | 407 if (!requesting_url.is_valid()) { |
| 409 LOG(ERROR) << "Invalid URL string: " | 408 LOG(ERROR) << "Invalid URL string: " |
| 410 << requesting_url.possibly_invalid_spec(); | 409 << requesting_url.possibly_invalid_spec(); |
| 411 delegate->ContinueWithCertificate(nullptr); | 410 delegate->ContinueWithCertificate(nullptr); |
| 412 return; | 411 return; |
| 413 } | 412 } |
| 414 | 413 |
| 415 // In our case there are no relevant certs in |client_certs|. The cert | 414 // In our case there are no relevant certs in the cert_request_info. The cert |
| 416 // we need to return (if permitted) is the Cast device cert, which we can | 415 // we need to return (if permitted) is the Cast device cert, which we can |
| 417 // access directly through the ClientAuthSigner instance. However, we need to | 416 // access directly through the ClientAuthSigner instance. However, we need to |
| 418 // be on the IO thread to determine whether the app is whitelisted to return | 417 // be on the IO thread to determine whether the app is whitelisted to return |
| 419 // it, because CastNetworkDelegate is bound to the IO thread. | 418 // it, because CastNetworkDelegate is bound to the IO thread. |
| 420 // Subsequently, the callback must then itself be performed back here | 419 // Subsequently, the callback must then itself be performed back here |
| 421 // on the UI thread. | 420 // on the UI thread. |
| 422 // | 421 // |
| 423 // TODO(davidben): Stop using child ID to identify an app. | 422 // TODO(davidben): Stop using child ID to identify an app. |
| 424 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 423 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 425 content::BrowserThread::PostTaskAndReplyWithResult( | 424 content::BrowserThread::PostTaskAndReplyWithResult( |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 process_type, dumps_path, false /* upload */); | 566 process_type, dumps_path, false /* upload */); |
| 568 // StartUploaderThread() even though upload is diferred. | 567 // StartUploaderThread() even though upload is diferred. |
| 569 // Breakpad-related memory is freed in the uploader thread. | 568 // Breakpad-related memory is freed in the uploader thread. |
| 570 crash_handler->StartUploaderThread(); | 569 crash_handler->StartUploaderThread(); |
| 571 return crash_handler; | 570 return crash_handler; |
| 572 } | 571 } |
| 573 #endif // !defined(OS_ANDROID) | 572 #endif // !defined(OS_ANDROID) |
| 574 | 573 |
| 575 } // namespace shell | 574 } // namespace shell |
| 576 } // namespace chromecast | 575 } // namespace chromecast |
| OLD | NEW |