Index: webkit/plugins/ppapi/plugin_module.cc |
=================================================================== |
--- webkit/plugins/ppapi/plugin_module.cc (revision 143480) |
+++ webkit/plugins/ppapi/plugin_module.cc (working copy) |
@@ -419,7 +419,8 @@ |
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::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 @@ |
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() { |