diff options
Diffstat (limited to 'webkit/plugins/ppapi/ppb_graphics_2d_impl.cc')
-rw-r--r-- | webkit/plugins/ppapi/ppb_graphics_2d_impl.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc index 3a75e99..bbef628 100644 --- a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc +++ b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc @@ -285,15 +285,13 @@ void PPB_Graphics2D_Impl::ReplaceContents(PP_Resource image_data) { } int32_t PPB_Graphics2D_Impl::Flush(PP_CompletionCallback callback) { + 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; - // TODO(brettw) check that the current thread is not the main one and - // implement blocking flushes in this case. - if (!callback.func) - return PP_ERROR_BADARGUMENT; - bool nothing_visible = true; for (size_t i = 0; i < queued_operations_.size(); i++) { QueuedOperation& operation = queued_operations_[i]; |