| OLD | NEW |
| (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 #ifndef CONTENT_BROWSER_SSL_SSL_CERT_ERROR_HANDLER_H_ | |
| 6 #define CONTENT_BROWSER_SSL_SSL_CERT_ERROR_HANDLER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "base/memory/weak_ptr.h" | |
| 12 #include "content/browser/ssl/ssl_error_handler.h" | |
| 13 #include "net/ssl/ssl_info.h" | |
| 14 | |
| 15 namespace content { | |
| 16 | |
| 17 // A CertError represents an error that occurred with the certificate in an | |
| 18 // SSL session. A CertError object exists both on the IO thread and on the UI | |
| 19 // thread and allows us to cancel/continue a request it is associated with. | |
| 20 class SSLCertErrorHandler : public SSLErrorHandler { | |
| 21 public: | |
| 22 // Construct on the IO thread. | |
| 23 SSLCertErrorHandler(const base::WeakPtr<Delegate>& delegate, | |
| 24 ResourceType resource_type, | |
| 25 const GURL& url, | |
| 26 const net::SSLInfo& ssl_info, | |
| 27 bool fatal); | |
| 28 | |
| 29 SSLCertErrorHandler* AsSSLCertErrorHandler() override; | |
| 30 | |
| 31 // These accessors are available on either thread | |
| 32 const net::SSLInfo& ssl_info() const { return ssl_info_; } | |
| 33 int cert_error() const { return cert_error_; } | |
| 34 bool fatal() const { return fatal_; } | |
| 35 | |
| 36 protected: | |
| 37 // SSLErrorHandler methods | |
| 38 void OnDispatchFailed() override; | |
| 39 void OnDispatched() override; | |
| 40 | |
| 41 private: | |
| 42 ~SSLCertErrorHandler() override; | |
| 43 | |
| 44 // These read-only members may be accessed on any thread. | |
| 45 const net::SSLInfo ssl_info_; | |
| 46 const int cert_error_; // The error we represent. | |
| 47 const bool fatal_; // True if the error is from a host requiring | |
| 48 // certificate errors to be fatal. | |
| 49 | |
| 50 DISALLOW_COPY_AND_ASSIGN(SSLCertErrorHandler); | |
| 51 }; | |
| 52 | |
| 53 } // namespace content | |
| 54 | |
| 55 #endif // CONTENT_BROWSER_SSL_SSL_CERT_ERROR_HANDLER_H_ | |
| OLD | NEW |