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

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

Issue 9406001: Factor out ResourceDispatcherHost dependent code around SSLManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ready for review Created 8 years, 10 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) 2011 The Chromium Authors. All rights reserved. 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 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 #ifndef CONTENT_BROWSER_SSL_SSL_CERT_ERROR_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_SSL_SSL_CERT_ERROR_HANDLER_H_
6 #define CONTENT_BROWSER_SSL_SSL_CERT_ERROR_HANDLER_H_ 6 #define CONTENT_BROWSER_SSL_SSL_CERT_ERROR_HANDLER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "content/browser/ssl/ssl_error_handler.h" 11 #include "content/browser/ssl/ssl_error_handler.h"
12 #include "net/base/ssl_info.h" 12 #include "net/base/ssl_info.h"
13 13
14 // A CertError represents an error that occurred with the certificate in an 14 // A CertError represents an error that occurred with the certificate in an
15 // SSL session. A CertError object exists both on the IO thread and on the UI 15 // SSL session. A CertError object exists both on the IO thread and on the UI
16 // thread and allows us to cancel/continue a request it is associated with. 16 // thread and allows us to cancel/continue a request it is associated with.
17 class SSLCertErrorHandler : public SSLErrorHandler { 17 class SSLCertErrorHandler : public SSLErrorHandler {
18 public: 18 public:
19 // Construct on the IO thread. 19 // Construct on the IO thread.
20 SSLCertErrorHandler(ResourceDispatcherHost* rdh, 20 SSLCertErrorHandler(Delegate* delegate,
21 net::URLRequest* request, 21 instance_id id,
22 ResourceType::Type resource_type,
23 const net::SSLInfo& ssl_info, 22 const net::SSLInfo& ssl_info,
24 bool fatal); 23 bool fatal);
25 24
26 virtual SSLCertErrorHandler* AsSSLCertErrorHandler() OVERRIDE; 25 virtual SSLCertErrorHandler* AsSSLCertErrorHandler() OVERRIDE;
27 26
28 // These accessors are available on either thread 27 // These accessors are available on either thread
29 const net::SSLInfo& ssl_info() const { return ssl_info_; } 28 const net::SSLInfo& ssl_info() const { return ssl_info_; }
30 int cert_error() const { return cert_error_; } 29 int cert_error() const { return cert_error_; }
31 bool fatal() const { return fatal_; } 30 bool fatal() const { return fatal_; }
32 31
33 protected: 32 protected:
34 // SSLErrorHandler methods 33 // SSLErrorHandler methods
35 virtual void OnDispatchFailed() OVERRIDE; 34 virtual void OnDispatchFailed() OVERRIDE;
36 virtual void OnDispatched() OVERRIDE; 35 virtual void OnDispatched() OVERRIDE;
37 36
38 private: 37 private:
39 virtual ~SSLCertErrorHandler(); 38 virtual ~SSLCertErrorHandler();
40 39
41 // These read-only members may be accessed on any thread. 40 // These read-only members may be accessed on any thread.
42 const net::SSLInfo ssl_info_; 41 const net::SSLInfo ssl_info_;
43 const int cert_error_; // The error we represent. 42 const int cert_error_; // The error we represent.
44 const bool fatal_; // True if the error is from a host requiring 43 const bool fatal_; // True if the error is from a host requiring
45 // certificate errors to be fatal. 44 // certificate errors to be fatal.
46 45
47 DISALLOW_COPY_AND_ASSIGN(SSLCertErrorHandler); 46 DISALLOW_COPY_AND_ASSIGN(SSLCertErrorHandler);
48 }; 47 };
49 48
50 #endif // CONTENT_BROWSER_SSL_SSL_CERT_ERROR_HANDLER_H_ 49 #endif // CONTENT_BROWSER_SSL_SSL_CERT_ERROR_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698