| Index: content/browser/ssl/ssl_error_handler.h
|
| diff --git a/content/browser/ssl/ssl_error_handler.h b/content/browser/ssl/ssl_error_handler.h
|
| index eadf89bbcbbc1a589e0eab3edd4ba42cfbf84f3a..15832df9b80b86414826fcef9d714f187e499f99 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.
|
|
|