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

Unified Diff: ppapi/proxy/host_dispatcher.h

Issue 6625045: Prevent Pepper plugin reentrncy for synchronous messages. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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 | « no previous file | 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
===================================================================
--- ppapi/proxy/host_dispatcher.h (revision 77850)
+++ ppapi/proxy/host_dispatcher.h (working copy)
@@ -59,6 +59,7 @@
// Dispatcher overrides.
virtual bool IsPlugin() const;
+ virtual bool Send(IPC::Message* msg);
// IPC::Channel::Listener.
virtual bool OnMessageReceived(const IPC::Message& msg);
@@ -78,6 +79,12 @@
// Will return NULL if an interface isn't supported.
InterfaceProxy* GetOrCreatePPBInterfaceProxy(InterfaceID id);
+ // See the value below. Call this when processing a scripting message from
+ // the plugin that can be reentered.
+ void set_allow_plugin_reentrancy() {
+ allow_plugin_reentrancy_ = true;
+ }
+
// Returns the proxy interface for talking to the implementation.
const PPB_Proxy_Private* ppb_proxy() const { return ppb_proxy_; }
@@ -104,6 +111,13 @@
// Guaranteed non-NULL.
const PPB_Proxy_Private* ppb_proxy_;
+ // Set to true when the plugin is in a state that it can be reentered by a
+ // sync message from the host. We allow reentrancy only when we're processing
+ // a sync message from the renderer that is a scripting command. When the
+ // plugin is in this state, it needs to accept reentrancy since scripting may
+ // ultimately call back into the plugin.
+ bool allow_plugin_reentrancy_;
+
DISALLOW_COPY_AND_ASSIGN(HostDispatcher);
};
« no previous file with comments | « no previous file | ppapi/proxy/host_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698