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

Unified Diff: ppapi/shared_impl/ppb_video_decoder_shared.cc

Issue 10081020: PPAPI: Make blocking completion callbacks work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: export AssertLockHeld Created 8 years, 6 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
« no previous file with comments | « ppapi/shared_impl/ppb_video_decoder_shared.h ('k') | ppapi/shared_impl/private/ppb_host_resolver_shared.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/ppb_video_decoder_shared.cc
diff --git a/ppapi/shared_impl/ppb_video_decoder_shared.cc b/ppapi/shared_impl/ppb_video_decoder_shared.cc
index b61567b2eb4bc9ed21862420e09144b2c0c8dd2a..441b0d21cc7e41db352eafa892a0649859959f97 100644
--- a/ppapi/shared_impl/ppb_video_decoder_shared.cc
+++ b/ppapi/shared_impl/ppb_video_decoder_shared.cc
@@ -48,28 +48,27 @@ void PPB_VideoDecoder_Shared::Destroy() {
PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource(graphics_context_);
}
-bool PPB_VideoDecoder_Shared::SetFlushCallback(PP_CompletionCallback callback) {
- CHECK(callback.func);
+bool PPB_VideoDecoder_Shared::SetFlushCallback(
+ scoped_refptr<TrackedCallback> callback) {
if (flush_callback_.get())
return false;
- flush_callback_ = new TrackedCallback(this, callback);
+ flush_callback_ = callback;
return true;
}
-bool PPB_VideoDecoder_Shared::SetResetCallback(PP_CompletionCallback callback) {
- CHECK(callback.func);
+bool PPB_VideoDecoder_Shared::SetResetCallback(
+ scoped_refptr<TrackedCallback> callback) {
if (TrackedCallback::IsPending(reset_callback_))
return false;
- reset_callback_ = new TrackedCallback(this, callback);
+ reset_callback_ = callback;
return true;
}
bool PPB_VideoDecoder_Shared::SetBitstreamBufferCallback(
int32 bitstream_buffer_id,
- PP_CompletionCallback callback) {
+ scoped_refptr<TrackedCallback> callback) {
return bitstream_buffer_callbacks_.insert(
- std::make_pair(bitstream_buffer_id,
- new TrackedCallback(this, callback))).second;
+ std::make_pair(bitstream_buffer_id, callback)).second;
}
void PPB_VideoDecoder_Shared::RunFlushCallback(int32 result) {
« no previous file with comments | « ppapi/shared_impl/ppb_video_decoder_shared.h ('k') | ppapi/shared_impl/private/ppb_host_resolver_shared.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698