Chromium Code Reviews| Index: content/renderer/pepper/pepper_plugin_delegate_impl.cc |
| =================================================================== |
| --- content/renderer/pepper/pepper_plugin_delegate_impl.cc (revision 164895) |
| +++ content/renderer/pepper/pepper_plugin_delegate_impl.cc (working copy) |
| @@ -108,17 +108,18 @@ |
| public: |
| HostDispatcherWrapper(webkit::ppapi::PluginModule* module, |
| int plugin_child_id, |
| - const ppapi::PpapiPermissions& perms) |
| + const ppapi::PpapiPermissions& perms, |
| + bool is_external) |
| : module_(module), |
| plugin_child_id_(plugin_child_id), |
| - permissions_(perms) { |
| + permissions_(perms), |
| + is_external_(is_external) { |
| } |
| virtual ~HostDispatcherWrapper() {} |
| bool Init(const IPC::ChannelHandle& channel_handle, |
| PP_GetInterface_Func local_get_interface, |
| const ppapi::Preferences& preferences, |
| - const ppapi::PpapiPermissions& permissions, |
| PepperHungPluginFilter* filter) { |
| if (channel_handle.name.empty()) |
| return false; |
| @@ -164,7 +165,8 @@ |
| render_view->Send(new ViewHostMsg_DidCreateOutOfProcessPepperInstance( |
| plugin_child_id_, |
| instance, |
| - render_view->GetRoutingID())); |
| + render_view->GetRoutingID(), |
| + is_external_)); |
| } |
| } |
| virtual void RemoveInstance(PP_Instance instance) { |
| @@ -177,7 +179,8 @@ |
| RenderView* render_view = host->GetRenderViewForInstance(instance); |
| render_view->Send(new ViewHostMsg_DidDeleteOutOfProcessPepperInstance( |
| plugin_child_id_, |
| - instance)); |
| + instance, |
| + is_external_)); |
| } |
| } |
| @@ -192,6 +195,7 @@ |
| int plugin_child_id_; |
| ppapi::PpapiPermissions permissions_; |
| + bool is_external_; |
| scoped_ptr<ppapi::proxy::HostDispatcher> dispatcher_; |
| scoped_ptr<ppapi::proxy::ProxyChannel::Delegate> dispatcher_delegate_; |
| @@ -393,10 +397,14 @@ |
| permissions); |
| PepperPluginRegistry::GetInstance()->AddLiveModule(path, module); |
| - if (!CreateOutOfProcessModule( |
| - module, path, permissions, channel_handle, plugin_child_id)) { |
| + if (!CreateOutOfProcessModule(module, |
| + path, |
| + permissions, |
| + channel_handle, |
| + plugin_child_id, |
| + false)) // is_external = false |
| return scoped_refptr<webkit::ppapi::PluginModule>(); |
| - } |
| + |
| return module; |
| } |
| @@ -408,10 +416,12 @@ |
| int plugin_child_id) { |
| // We don't call PepperPluginRegistry::AddLiveModule, as this module is |
| // managed externally. |
| - // TODO(bbudge) pass plugin_child_id when PpapiPluginProcessHost receives |
| - // a message notifying it that the external plugin process has been created. |
| - return CreateOutOfProcessModule( |
| - module, path, permissions, channel_handle, 0); |
| + return CreateOutOfProcessModule(module, |
| + path, |
| + permissions, |
| + channel_handle, |
| + plugin_child_id, |
| + true); // is_external = true |
| } |
| scoped_refptr<PepperBrokerImpl> PepperPluginDelegateImpl::CreateBroker( |
| @@ -446,18 +456,21 @@ |
| const FilePath& path, |
| ppapi::PpapiPermissions permissions, |
| const IPC::ChannelHandle& channel_handle, |
| - int plugin_child_id) { |
| + int plugin_child_id, |
| + bool is_external) { |
| scoped_refptr<PepperHungPluginFilter> hung_filter( |
| new PepperHungPluginFilter(path, |
| render_view_->routing_id(), |
| plugin_child_id)); |
| scoped_ptr<HostDispatcherWrapper> dispatcher( |
| - new HostDispatcherWrapper(module, plugin_child_id, permissions)); |
| + new HostDispatcherWrapper(module, |
| + plugin_child_id, |
| + permissions, |
| + is_external)); |
| if (!dispatcher->Init( |
| channel_handle, |
| webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(), |
| GetPreferences(), |
| - permissions, |
|
bbudge
2012/10/31 23:05:14
Removed unused parameter. It's passed in the ctor.
|
| hung_filter.get())) |
| return NULL; |