Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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.h" | 7 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 8 #include "content/browser/ssl/ssl_policy.h" | 8 #include "content/browser/ssl/ssl_policy.h" |
| 9 #include "net/base/x509_certificate.h" | 9 #include "net/base/x509_certificate.h" |
| 10 | 10 |
| 11 SSLCertErrorHandler::SSLCertErrorHandler( | 11 SSLCertErrorHandler::SSLCertErrorHandler( |
| 12 ResourceDispatcherHost* rdh, | 12 ResourceDispatcherHost* rdh, |
| 13 net::URLRequest* request, | 13 net::URLRequest* request, |
| 14 ResourceType::Type resource_type, | 14 ResourceType::Type resource_type, |
| 15 int cert_error, | 15 int cert_error, |
| 16 net::X509Certificate* cert) | 16 const net::SSLInfo& ssl_info, |
| 17 bool must_be_fatal) | |
| 17 : SSLErrorHandler(rdh, request, resource_type), | 18 : SSLErrorHandler(rdh, request, resource_type), |
| 18 cert_error_(cert_error) { | 19 ssl_info_(ssl_info), |
| 20 cert_error_(cert_error), | |
| 21 must_be_fatal_(must_be_fatal) { | |
| 19 DCHECK(request == resource_dispatcher_host_->GetURLRequest(request_id_)); | 22 DCHECK(request == resource_dispatcher_host_->GetURLRequest(request_id_)); |
| 20 | |
| 21 // We cannot use the request->ssl_info(), it's not been initialized yet, so | |
| 22 // we have to set the fields manually. | |
| 23 ssl_info_.cert = cert; | |
| 24 ssl_info_.SetCertError(cert_error); | |
|
wtc
2011/09/23 00:04:51
This is interesting -- so in the original code, ss
agl
2011/09/23 18:45:38
ssl_info.security_bits has the value that you woul
wtc
2011/09/26 19:18:48
That should be fine. Could be considered an impro
| |
| 25 } | 23 } |
| 26 | 24 |
| 27 SSLCertErrorHandler* SSLCertErrorHandler::AsSSLCertErrorHandler() { | 25 SSLCertErrorHandler* SSLCertErrorHandler::AsSSLCertErrorHandler() { |
| 28 return this; | 26 return this; |
| 29 } | 27 } |
| 30 | 28 |
| 31 void SSLCertErrorHandler::OnDispatchFailed() { | 29 void SSLCertErrorHandler::OnDispatchFailed() { |
| 32 CancelRequest(); | 30 CancelRequest(); |
| 33 } | 31 } |
| 34 | 32 |
| 35 void SSLCertErrorHandler::OnDispatched() { | 33 void SSLCertErrorHandler::OnDispatched() { |
| 36 manager_->policy()->OnCertError(this); | 34 manager_->policy()->OnCertError(this); |
| 37 } | 35 } |
| 38 | 36 |
| 39 SSLCertErrorHandler::~SSLCertErrorHandler() {} | 37 SSLCertErrorHandler::~SSLCertErrorHandler() {} |
| OLD | NEW |