diff options
author | ukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-22 11:35:43 +0000 |
---|---|---|
committer | ukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-22 11:35:43 +0000 |
commit | 04be4b58872f706194c3a126aec973ec53897366 (patch) | |
tree | 6e9b2fa5f60413eaa514523089d7e46cc87c2b32 /webkit/glue/websocketstreamhandle_bridge.h | |
parent | f1869fdc0e8e49022ab4593eeba25fcb51f83ac1 (diff) | |
download | chromium_src-04be4b58872f706194c3a126aec973ec53897366.zip chromium_src-04be4b58872f706194c3a126aec973ec53897366.tar.gz chromium_src-04be4b58872f706194c3a126aec973ec53897366.tar.bz2 |
Make WebSocketStreamHandleBridge RefCountedThreadSafe.
In layout_tests, test_shell crashed by
/base/ref_counted.cc(60)] Check failed: in_dtor_. RefCountedThreadSafe object deleted without calling Release()
in context of
test_shell(webkit_glue::WebSocketStreamHandleImpl::Context::DidClose(WebKit::WebSocketStreamHandle*)+0x7d) [0x8f6b34b]
Since bridge instance is ref counted object, we must not delete it.
Make base class WebSocketStreamHandleBridge RefCountedThreadSafe,
and manage it by scoped_refptr.
BUG=25399
TEST=layout tests not crashed in XHR tests.
Review URL: http://codereview.chromium.org/316008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29769 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/websocketstreamhandle_bridge.h')
-rw-r--r-- | webkit/glue/websocketstreamhandle_bridge.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/webkit/glue/websocketstreamhandle_bridge.h b/webkit/glue/websocketstreamhandle_bridge.h index 3c995f5..ee897fd 100644 --- a/webkit/glue/websocketstreamhandle_bridge.h +++ b/webkit/glue/websocketstreamhandle_bridge.h @@ -8,6 +8,7 @@ #include <vector> #include "base/basictypes.h" +#include "base/ref_counted.h" class GURL; @@ -19,10 +20,9 @@ namespace webkit_glue { class WebSocketStreamHandleDelegate; -class WebSocketStreamHandleBridge { +class WebSocketStreamHandleBridge + : public base::RefCountedThreadSafe<WebSocketStreamHandleBridge> { public: - virtual ~WebSocketStreamHandleBridge() {} - static WebSocketStreamHandleBridge* Create( WebKit::WebSocketStreamHandle* handle, WebSocketStreamHandleDelegate* delegate); @@ -34,7 +34,9 @@ class WebSocketStreamHandleBridge { virtual void Close() = 0; protected: + friend class base::RefCountedThreadSafe<WebSocketStreamHandleBridge>; WebSocketStreamHandleBridge() {} + virtual ~WebSocketStreamHandleBridge() {} private: DISALLOW_COPY_AND_ASSIGN(WebSocketStreamHandleBridge); |