summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/ppb_graphics_3d_proxy.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-08 19:40:40 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-08 19:40:40 +0000
commit79d23c7eca174feb74093670569088c2c8956e82 (patch)
treeb176a3fd8cc3f00ffcf1c33997115c0254267059 /ppapi/proxy/ppb_graphics_3d_proxy.cc
parent3e15fdfe40bd5484a6c764ab65b2e6ffd2f1aa7d (diff)
downloadchromium_src-79d23c7eca174feb74093670569088c2c8956e82.zip
chromium_src-79d23c7eca174feb74093670569088c2c8956e82.tar.gz
chromium_src-79d23c7eca174feb74093670569088c2c8956e82.tar.bz2
Reland 95309. 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. Original review URL: http://codereview.chromium.org/7551032 Review URL: http://codereview.chromium.org/7585025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95859 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/ppb_graphics_3d_proxy.cc')
-rw-r--r--ppapi/proxy/ppb_graphics_3d_proxy.cc14
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,