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

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

Issue 2222003002: Combine SSLCertErrorHandler and SSLErrorHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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
« no previous file with comments | « content/browser/ssl/ssl_cert_error_handler.h ('k') | content/browser/ssl/ssl_error_handler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #include "content/browser/ssl/ssl_cert_error_handler.h"
6
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"
11
12 namespace content {
13
14 SSLCertErrorHandler::SSLCertErrorHandler(
15 const base::WeakPtr<Delegate>& delegate,
16 ResourceType resource_type,
17 const GURL& url,
18 const net::SSLInfo& ssl_info,
19 bool fatal)
20 : SSLErrorHandler(delegate, resource_type, url),
21 ssl_info_(ssl_info),
22 cert_error_(net::MapCertStatusToNetError(ssl_info.cert_status)),
23 fatal_(fatal) {}
24
25 SSLCertErrorHandler* SSLCertErrorHandler::AsSSLCertErrorHandler() {
26 return this;
27 }
28
29 void SSLCertErrorHandler::OnDispatchFailed() {
30 // Requests can fail to dispatch because they don't have a WebContents. See
31 // <http://crbug.com/86537>. In this case we have to make a decision in this
32 // function, so we ignore revocation check failures.
33 if (net::IsCertStatusMinorError(ssl_info().cert_status)) {
34 ContinueRequest();
35 } else {
36 CancelRequest();
37 }
38 }
39
40 void SSLCertErrorHandler::OnDispatched() {
41 manager_->policy()->OnCertError(this);
42 }
43
44 SSLCertErrorHandler::~SSLCertErrorHandler() {}
45
46 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/ssl/ssl_cert_error_handler.h ('k') | content/browser/ssl/ssl_error_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698