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

Unified Diff: content/browser/ssl/ssl_error_handler.h

Issue 9406001: Factor out ResourceDispatcherHost dependent code around SSLManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reflects darin's 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 side-by-side diff with in-line comments
Download patch
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..1eeac467d648de598a05fa259ffda89d43934a73 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,23 @@ 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;
+ };
darin (slow to review) 2012/03/09 20:49:03 nit: add a new line at the end of this class.
Takashi Toyoshima 2012/03/10 00:24:44 Done.
virtual SSLCertErrorHandler* AsSSLCertErrorHandler();
// Find the appropriate SSLManager for the net::URLRequest and begin handling
@@ -83,9 +100,12 @@ 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,
darin (slow to review) 2012/03/09 20:49:03 isn't there redundant information being passed her
Takashi Toyoshima 2012/03/10 00:24:44 The contents of GlobalRequestID is different from
+ ResourceType::Type resource_type,
+ const GURL& url,
+ int render_process_id,
+ int render_view_id);
virtual ~SSLErrorHandler();
@@ -98,12 +118,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.

Powered by Google App Engine
This is Rietveld 408576698