diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-03 20:52:20 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-03 20:52:20 +0000 |
commit | 0609474310417da4a2235d85639aa387a8df0a6b (patch) | |
tree | 15f7ce49d32bfd832e65d6f015db5ae70607c6a9 /ppapi/proxy/ppb_graphics_3d_proxy.cc | |
parent | 7efc582d60227aa473c77c3309a96b2dfed52351 (diff) | |
download | chromium_src-0609474310417da4a2235d85639aa387a8df0a6b.zip chromium_src-0609474310417da4a2235d85639aa387a8df0a6b.tar.gz chromium_src-0609474310417da4a2235d85639aa387a8df0a6b.tar.bz2 |
Add a template to handle properly issuing completion callbacks. This fixes
some bugs where we forgot to issue completion callbacks in some error cases
in the proxy, and cleans up the cases that were already doing this properly.
This removes the PPB_AudioTrusted_API and folds those functions into the
regular Audio API. I'm trying to merge more things to have a smaller explosion
of APIs and the boilerplate associated with them.
Review URL: http://codereview.chromium.org/7551032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95309 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/ppb_graphics_3d_proxy.cc')
-rw-r--r-- | ppapi/proxy/ppb_graphics_3d_proxy.cc | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/ppapi/proxy/ppb_graphics_3d_proxy.cc b/ppapi/proxy/ppb_graphics_3d_proxy.cc index 480f06b..11250d9 100644 --- a/ppapi/proxy/ppb_graphics_3d_proxy.cc +++ b/ppapi/proxy/ppb_graphics_3d_proxy.cc @@ -587,19 +587,11 @@ void PPB_Graphics3D_Proxy::OnMsgGetTransferBuffer( } void PPB_Graphics3D_Proxy::OnMsgSwapBuffers(const HostResource& context) { - CompletionCallback callback = callback_factory_.NewOptionalCallback( + EnterHostFromHostResourceForceCallback<PPB_Graphics3D_API> enter( + context, callback_factory_, &PPB_Graphics3D_Proxy::SendSwapBuffersACKToPlugin, context); - - EnterHostFromHostResource<PPB_Graphics3D_API> enter(context); - int32_t result = PP_ERROR_BADRESOURCE; if (enter.succeeded()) - result = enter.object()->SwapBuffers(callback.pp_completion_callback()); - if (result != PP_OK_COMPLETIONPENDING) { - // There was some error, so we won't get a flush callback. We need to now - // issue the ACK to the plugin hears about the error. This will also clean - // up the data associated with the callback. - callback.Run(result); - } + enter.SetResult(enter.object()->SwapBuffers(enter.callback())); } void PPB_Graphics3D_Proxy::OnMsgSwapBuffersACK(const HostResource& resource, |