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

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: export AssertLockHeld Created 8 years, 6 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/shared_impl/ppb_graphics_3d_shared.h ('k') | ppapi/shared_impl/ppb_video_capture_shared.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3a562f4392e3b6d05c792be89cdfc0a16ff3d377..29a33391a1b75acdb744b6e91199f34b762595ba 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();
}
« no previous file with comments | « ppapi/shared_impl/ppb_graphics_3d_shared.h ('k') | ppapi/shared_impl/ppb_video_capture_shared.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698