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

Unified Diff: webkit/plugins/ppapi/ppb_video_decoder_impl.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 | « ppapi/shared_impl/video_decoder_impl.cc ('k') | no next file » | 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 57c4dbcb114efc9a0d3db099cc436ecf88ea4531..9c8b37e1f3c8261ba487259c0eb296e9ca46d88c 100644
--- a/webkit/plugins/ppapi/ppb_video_decoder_impl.cc
+++ b/webkit/plugins/ppapi/ppb_video_decoder_impl.cc
@@ -104,7 +104,8 @@ int32_t PPB_VideoDecoder_Impl::Decode(
bitstream_buffer->id,
buffer->shared_memory()->handle(),
static_cast<size_t>(bitstream_buffer->size));
- SetBitstreamBufferCallback(bitstream_buffer->id, callback);
+ if (!SetBitstreamBufferCallback(bitstream_buffer->id, callback))
+ return PP_ERROR_BADARGUMENT;
FlushCommandBuffer();
platform_video_decoder_->Decode(decode_buffer);
@@ -143,7 +144,8 @@ int32_t PPB_VideoDecoder_Impl::Flush(PP_CompletionCallback callback) {
if (!platform_video_decoder_)
return PP_ERROR_BADRESOURCE;
- SetFlushCallback(callback);
+ if (!SetFlushCallback(callback))
+ return PP_ERROR_INPROGRESS;
FlushCommandBuffer();
platform_video_decoder_->Flush();
@@ -154,7 +156,8 @@ int32_t PPB_VideoDecoder_Impl::Reset(PP_CompletionCallback callback) {
if (!platform_video_decoder_)
return PP_ERROR_BADRESOURCE;
- SetResetCallback(callback);
+ if (!SetResetCallback(callback))
+ return PP_ERROR_INPROGRESS;
FlushCommandBuffer();
platform_video_decoder_->Reset();
« no previous file with comments | « ppapi/shared_impl/video_decoder_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698