Chromium Code Reviews| 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..a67391e26b6f19b3bbd8ab0583e54a006a1f4f0e 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,21 @@ class URLRequest; |
| // |
| class SSLErrorHandler : public base::RefCountedThreadSafe<SSLErrorHandler> { |
| public: |
| + typedef std::pair<int, int> instance_id; |
|
wtc
2012/02/22 00:36:23
instance_id doesn't meet the requirement of the St
Takashi Toyoshima
2012/02/22 08:15:35
Thanks.
I decide to use content::GlobalRequestID i
|
| + // Delegate functions must be called from IO thread. |
| + class Delegate { |
| + public: |
| + virtual ResourceType::Type ResourceTypeForInstance( |
| + const instance_id& id) = 0; |
| + virtual const GURL& URLForInstance(const instance_id& id) = 0; |
| + virtual bool RenderViewForInstance(const instance_id& id, |
| + int* render_process_host_id, |
| + int* render_view_host_id) = 0; |
| + virtual void CancelRequestForInstance(const instance_id& id, |
| + int error, |
| + const net::SSLInfo* ssl_info) = 0; |
| + virtual void ContinueRequestForInstance(const instance_id& id) = 0; |
|
wtc
2012/02/22 00:36:23
Please document the Delegate class and its methods
Takashi Toyoshima
2012/02/22 08:15:35
Done.
|
| + }; |
| virtual SSLCertErrorHandler* AsSSLCertErrorHandler(); |
| // Find the appropriate SSLManager for the net::URLRequest and begin handling |
| @@ -83,9 +98,8 @@ 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, |
| + instance_id id); |
| virtual ~SSLErrorHandler(); |
| @@ -98,12 +112,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. |
|
wtc
2012/02/22 00:36:23
Perhaps this member (and its type) should be named
Takashi Toyoshima
2012/02/22 08:15:35
OK, I stick to the original request_id_.
|
| // Should only be accessed from the IO thread. |
| - content::GlobalRequestID request_id_; |
| + instance_id instance_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. |