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

Unified Diff: webkit/plugins/ppapi/ppb_graphics_2d_impl.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 | « webkit/plugins/ppapi/ppb_graphics_2d_impl.h ('k') | webkit/plugins/ppapi/ppb_layer_compositor_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
index 3a6a1a8c57d3e9ed682be98bde62388af62b34a4..69ac176c1a510d927c1b403f4c64cd32d280483a 100644
--- a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
+++ b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
@@ -314,11 +314,8 @@ void PPB_Graphics2D_Impl::ReplaceContents(PP_Resource image_data) {
queued_operations_.push_back(operation);
}
-int32_t PPB_Graphics2D_Impl::Flush(PP_CompletionCallback callback) {
+int32_t PPB_Graphics2D_Impl::Flush(scoped_refptr<TrackedCallback> callback) {
TRACE_EVENT0("pepper", "PPB_Graphics2D_Impl::Flush");
- if (!callback.func)
- return PP_ERROR_BLOCKS_MAIN_THREAD;
-
// Don't allow more than one pending flush at a time.
if (HasPendingFlush())
return PP_ERROR_INPROGRESS;
@@ -374,11 +371,9 @@ int32_t PPB_Graphics2D_Impl::Flush(PP_CompletionCallback callback) {
if (nothing_visible) {
// There's nothing visible to invalidate so just schedule the callback to
// execute in the next round of the message loop.
- ScheduleOffscreenCallback(FlushCallbackData(
- scoped_refptr<TrackedCallback>(new TrackedCallback(this, callback))));
+ ScheduleOffscreenCallback(FlushCallbackData(callback));
} else {
- unpainted_flush_callback_.Set(
- scoped_refptr<TrackedCallback>(new TrackedCallback(this, callback)));
+ unpainted_flush_callback_.Set(callback);
}
return PP_OK_COMPLETIONPENDING;
}
« no previous file with comments | « webkit/plugins/ppapi/ppb_graphics_2d_impl.h ('k') | webkit/plugins/ppapi/ppb_layer_compositor_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698