| 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 848b9d319abd4fcf95cecb93afbcb36d1e6ceb3a..22d1e9c42096d916623dc21dc1eff249a17b783b 100644
|
| --- a/content/browser/ssl/ssl_error_handler.h
|
| +++ b/content/browser/ssl/ssl_error_handler.h
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| @@ -10,16 +10,16 @@
|
|
|
| #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 ResourceDispatcherHost;
|
| class SSLCertErrorHandler;
|
| +class SSLManager;
|
|
|
| namespace net {
|
| +class SSLInfo;
|
| class URLRequest;
|
| } // namespace net
|
|
|
| @@ -39,6 +39,39 @@ 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.
|
| + // Query functions are used to retrieve the request related information.
|
| + // Finally, CancelSSLRequest() or ContinueSSLRequest() will be called after
|
| + // SSLErrorHandler makes a decision on the SSL error.
|
| + class Delegate {
|
| + public:
|
| + // Queries what kind of resource is associated with a request that
|
| + // generated the error.
|
| + virtual ResourceType::Type ResourceTypeForSSLRequest(
|
| + const content::GlobalRequestID& id) = 0;
|
| +
|
| + // Queries the requested URL which generated the error.
|
| + virtual const GURL& URLForSSLRequest(
|
| + const content::GlobalRequestID& id) = 0;
|
| +
|
| + // Queries the render process and view ids which represent RenderViewHost
|
| + // to which the request belong.
|
| + virtual bool RenderViewForSSLRequest(const content::GlobalRequestID& id,
|
| + int* render_process_host_id,
|
| + int* render_view_host_id) = 0;
|
| +
|
| + // 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
|
| @@ -83,9 +116,7 @@ class SSLErrorHandler : public base::RefCountedThreadSafe<SSLErrorHandler> {
|
| friend class base::RefCountedThreadSafe<SSLErrorHandler>;
|
|
|
| // Construct on the IO thread.
|
| - SSLErrorHandler(ResourceDispatcherHost* resource_dispatcher_host,
|
| - net::URLRequest* request,
|
| - ResourceType::Type resource_type);
|
| + SSLErrorHandler(Delegate* delegate, const content::GlobalRequestID& id);
|
|
|
| virtual ~SSLErrorHandler();
|
|
|
| @@ -98,12 +129,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 ResourceDispatcherHost we are associated with.
|
| - ResourceDispatcherHost* resource_dispatcher_host_;
|
| + // The delegate we are associated with.
|
| + Delegate* delegate_;
|
|
|
| private:
|
| // Completes the CancelRequest operation on the IO thread.
|
|
|