OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/ssl/ssl_cert_error_handler.h" | 5 #include "content/browser/ssl/ssl_cert_error_handler.h" |
6 | 6 |
7 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" | 7 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" |
8 #include "content/browser/ssl/ssl_manager.h" | 8 #include "content/browser/ssl/ssl_manager.h" |
9 #include "content/browser/ssl/ssl_policy.h" | 9 #include "content/browser/ssl/ssl_policy.h" |
10 #include "net/base/cert_status_flags.h" | 10 #include "net/base/cert_status_flags.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 ssl_info_(ssl_info), | 26 ssl_info_(ssl_info), |
27 cert_error_(net::MapCertStatusToNetError(ssl_info.cert_status)), | 27 cert_error_(net::MapCertStatusToNetError(ssl_info.cert_status)), |
28 fatal_(fatal) { | 28 fatal_(fatal) { |
29 } | 29 } |
30 | 30 |
31 SSLCertErrorHandler* SSLCertErrorHandler::AsSSLCertErrorHandler() { | 31 SSLCertErrorHandler* SSLCertErrorHandler::AsSSLCertErrorHandler() { |
32 return this; | 32 return this; |
33 } | 33 } |
34 | 34 |
35 void SSLCertErrorHandler::OnDispatchFailed() { | 35 void SSLCertErrorHandler::OnDispatchFailed() { |
36 // Requests that don't have a tab (i.e. requests from extensions) will fail | 36 // Requests can fail to dispatch because they don't have a WebContents. See |
37 // to dispatch because they don't have a TabContents. See crbug.com/86537. In | 37 // <http://crbug.com/86537>. In this case we have to make a decision in this |
38 // this case we have to make a decision in this function, so we ignore | 38 // function, so we ignore revocation check failures. |
39 // revocation check failures. | |
40 if (net::IsCertStatusMinorError(ssl_info().cert_status)) { | 39 if (net::IsCertStatusMinorError(ssl_info().cert_status)) { |
41 ContinueRequest(); | 40 ContinueRequest(); |
42 } else { | 41 } else { |
43 CancelRequest(); | 42 CancelRequest(); |
44 } | 43 } |
45 } | 44 } |
46 | 45 |
47 void SSLCertErrorHandler::OnDispatched() { | 46 void SSLCertErrorHandler::OnDispatched() { |
48 manager_->policy()->OnCertError(this); | 47 manager_->policy()->OnCertError(this); |
49 } | 48 } |
50 | 49 |
51 SSLCertErrorHandler::~SSLCertErrorHandler() {} | 50 SSLCertErrorHandler::~SSLCertErrorHandler() {} |
OLD | NEW |