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

Unified Diff: ppapi/shared_impl/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.h ('k') | webkit/plugins/ppapi/ppb_video_decoder_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/video_decoder_impl.cc
diff --git a/ppapi/shared_impl/video_decoder_impl.cc b/ppapi/shared_impl/video_decoder_impl.cc
index e665941c280bc0b5c1cb77dfd527731e1b9ee215..ef20f8bdc396d394bb342dcd16ed33d70ed2c534 100644
--- a/ppapi/shared_impl/video_decoder_impl.cc
+++ b/ppapi/shared_impl/video_decoder_impl.cc
@@ -44,22 +44,26 @@ void VideoDecoderImpl::Destroy() {
UnrefResource(context3d_id_);
}
-void VideoDecoderImpl::SetFlushCallback(PP_CompletionCallback callback) {
+bool VideoDecoderImpl::SetFlushCallback(PP_CompletionCallback callback) {
CHECK(callback.func);
- DCHECK(!flush_callback_.func);
+ if (flush_callback_.func)
+ return false;
flush_callback_ = callback;
+ return true;
}
-void VideoDecoderImpl::SetResetCallback(PP_CompletionCallback callback) {
+bool VideoDecoderImpl::SetResetCallback(PP_CompletionCallback callback) {
CHECK(callback.func);
- DCHECK(!reset_callback_.func);
+ if (reset_callback_.func)
+ return false;
reset_callback_ = callback;
+ return true;
}
-void VideoDecoderImpl::SetBitstreamBufferCallback(
+bool VideoDecoderImpl::SetBitstreamBufferCallback(
int32 bitstream_buffer_id, PP_CompletionCallback callback) {
- CHECK(bitstream_buffer_callbacks_.insert(
- std::make_pair(bitstream_buffer_id, callback)).second);
+ return bitstream_buffer_callbacks_.insert(
+ std::make_pair(bitstream_buffer_id, callback)).second;
}
void VideoDecoderImpl::RunFlushCallback(int32 result) {
« no previous file with comments | « ppapi/shared_impl/video_decoder_impl.h ('k') | webkit/plugins/ppapi/ppb_video_decoder_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698