summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorbbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-21 23:07:04 +0000
committerbbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-21 23:07:04 +0000
commite46177921cafffdf8d911d92388f6d3b66483817 (patch)
tree7857dafa96f2eb9b76e1a013a875abc9d1120ac0 /webkit
parenta86c93c574d51e430b89b41a18f72924614ade6e (diff)
downloadchromium_src-e46177921cafffdf8d911d92388f6d3b66483817.zip
chromium_src-e46177921cafffdf8d911d92388f6d3b66483817.tar.gz
chromium_src-e46177921cafffdf8d911d92388f6d3b66483817.tar.bz2
Add an IPC channel between the NaCl loader process and the renderer.
BUG=116317 TEST=manual Review URL: https://chromiumcodereview.appspot.com/10214007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143483 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/plugins/ppapi/plugin_module.cc16
-rw-r--r--webkit/plugins/ppapi/plugin_module.h4
2 files changed, 16 insertions, 4 deletions
diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc
index a16f79a..423209f 100644
--- a/webkit/plugins/ppapi/plugin_module.cc
+++ b/webkit/plugins/ppapi/plugin_module.cc
@@ -419,7 +419,8 @@ PluginModule::PluginModule(const std::string& name,
library_(NULL),
name_(name),
path_(path),
- reserve_instance_id_(NULL) {
+ reserve_instance_id_(NULL),
+ nacl_ipc_proxy_(false) {
// Ensure the globals object is created.
if (!host_globals)
host_globals = new HostGlobals;
@@ -496,9 +497,13 @@ void PluginModule::InitAsProxied(
}
void PluginModule::InitAsProxiedNaCl(
- PluginDelegate::OutOfProcessProxy* out_of_process_proxy,
+ scoped_ptr<PluginDelegate::OutOfProcessProxy> out_of_process_proxy,
PP_Instance instance) {
- InitAsProxied(out_of_process_proxy);
+ // TODO(bbudge) We need to switch the mode of the PluginModule on a
+ // per-instance basis. Fix this so out_of_process_proxy and other
+ // state is stored in a map, indexed by instance.
+ nacl_ipc_proxy_ = true;
+ InitAsProxied(out_of_process_proxy.release());
// InitAsProxied (for the trusted/out-of-process case) initializes only the
// module, and one or more instances are added later. In this case, the
// PluginInstance was already created as in-process, so we missed the proxy
@@ -560,6 +565,11 @@ void PluginModule::InstanceDeleted(PluginInstance* instance) {
if (out_of_process_proxy_.get())
out_of_process_proxy_->RemoveInstance(instance->pp_instance());
instances_.erase(instance);
+
+ if (nacl_ipc_proxy_) {
+ out_of_process_proxy_.reset();
+ reserve_instance_id_ = NULL;
+ }
}
scoped_refptr< ::ppapi::CallbackTracker> PluginModule::GetCallbackTracker() {
diff --git a/webkit/plugins/ppapi/plugin_module.h b/webkit/plugins/ppapi/plugin_module.h
index d9b0162..d9d78ba 100644
--- a/webkit/plugins/ppapi/plugin_module.h
+++ b/webkit/plugins/ppapi/plugin_module.h
@@ -90,7 +90,7 @@ class WEBKIT_PLUGINS_EXPORT PluginModule :
// Initializes this module for the given NaCl proxy. This takes
// ownership of the given pointer, even in the failure case.
void InitAsProxiedNaCl(
- PluginDelegate::OutOfProcessProxy* out_of_process_proxy,
+ scoped_ptr<PluginDelegate::OutOfProcessProxy> out_of_process_proxy,
PP_Instance instance);
static const PPB_Core* GetCore();
@@ -203,6 +203,8 @@ class WEBKIT_PLUGINS_EXPORT PluginModule :
PP_Bool (*reserve_instance_id_)(PP_Module, PP_Instance);
+ bool nacl_ipc_proxy_;
+
DISALLOW_COPY_AND_ASSIGN(PluginModule);
};