Chromium Code Reviews| Index: webkit/plugins/ppapi/plugin_module.cc |
| =================================================================== |
| --- webkit/plugins/ppapi/plugin_module.cc (revision 143163) |
| +++ 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,10 @@ |
| } |
| 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); |
| + 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 +562,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; |
| + } |
|
dmichael (off chromium)
2012/06/21 18:18:16
As we discussed, this is not going to work for mul
bbudge
2012/06/21 19:28:18
I'll add a TODO for this. PluginModule is already
|
| } |
| scoped_refptr< ::ppapi::CallbackTracker> PluginModule::GetCallbackTracker() { |
| @@ -581,11 +588,11 @@ |
| void PluginModule::SetReserveInstanceIDCallback( |
| PP_Bool (*reserve)(PP_Module, PP_Instance)) { |
| - DCHECK(!reserve_instance_id_) << "Only expect one set."; |
| reserve_instance_id_ = reserve; |
| } |
| bool PluginModule::ReserveInstanceID(PP_Instance instance) { |
| + DCHECK(!reserve_instance_id_) << "Only expect one set."; |
|
dmichael (off chromium)
2012/06/21 18:18:16
Why did you move this check? It doesn't make sense
bbudge
2012/06/21 19:28:18
The HostDispatcher sets it and it can be set multi
dmichael (off chromium)
2012/06/21 19:42:30
So that would argue for simply removing the check.
|
| if (reserve_instance_id_) |
| return PPBoolToBool(reserve_instance_id_(pp_module_, instance)); |
| return true; // Instance ID is usable. |