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

Unified Diff: ppapi/proxy/ppb_graphics_3d_proxy.cc

Issue 7551032: Add a template to handle properly issuing completion callbacks. This fixes (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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/proxy/ppb_graphics_2d_proxy.cc ('k') | ppapi/proxy/ppb_surface_3d_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_graphics_3d_proxy.cc
===================================================================
--- ppapi/proxy/ppb_graphics_3d_proxy.cc (revision 94913)
+++ ppapi/proxy/ppb_graphics_3d_proxy.cc (working copy)
@@ -587,19 +587,11 @@
}
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,
« no previous file with comments | « ppapi/proxy/ppb_graphics_2d_proxy.cc ('k') | ppapi/proxy/ppb_surface_3d_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698