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

Unified Diff: webkit/plugins/ppapi/ppb_video_decoder_impl.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 | « webkit/plugins/ppapi/ppb_video_decoder_impl.h ('k') | webkit/plugins/ppapi/ppb_websocket_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_video_decoder_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_video_decoder_impl.cc b/webkit/plugins/ppapi/ppb_video_decoder_impl.cc
index ab0773c9841ef2fb452176804f730ec4493f829b..9c63e13bdad96892d4290c2432dc36bae92e4414 100644
--- a/webkit/plugins/ppapi/ppb_video_decoder_impl.cc
+++ b/webkit/plugins/ppapi/ppb_video_decoder_impl.cc
@@ -24,6 +24,7 @@
#include "webkit/plugins/ppapi/ppb_graphics_3d_impl.h"
#include "webkit/plugins/ppapi/resource_helper.h"
+using ppapi::TrackedCallback;
using ppapi::thunk::EnterResourceNoLock;
using ppapi::thunk::PPB_Buffer_API;
using ppapi::thunk::PPB_Graphics3D_API;
@@ -126,10 +127,7 @@ bool PPB_VideoDecoder_Impl::Init(
int32_t PPB_VideoDecoder_Impl::Decode(
const PP_VideoBitstreamBuffer_Dev* bitstream_buffer,
- PP_CompletionCallback callback) {
- if (!callback.func)
- return PP_ERROR_BLOCKS_MAIN_THREAD;
-
+ scoped_refptr<TrackedCallback> callback) {
if (!platform_video_decoder_)
return PP_ERROR_BADRESOURCE;
@@ -178,10 +176,7 @@ void PPB_VideoDecoder_Impl::ReusePictureBuffer(int32_t picture_buffer_id) {
platform_video_decoder_->ReusePictureBuffer(picture_buffer_id);
}
-int32_t PPB_VideoDecoder_Impl::Flush(PP_CompletionCallback callback) {
- if (!callback.func)
- return PP_ERROR_BLOCKS_MAIN_THREAD;
-
+int32_t PPB_VideoDecoder_Impl::Flush(scoped_refptr<TrackedCallback> callback) {
if (!platform_video_decoder_)
return PP_ERROR_BADRESOURCE;
@@ -193,10 +188,7 @@ int32_t PPB_VideoDecoder_Impl::Flush(PP_CompletionCallback callback) {
return PP_OK_COMPLETIONPENDING;
}
-int32_t PPB_VideoDecoder_Impl::Reset(PP_CompletionCallback callback) {
- if (!callback.func)
- return PP_ERROR_BLOCKS_MAIN_THREAD;
-
+int32_t PPB_VideoDecoder_Impl::Reset(scoped_refptr<TrackedCallback> callback) {
if (!platform_video_decoder_)
return PP_ERROR_BADRESOURCE;
« no previous file with comments | « webkit/plugins/ppapi/ppb_video_decoder_impl.h ('k') | webkit/plugins/ppapi/ppb_websocket_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698