summaryrefslogtreecommitdiffstats
path: root/ppapi/shared_impl/video_decoder_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ppapi/shared_impl/video_decoder_impl.cc')
-rw-r--r--ppapi/shared_impl/video_decoder_impl.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/ppapi/shared_impl/video_decoder_impl.cc b/ppapi/shared_impl/video_decoder_impl.cc
index e665941..ef20f8b 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) {