diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-16 20:10:55 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-16 20:10:55 +0000 |
commit | e655a951994dcafb7203d6824b90dfef6e445dca (patch) | |
tree | 18b9126b21efd9e63f74149263753031ec393ae8 /webkit/plugins/ppapi/ppb_graphics_2d_impl.cc | |
parent | c96312d46205ea82764aba6255ecbb8dd5f57d11 (diff) | |
download | chromium_src-e655a951994dcafb7203d6824b90dfef6e445dca.zip chromium_src-e655a951994dcafb7203d6824b90dfef6e445dca.tar.gz chromium_src-e655a951994dcafb7203d6824b90dfef6e445dca.tar.bz2 |
Add a new error code for a null callback on the main thread.
Convert the NaCl and ChromeIPC proxies to use the new value.
Review URL: http://codereview.chromium.org/7885014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101556 0039d316-1c4b-4281-b951-d872f2087c98
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]; |