diff options
author | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-22 21:09:09 +0000 |
---|---|---|
committer | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-22 21:09:09 +0000 |
commit | 17b5a817290e1b495a577fcc783d15fb8bc89137 (patch) | |
tree | 468b06ffeceecd892c08d6d2dc7879597b47b189 /webkit/plugins | |
parent | 1639cb3af1931b16d7eda95732fa69d94dc57c81 (diff) | |
download | chromium_src-17b5a817290e1b495a577fcc783d15fb8bc89137.zip chromium_src-17b5a817290e1b495a577fcc783d15fb8bc89137.tar.gz chromium_src-17b5a817290e1b495a577fcc783d15fb8bc89137.tar.bz2 |
Add an IPC channel between the NaCl loader process and the renderer.
BUG=116317
TEST=ppapi, nacl tests, manual testing for experimental IPC proxy.
TBR=brettw@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10661002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143708 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins')
-rw-r--r-- | webkit/plugins/ppapi/plugin_module.cc | 16 | ||||
-rw-r--r-- | webkit/plugins/ppapi/plugin_module.h | 4 |
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); }; |