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

Unified Diff: ppapi/proxy/ppb_video_decoder_proxy.cc

Issue 7628025: Gracefully handle multiple Flush/Reset/Decode with same id (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 | « no previous file | ppapi/shared_impl/video_decoder_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_video_decoder_proxy.cc
diff --git a/ppapi/proxy/ppb_video_decoder_proxy.cc b/ppapi/proxy/ppb_video_decoder_proxy.cc
index dc65d9f58432d14cdec1d2e28d7f191bb7ba4ede..ddeeabd783cfcfee239b5ede73ce04a619a371d0 100644
--- a/ppapi/proxy/ppb_video_decoder_proxy.cc
+++ b/ppapi/proxy/ppb_video_decoder_proxy.cc
@@ -96,7 +96,8 @@ int32_t VideoDecoder::Decode(
if (enter_buffer.failed())
return PP_ERROR_BADRESOURCE;
- SetBitstreamBufferCallback(bitstream_buffer->id, callback);
+ if (!SetBitstreamBufferCallback(bitstream_buffer->id, callback))
+ return PP_ERROR_BADARGUMENT;
Buffer* ppb_buffer =
static_cast<Buffer*>(enter_buffer.object());
@@ -127,7 +128,8 @@ void VideoDecoder::ReusePictureBuffer(int32_t picture_buffer_id) {
}
int32_t VideoDecoder::Flush(PP_CompletionCallback callback) {
- SetFlushCallback(callback);
+ if (!SetFlushCallback(callback))
+ return PP_ERROR_INPROGRESS;
FlushCommandBuffer();
GetDispatcher()->Send(new PpapiHostMsg_PPBVideoDecoder_Flush(
@@ -136,7 +138,8 @@ int32_t VideoDecoder::Flush(PP_CompletionCallback callback) {
}
int32_t VideoDecoder::Reset(PP_CompletionCallback callback) {
- SetResetCallback(callback);
+ if (!SetResetCallback(callback))
+ return PP_ERROR_INPROGRESS;
FlushCommandBuffer();
GetDispatcher()->Send(new PpapiHostMsg_PPBVideoDecoder_Reset(
« no previous file with comments | « no previous file | ppapi/shared_impl/video_decoder_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698