summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/ppapi_proxy_test.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-13 19:49:29 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-13 19:49:29 +0000
commit8be45847f76ec798c1241ed7e98cfb19f68b7e96 (patch)
tree7198fc01d68a1a5f4110c3167635f2000444054c /ppapi/proxy/ppapi_proxy_test.cc
parent43095f23d76d2ae3d50e1e8bb55c71152025d76c (diff)
downloadchromium_src-8be45847f76ec798c1241ed7e98cfb19f68b7e96.zip
chromium_src-8be45847f76ec798c1241ed7e98cfb19f68b7e96.tar.gz
chromium_src-8be45847f76ec798c1241ed7e98cfb19f68b7e96.tar.bz2
This adds a hang monitor for Pepper plugins. It monitors sync messages on the I/O thread of the renderer and sends a message to the browser if it's blocked for too long.
The browser will show an infobar allowing you to terminate the plugin. BUG=122795 Review URL: https://chromiumcodereview.appspot.com/10014013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132245 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/ppapi_proxy_test.cc')
-rw-r--r--ppapi/proxy/ppapi_proxy_test.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/ppapi/proxy/ppapi_proxy_test.cc b/ppapi/proxy/ppapi_proxy_test.cc
index 7bfacc5..98baafd 100644
--- a/ppapi/proxy/ppapi_proxy_test.cc
+++ b/ppapi/proxy/ppapi_proxy_test.cc
@@ -5,6 +5,7 @@
#include "ppapi/proxy/ppapi_proxy_test.h"
#include "base/bind.h"
+#include "base/compiler_specific.h"
#include "base/message_loop_proxy.h"
#include "base/observer_list.h"
#include "ipc/ipc_sync_channel.h"
@@ -240,8 +241,16 @@ void PluginProxyTest::TearDown() {
// HostProxyTestHarness --------------------------------------------------------
+class HostProxyTestHarness::MockSyncMessageStatusReceiver
+ : public HostDispatcher::SyncMessageStatusReceiver {
+ public:
+ virtual void BeginBlockOnSyncMessage() OVERRIDE {}
+ virtual void EndBlockOnSyncMessage() OVERRIDE {}
+};
+
HostProxyTestHarness::HostProxyTestHarness()
- : host_globals_(PpapiGlobals::ForTest()) {
+ : host_globals_(PpapiGlobals::ForTest()),
+ status_receiver_(new MockSyncMessageStatusReceiver) {
}
HostProxyTestHarness::~HostProxyTestHarness() {
@@ -257,7 +266,8 @@ void HostProxyTestHarness::SetUpHarness() {
host_dispatcher_.reset(new HostDispatcher(
base::Process::Current().handle(),
pp_module(),
- &MockGetInterface));
+ &MockGetInterface,
+ status_receiver_.get()));
host_dispatcher_->InitWithTestSink(&sink());
HostDispatcher::SetForInstance(pp_instance(), host_dispatcher_.get());
}
@@ -274,7 +284,8 @@ void HostProxyTestHarness::SetUpHarnessWithChannel(
host_dispatcher_.reset(new HostDispatcher(
base::Process::Current().handle(),
pp_module(),
- &MockGetInterface));
+ &MockGetInterface,
+ status_receiver_.get()));
ppapi::Preferences preferences;
host_dispatcher_->InitHostWithChannel(&delegate_mock_, channel_handle,
is_client, preferences);