summaryrefslogtreecommitdiffstats
path: root/content/browser/ssl/ssl_error_handler.h
diff options
context:
space:
mode:
authortoyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-17 17:23:08 +0000
committertoyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-17 17:23:08 +0000
commit877182bb87fbe188efdb2d9fc641931706c9a469 (patch)
treeb74686831219bc8b81e19757d2031a04cab8175d /content/browser/ssl/ssl_error_handler.h
parent930df0858458d6f431b6378e7eae8f674a4139da (diff)
downloadchromium_src-877182bb87fbe188efdb2d9fc641931706c9a469.zip
chromium_src-877182bb87fbe188efdb2d9fc641931706c9a469.tar.gz
chromium_src-877182bb87fbe188efdb2d9fc641931706c9a469.tar.bz2
Use WeakPtr for passing SSLErrorHandler::Delegate to SSLManager.
If user close the owner tab while SSLManager suspend a query, SocketStreamDispatcherHost will disappear because it is owned by a renderer host. Because WebSocket is a sub resource, its request will be suspended until other major type resources (e.g., main frame) issue the same query request. I Introduce WeakPtr to make sure that SSLCertErrorHandler can call delegate functions safely. BUG=122654 TEST=none Review URL: https://chromiumcodereview.appspot.com/10034017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137676 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/ssl/ssl_error_handler.h')
-rw-r--r--content/browser/ssl/ssl_error_handler.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/content/browser/ssl/ssl_error_handler.h b/content/browser/ssl/ssl_error_handler.h
index 15832df..647ee71 100644
--- a/content/browser/ssl/ssl_error_handler.h
+++ b/content/browser/ssl/ssl_error_handler.h
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "content/common/content_export.h"
#include "content/public/browser/global_request_id.h"
#include "googleurl/src/gurl.h"
@@ -105,7 +106,7 @@ class SSLErrorHandler : public base::RefCountedThreadSafe<SSLErrorHandler> {
friend class base::RefCountedThreadSafe<SSLErrorHandler>;
// Construct on the IO thread.
- SSLErrorHandler(Delegate* delegate,
+ SSLErrorHandler(base::WeakPtr<Delegate> delegate,
const content::GlobalRequestID& id,
ResourceType::Type resource_type,
const GURL& url,
@@ -128,7 +129,7 @@ class SSLErrorHandler : public base::RefCountedThreadSafe<SSLErrorHandler> {
content::GlobalRequestID request_id_;
// The delegate we are associated with.
- Delegate* delegate_;
+ base::WeakPtr<Delegate> delegate_;
private:
// Completes the CancelRequest operation on the IO thread.