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

Unified Diff: ppapi/cpp/dev/video_decoder_dev.cc

Issue 6899055: PPAPI: Force async callback invocation option. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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/cpp/dev/transport_dev.cc ('k') | ppapi/cpp/file_io.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/dev/video_decoder_dev.cc
===================================================================
--- ppapi/cpp/dev/video_decoder_dev.cc (revision 91178)
+++ ppapi/cpp/dev/video_decoder_dev.cc (working copy)
@@ -12,6 +12,7 @@
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/module_impl.h"
+#include "ppapi/thunk/common.h"
namespace pp {
@@ -39,7 +40,7 @@
const Context3D_Dev& context,
CompletionCallback callback) {
if (!has_interface<PPB_VideoDecoder_Dev>())
- return PP_ERROR_NOINTERFACE;
+ return callback.MayForce(PP_ERROR_NOINTERFACE);
return get_interface<PPB_VideoDecoder_Dev>()->Initialize(
pp_resource(), context.pp_resource(), config,
callback.pp_completion_callback());
@@ -77,9 +78,7 @@
const PP_VideoBitstreamBuffer_Dev& bitstream_buffer,
CompletionCallback callback) {
if (!has_interface<PPB_VideoDecoder_Dev>())
- return PP_ERROR_NOINTERFACE;
- if (!pp_resource())
- return PP_ERROR_BADRESOURCE;
+ return callback.MayForce(PP_ERROR_NOINTERFACE);
return get_interface<PPB_VideoDecoder_Dev>()->Decode(
pp_resource(), &bitstream_buffer, callback.pp_completion_callback());
}
@@ -93,18 +92,14 @@
int32_t VideoDecoder_Dev::Flush(CompletionCallback callback) {
if (!has_interface<PPB_VideoDecoder_Dev>())
- return PP_ERROR_NOINTERFACE;
- if (!pp_resource())
- return PP_ERROR_BADRESOURCE;
+ return callback.MayForce(PP_ERROR_NOINTERFACE);
return get_interface<PPB_VideoDecoder_Dev>()->Flush(
pp_resource(), callback.pp_completion_callback());
}
int32_t VideoDecoder_Dev::Abort(CompletionCallback callback) {
if (!has_interface<PPB_VideoDecoder_Dev>())
- return PP_ERROR_NOINTERFACE;
- if (!pp_resource())
- return PP_ERROR_BADRESOURCE;
+ return callback.MayForce(PP_ERROR_NOINTERFACE);
return get_interface<PPB_VideoDecoder_Dev>()->Abort(
pp_resource(), callback.pp_completion_callback());
}
« no previous file with comments | « ppapi/cpp/dev/transport_dev.cc ('k') | ppapi/cpp/file_io.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698