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

Unified Diff: ppapi/proxy/host_dispatcher.cc

Issue 10014013: Add a hang monitor for Pepper plugins (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | « ppapi/proxy/host_dispatcher.h ('k') | ppapi/proxy/ppapi_proxy_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/host_dispatcher.cc
diff --git a/ppapi/proxy/host_dispatcher.cc b/ppapi/proxy/host_dispatcher.cc
index d1c28f7236e1910cb0846fb6ff4d2c048b3b5131..9256fe9459e9f4c40a003204bd85e0be8f2cf5d4 100644
--- a/ppapi/proxy/host_dispatcher.cc
+++ b/ppapi/proxy/host_dispatcher.cc
@@ -63,8 +63,10 @@ class BoolRestorer {
HostDispatcher::HostDispatcher(base::ProcessHandle remote_process_handle,
PP_Module module,
- GetInterfaceFunc local_get_interface)
+ GetInterfaceFunc local_get_interface,
+ SyncMessageStatusReceiver* sync_status)
: Dispatcher(remote_process_handle, local_get_interface),
+ sync_status_(sync_status),
pp_module_(module),
ppb_proxy_(NULL),
allow_plugin_reentrancy_(false) {
@@ -92,6 +94,8 @@ bool HostDispatcher::InitHostWithChannel(
const ppapi::Preferences& preferences) {
if (!Dispatcher::InitWithChannel(delegate, channel_handle, is_client))
return false;
+ AddIOThreadMessageFilter(sync_status_.get());
+
Send(new PpapiMsg_SetPreferences(preferences));
return true;
}
@@ -152,7 +156,12 @@ bool HostDispatcher::Send(IPC::Message* msg) {
// waiting for the reply, dispatches an incoming ExecuteScript call which
// destroys the plugin module and in turn the dispatcher.
ScopedModuleReference scoped_ref(this);
- return Dispatcher::Send(msg);
+
+ sync_status_->BeginBlockOnSyncMessage();
+ bool result = Dispatcher::Send(msg);
+ sync_status_->EndBlockOnSyncMessage();
+
+ return result;
} else {
// We don't want to have a scoped ref for async message cases since since
// async messages are sent during module desruction. In this case, the
« no previous file with comments | « ppapi/proxy/host_dispatcher.h ('k') | ppapi/proxy/ppapi_proxy_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698