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

Unified Diff: ppapi/shared_impl/ppb_graphics_3d_shared.cc

Issue 10081020: PPAPI: Make blocking completion callbacks work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: try again Created 8 years, 7 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
Index: ppapi/shared_impl/ppb_graphics_3d_shared.cc
diff --git a/ppapi/shared_impl/ppb_graphics_3d_shared.cc b/ppapi/shared_impl/ppb_graphics_3d_shared.cc
index c5397040497157a8d6c9176edec5d39a65c1d882..c87d259d26ddbd1aee8658e7533e6210c83e437a 100644
--- a/ppapi/shared_impl/ppb_graphics_3d_shared.cc
+++ b/ppapi/shared_impl/ppb_graphics_3d_shared.cc
@@ -55,19 +55,14 @@ int32_t PPB_Graphics3D_Shared::ResizeBuffers(int32_t width, int32_t height) {
return PP_OK;
}
-int32_t PPB_Graphics3D_Shared::SwapBuffers(PP_CompletionCallback callback) {
- if (!callback.func) {
- // Blocking SwapBuffers isn't supported (since we have to be on the main
- // thread).
- return PP_ERROR_BADARGUMENT;
- }
-
+int32_t PPB_Graphics3D_Shared::SwapBuffers(
+ scoped_refptr<TrackedCallback> callback) {
if (HasPendingSwap()) {
// Already a pending SwapBuffers that hasn't returned yet.
return PP_ERROR_INPROGRESS;
}
- swap_callback_ = new TrackedCallback(this, callback);
+ swap_callback_ = callback;
return DoSwapBuffers();
}

Powered by Google App Engine
This is Rietveld 408576698