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

Side by Side Diff: content/browser/ssl/ssl_cert_error_handler.cc

Issue 7976036: net: make HSTS hosts use the normal SSL interstitials (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "net/base/cert_status_flags.h"
wtc 2011/09/26 19:15:10 List this header before "net/base/x509_certificate
7 #include "content/browser/renderer_host/resource_dispatcher_host.h" 8 #include "content/browser/renderer_host/resource_dispatcher_host.h"
8 #include "content/browser/ssl/ssl_policy.h" 9 #include "content/browser/ssl/ssl_policy.h"
9 #include "net/base/x509_certificate.h" 10 #include "net/base/x509_certificate.h"
10 11
11 SSLCertErrorHandler::SSLCertErrorHandler( 12 SSLCertErrorHandler::SSLCertErrorHandler(
12 ResourceDispatcherHost* rdh, 13 ResourceDispatcherHost* rdh,
13 net::URLRequest* request, 14 net::URLRequest* request,
14 ResourceType::Type resource_type, 15 ResourceType::Type resource_type,
15 int cert_error, 16 const net::SSLInfo& ssl_info,
16 net::X509Certificate* cert) 17 bool is_hsts_host)
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_(net::MapCertStatusToNetError(ssl_info.cert_status)),
21 is_hsts_host_(is_hsts_host) {
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);
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() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698