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
3 // found in the LICENSE file.
5 #include "content/browser/ssl/ssl_cert_error_handler.h"
7 #include "content/browser/ssl/ssl_manager.h"
8 #include "content/browser/ssl/ssl_policy.h"
9 #include "net/cert/cert_status_flags.h"
10 #include "net/cert/x509_certificate.h"
14 SSLCertErrorHandler::SSLCertErrorHandler(
15 const base::WeakPtr
<Delegate
>& delegate
,
16 ResourceType resource_type
,
18 int render_process_id
,
20 const net::SSLInfo
& ssl_info
,
22 : SSLErrorHandler(delegate
,
28 cert_error_(net::MapCertStatusToNetError(ssl_info
.cert_status
)),
32 SSLCertErrorHandler
* SSLCertErrorHandler::AsSSLCertErrorHandler() {
36 void SSLCertErrorHandler::OnDispatchFailed() {
37 // Requests can fail to dispatch because they don't have a WebContents. See
38 // <http://crbug.com/86537>. In this case we have to make a decision in this
39 // function, so we ignore revocation check failures.
40 if (net::IsCertStatusMinorError(ssl_info().cert_status
)) {
47 void SSLCertErrorHandler::OnDispatched() {
48 manager_
->policy()->OnCertError(this);
51 SSLCertErrorHandler::~SSLCertErrorHandler() {}
53 } // namespace content