summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-12 22:50:19 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-12 22:50:19 +0000
commitd527cdd8d20d760114726a0b65d6ff85f7832880 (patch)
tree971aac9dc208539a380083b1fd336d6a8a341877 /webkit
parentae3ac17598586553c9963df44566427410afadae (diff)
downloadchromium_src-d527cdd8d20d760114726a0b65d6ff85f7832880.zip
chromium_src-d527cdd8d20d760114726a0b65d6ff85f7832880.tar.gz
chromium_src-d527cdd8d20d760114726a0b65d6ff85f7832880.tar.bz2
Gracefully handle multiple Flush/Reset/Decode with same id
The DCHECKs don't trigger in release, and in any case it's a bit rude to have the renderer crash on a plugin that did the wrong thing, so send an error instead. BUG=None TEST=Pepper Flash Review URL: http://codereview.chromium.org/7628025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96649 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/plugins/ppapi/ppb_video_decoder_impl.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/webkit/plugins/ppapi/ppb_video_decoder_impl.cc b/webkit/plugins/ppapi/ppb_video_decoder_impl.cc
index 57c4dbc..9c8b37e 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();