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

Unified Diff: ppapi/proxy/host_dispatcher.h

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/dispatcher.cc ('k') | ppapi/proxy/host_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/host_dispatcher.h
diff --git a/ppapi/proxy/host_dispatcher.h b/ppapi/proxy/host_dispatcher.h
index 1bacdfae34126cb4c43d97f5c79cb6c325d36537..2d449793fa87ff35c826cf749c7c93f68dd3bfa7 100644
--- a/ppapi/proxy/host_dispatcher.h
+++ b/ppapi/proxy/host_dispatcher.h
@@ -9,8 +9,10 @@
#include <string>
#include <vector>
+#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/process.h"
+#include "ipc/ipc_channel_proxy.h"
#include "ppapi/c/pp_instance.h"
#include "ppapi/proxy/dispatcher.h"
#include "ppapi/shared_impl/function_group_base.h"
@@ -25,12 +27,31 @@ namespace proxy {
class PPAPI_PROXY_EXPORT HostDispatcher : public Dispatcher {
public:
- // Constructor for the renderer side.
+ // This interface receives notifications about sync messages being sent by
+ // the dispatcher to the plugin process. It is used to detect a hung plugin.
+ //
+ // Note that there can be nested sync messages, so the begin/end status
+ // actually represents a stack of blocking messages.
+ class SyncMessageStatusReceiver : public IPC::ChannelProxy::MessageFilter {
+ public:
+ virtual ~SyncMessageStatusReceiver() {}
+
+ // Notification that a sync message is about to be sent out.
+ virtual void BeginBlockOnSyncMessage() = 0;
+
+ // Notification that a sync message reply was received and the dispatcher
+ // is no longer blocked on a sync message.
+ virtual void EndBlockOnSyncMessage() = 0;
+ };
+
+ // Constructor for the renderer side. This will take a reference to the
+ // SyncMessageStatusReceiver.
//
// You must call InitHostWithChannel after the constructor.
HostDispatcher(base::ProcessHandle host_process_handle,
PP_Module module,
- GetInterfaceFunc local_get_interface);
+ GetInterfaceFunc local_get_interface,
+ SyncMessageStatusReceiver* sync_status);
~HostDispatcher();
// You must call this function before anything else. Returns true on success.
@@ -90,6 +111,8 @@ class PPAPI_PROXY_EXPORT HostDispatcher : public Dispatcher {
const std::string& source,
const std::string& value);
+ scoped_refptr<SyncMessageStatusReceiver> sync_status_;
+
PP_Module pp_module_;
// Maps interface name to whether that interface is supported. If an interface
« no previous file with comments | « ppapi/proxy/dispatcher.cc ('k') | ppapi/proxy/host_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698