diff options
author | toyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-13 02:24:34 +0000 |
---|---|---|
committer | toyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-13 02:24:34 +0000 |
commit | 043cc11910894f4bb2ae1c013d498964c6b84427 (patch) | |
tree | 9319203cad07b9a812a119a573fb775ac7c75631 /content/browser/ssl/ssl_error_handler.h | |
parent | 97f78dd293f231630da59645af0c561efb2e5364 (diff) | |
download | chromium_src-043cc11910894f4bb2ae1c013d498964c6b84427.zip chromium_src-043cc11910894f4bb2ae1c013d498964c6b84427.tar.gz chromium_src-043cc11910894f4bb2ae1c013d498964c6b84427.tar.bz2 |
Factor out ResourceDispatcherHost dependent code around SSLManager
Because SSLManager must work with not only ResourceDispatcherHost.
BUG=53836
TEST=existing tests will cover this refactoring
Review URL: http://codereview.chromium.org/9406001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126310 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/ssl/ssl_error_handler.h')
-rw-r--r-- | content/browser/ssl/ssl_error_handler.h | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/content/browser/ssl/ssl_error_handler.h b/content/browser/ssl/ssl_error_handler.h index eadf89b..15832df 100644 --- a/content/browser/ssl/ssl_error_handler.h +++ b/content/browser/ssl/ssl_error_handler.h @@ -10,19 +10,20 @@ #include "base/basictypes.h" #include "base/memory/ref_counted.h" -#include "content/browser/ssl/ssl_manager.h" #include "content/common/content_export.h" #include "content/public/browser/global_request_id.h" #include "googleurl/src/gurl.h" #include "webkit/glue/resource_type.h" class SSLCertErrorHandler; +class SSLManager; namespace content { class ResourceDispatcherHostImpl; } namespace net { +class SSLInfo; class URLRequest; } // namespace net @@ -42,6 +43,24 @@ class URLRequest; // class SSLErrorHandler : public base::RefCountedThreadSafe<SSLErrorHandler> { public: + // Delegate functions must be called from IO thread. All functions accept + // |id| as the first argument. |id| is a copy of the second argument of + // SSLManager::OnSSLCertificateError() and represents the request. + // Finally, CancelSSLRequest() or ContinueSSLRequest() will be called after + // SSLErrorHandler makes a decision on the SSL error. + class Delegate { + public: + // Called when SSLErrorHandler decides to cancel the request because of + // the SSL error. + virtual void CancelSSLRequest(const content::GlobalRequestID& id, + int error, + const net::SSLInfo* ssl_info) = 0; + + // Called when SSLErrorHandler decides to continue the request despite the + // SSL error. + virtual void ContinueSSLRequest(const content::GlobalRequestID& id) = 0; + }; + virtual SSLCertErrorHandler* AsSSLCertErrorHandler(); // Find the appropriate SSLManager for the net::URLRequest and begin handling @@ -86,9 +105,12 @@ class SSLErrorHandler : public base::RefCountedThreadSafe<SSLErrorHandler> { friend class base::RefCountedThreadSafe<SSLErrorHandler>; // Construct on the IO thread. - SSLErrorHandler(content::ResourceDispatcherHostImpl* host, - net::URLRequest* request, - ResourceType::Type resource_type); + SSLErrorHandler(Delegate* delegate, + const content::GlobalRequestID& id, + ResourceType::Type resource_type, + const GURL& url, + int render_process_id, + int render_view_id); virtual ~SSLErrorHandler(); @@ -101,12 +123,12 @@ class SSLErrorHandler : public base::RefCountedThreadSafe<SSLErrorHandler> { // Should only be accessed on the UI thread. SSLManager* manager_; // Our manager. - // The id of the net::URLRequest associated with this object. + // The id of the request associated with this object. // Should only be accessed from the IO thread. content::GlobalRequestID request_id_; - // The ResourceDispatcherHostImpl we are associated with. - content::ResourceDispatcherHostImpl* resource_dispatcher_host_; + // The delegate we are associated with. + Delegate* delegate_; private: // Completes the CancelRequest operation on the IO thread. |