diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-16 04:25:01 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-16 04:25:01 +0000 |
commit | 53900d507cd50344c2e73bb988671044f1787911 (patch) | |
tree | 7cd58934003dc610f544f8e682ac8c6040715f65 /webkit/glue/plugins/pepper_plugin_module.cc | |
parent | 047e07212c7da949be3107a70e3fe9ecb160d818 (diff) | |
download | chromium_src-53900d507cd50344c2e73bb988671044f1787911.zip chromium_src-53900d507cd50344c2e73bb988671044f1787911.tar.gz chromium_src-53900d507cd50344c2e73bb988671044f1787911.tar.bz2 |
Implement more of Flush properly. This adds support for waiting on the message
loop so we can now enforce that there is only one pending Flush at a time.
Also removes the ability to have multiple flushes pending at the same time.
TEST=covered by ppapi unit test
BUG=none
Review URL: http://codereview.chromium.org/2862002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49899 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins/pepper_plugin_module.cc')
-rw-r--r-- | webkit/glue/plugins/pepper_plugin_module.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/webkit/glue/plugins/pepper_plugin_module.cc b/webkit/glue/plugins/pepper_plugin_module.cc index 99448f2..2eb63a1 100644 --- a/webkit/glue/plugins/pepper_plugin_module.cc +++ b/webkit/glue/plugins/pepper_plugin_module.cc @@ -7,6 +7,7 @@ #include <set> #include "base/command_line.h" +#include "base/message_loop.h" #include "base/message_loop_proxy.h" #include "base/logging.h" #include "base/scoped_ptr.h" @@ -110,8 +111,21 @@ bool ReadImageData(PP_Resource device_context_2d, return context->ReadImageData(image, x, y); } +void RunMessageLoop() { + bool old_state = MessageLoop::current()->NestableTasksAllowed(); + MessageLoop::current()->SetNestableTasksAllowed(true); + MessageLoop::current()->Run(); + MessageLoop::current()->SetNestableTasksAllowed(old_state); +} + +void QuitMessageLoop() { + MessageLoop::current()->Quit(); +} + const PPB_Testing testing_interface = { - &ReadImageData + &ReadImageData, + &RunMessageLoop, + &QuitMessageLoop, }; // GetInterface ---------------------------------------------------------------- |