| Index: webkit/plugins/ppapi/ppb_websocket_impl.cc
|
| diff --git a/webkit/plugins/ppapi/ppb_websocket_impl.cc b/webkit/plugins/ppapi/ppb_websocket_impl.cc
|
| index bc9fae483d460f51ce2309dd3e402afc97a5ea1f..2893fea23676cb84d77fd357ad72e7b1149419f8 100644
|
| --- a/webkit/plugins/ppapi/ppb_websocket_impl.cc
|
| +++ b/webkit/plugins/ppapi/ppb_websocket_impl.cc
|
| @@ -502,6 +502,10 @@ void PPB_WebSocket_Impl::didClose(unsigned long unhandled_buffered_amount,
|
| PP_WebSocketReadyState state = state_;
|
| state_ = PP_WEBSOCKETREADYSTATE_CLOSED;
|
|
|
| + // User handlers may release WebSocket PP_Resource in the following
|
| + // completion callbacks. Retain |this| here to assure that this object
|
| + // keep on being valid in this function.
|
| + scoped_refptr<PPB_WebSocket_Impl> retain_this(this);
|
| if (state == PP_WEBSOCKETREADYSTATE_CONNECTING)
|
| TrackedCallback::ClearAndRun(&connect_callback_, PP_ERROR_FAILED);
|
|
|
|
|