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

Unified Diff: webkit/plugins/ppapi/ppb_websocket_impl.cc

Issue 10909244: PPAPI: Get TrackedCallback ready for running on non-main threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 years, 3 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: 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 2893fea23676cb84d77fd357ad72e7b1149419f8..808602164e5cad906a47d1a7289c6d58b818f6b8 100644
--- a/webkit/plugins/ppapi/ppb_websocket_impl.cc
+++ b/webkit/plugins/ppapi/ppb_websocket_impl.cc
@@ -415,7 +415,7 @@ PP_Var PPB_WebSocket_Impl::GetURL() {
void PPB_WebSocket_Impl::didConnect() {
DCHECK_EQ(PP_WEBSOCKETREADYSTATE_CONNECTING, state_);
state_ = PP_WEBSOCKETREADYSTATE_OPEN;
- TrackedCallback::ClearAndRun(&connect_callback_, PP_OK);
+ connect_callback_->Run(PP_OK);
}
void PPB_WebSocket_Impl::didReceiveMessage(const WebString& message) {
@@ -430,7 +430,7 @@ void PPB_WebSocket_Impl::didReceiveMessage(const WebString& message) {
if (!wait_for_receive_)
return;
- TrackedCallback::ClearAndRun(&receive_callback_, DoReceive());
+ receive_callback_->Run(DoReceive());
}
void PPB_WebSocket_Impl::didReceiveArrayBuffer(
@@ -446,7 +446,7 @@ void PPB_WebSocket_Impl::didReceiveArrayBuffer(
if (!wait_for_receive_)
return;
- TrackedCallback::ClearAndRun(&receive_callback_, DoReceive());
+ receive_callback_->Run(DoReceive());
}
void PPB_WebSocket_Impl::didReceiveMessageError() {
@@ -465,7 +465,7 @@ void PPB_WebSocket_Impl::didReceiveMessageError() {
// We must invoke the callback with error code here.
wait_for_receive_ = false;
receive_callback_var_ = NULL;
- TrackedCallback::ClearAndRun(&receive_callback_, PP_ERROR_FAILED);
+ receive_callback_->Run(PP_ERROR_FAILED);
}
void PPB_WebSocket_Impl::didUpdateBufferedAmount(
@@ -507,16 +507,16 @@ void PPB_WebSocket_Impl::didClose(unsigned long unhandled_buffered_amount,
// 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);
+ connect_callback_->Run(PP_ERROR_FAILED);
if (wait_for_receive_) {
wait_for_receive_ = false;
receive_callback_var_ = NULL;
- TrackedCallback::ClearAndRun(&receive_callback_, PP_ERROR_FAILED);
+ receive_callback_->Run(PP_ERROR_FAILED);
}
if ((state == PP_WEBSOCKETREADYSTATE_CLOSING) && close_callback_.get())
- TrackedCallback::ClearAndRun(&close_callback_, PP_OK);
+ close_callback_->Run(PP_OK);
// Disconnect.
if (websocket_.get())
« ppapi/shared_impl/tracked_callback.cc ('K') | « webkit/plugins/ppapi/ppb_url_loader_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698