Index: ppapi/proxy/ppb_surface_3d_proxy.cc |
=================================================================== |
--- ppapi/proxy/ppb_surface_3d_proxy.cc (revision 95737) |
+++ ppapi/proxy/ppb_surface_3d_proxy.cc (working copy) |
@@ -177,19 +177,11 @@ |
} |
void PPB_Surface3D_Proxy::OnMsgSwapBuffers(const HostResource& surface_3d) { |
- CompletionCallback callback = callback_factory_.NewOptionalCallback( |
+ EnterHostFromHostResourceForceCallback<PPB_Surface3D_API> enter( |
+ surface_3d, callback_factory_, |
&PPB_Surface3D_Proxy::SendSwapBuffersACKToPlugin, surface_3d); |
- |
- EnterHostFromHostResource<PPB_Surface3D_API> enter(surface_3d); |
- 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_Surface3D_Proxy::OnMsgSwapBuffersACK(const HostResource& resource, |