diff options
author | polina@google.com <polina@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-30 21:42:37 +0000 |
---|---|---|
committer | polina@google.com <polina@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-30 21:42:37 +0000 |
commit | 917e86adc3f824f518c999dcba20bfd4cbf18a18 (patch) | |
tree | 52fe38f61527360231c17a905015066fb5d34bba /ppapi/thunk/ppb_graphics_2d_thunk.cc | |
parent | 9ae7b9195f0e06b64664bba52e9cc0e8b3470f56 (diff) | |
download | chromium_src-917e86adc3f824f518c999dcba20bfd4cbf18a18.zip chromium_src-917e86adc3f824f518c999dcba20bfd4cbf18a18.tar.gz chromium_src-917e86adc3f824f518c999dcba20bfd4cbf18a18.tar.bz2 |
Add a flag field to PP_CompletionCallback to control if the callback should
always be invoked asynchronously on success or error or skipped if the
operation can complete synchronously without blocking. Keep the default
behavior as-is until clients update their code. Bump revisions of all
interfaces that take callbacks as args. Update browser interface function
implementations and C++ layer to force callbacks if sync option is not set.
Change ppapi/tests to run tests involving callbacks with both flag options.
BUG=79376
TEST=ppapi_tests + bots
Review URL: http://codereview.chromium.org/6899055
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91205 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/thunk/ppb_graphics_2d_thunk.cc')
-rw-r--r-- | ppapi/thunk/ppb_graphics_2d_thunk.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ppapi/thunk/ppb_graphics_2d_thunk.cc b/ppapi/thunk/ppb_graphics_2d_thunk.cc index c26cac8..65aa4b0 100644 --- a/ppapi/thunk/ppb_graphics_2d_thunk.cc +++ b/ppapi/thunk/ppb_graphics_2d_thunk.cc @@ -5,6 +5,7 @@ #include "ppapi/c/pp_completion_callback.h" #include "ppapi/c/pp_errors.h" #include "ppapi/c/ppb_graphics_2d.h" +#include "ppapi/thunk/common.h" #include "ppapi/thunk/enter.h" #include "ppapi/thunk/ppb_graphics_2d_api.h" #include "ppapi/thunk/resource_creation_api.h" @@ -71,8 +72,9 @@ int32_t Flush(PP_Resource graphics_2d, PP_CompletionCallback callback) { EnterResource<PPB_Graphics2D_API> enter(graphics_2d, true); if (enter.failed()) - return PP_ERROR_BADRESOURCE; - return enter.object()->Flush(callback); + return MayForceCallback(callback, PP_ERROR_BADRESOURCE); + int32_t result = enter.object()->Flush(callback); + return MayForceCallback(callback, result); } const PPB_Graphics2D g_ppb_graphics_2d_thunk = { |