diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-02 04:51:16 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-02 04:51:16 +0000 |
commit | cb7defb5f3b1ea748d037150f4099b0dbdc39243 (patch) | |
tree | 4fcc5076e7e1cca510bc3d7918834c7a3ce0d935 /chrome/renderer/pepper_plugin_delegate_impl.cc | |
parent | 3075f39b490ed83e41c802b250b6e4f68557304e (diff) | |
download | chromium_src-cb7defb5f3b1ea748d037150f4099b0dbdc39243.zip chromium_src-cb7defb5f3b1ea748d037150f4099b0dbdc39243.tar.gz chromium_src-cb7defb5f3b1ea748d037150f4099b0dbdc39243.tar.bz2 |
Set the name of the PPAPI plugin properly when running out of process. This
also does some refactoring of the plugin registry to make it more clear and to
avoid recomputilg the plugin list all the time.
Review URL: http://codereview.chromium.org/6246031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73427 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/pepper_plugin_delegate_impl.cc')
-rw-r--r-- | chrome/renderer/pepper_plugin_delegate_impl.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/chrome/renderer/pepper_plugin_delegate_impl.cc b/chrome/renderer/pepper_plugin_delegate_impl.cc index 2d3a23e..59c89f2 100644 --- a/chrome/renderer/pepper_plugin_delegate_impl.cc +++ b/chrome/renderer/pepper_plugin_delegate_impl.cc @@ -390,13 +390,16 @@ scoped_refptr<webkit::ppapi::PluginModule> PepperPluginDelegateImpl::CreatePepperPlugin(const FilePath& path) { // See if a module has already been loaded for this plugin. scoped_refptr<webkit::ppapi::PluginModule> module = - PepperPluginRegistry::GetInstance()->GetModule(path); + PepperPluginRegistry::GetInstance()->GetLiveModule(path); if (module) return module; // In-process plugins will have always been created up-front to avoid the - // sandbox restrictions. - if (!PepperPluginRegistry::GetInstance()->RunOutOfProcessForPlugin(path)) + // sandbox restrictions. So gettin here implies it doesn't exist or should + // be out of process. + const PepperPluginInfo* info = + PepperPluginRegistry::GetInstance()->GetInfoForPlugin(path); + if (!info || !info->is_out_of_process) return module; // Return the NULL module. // Out of process: have the browser start the plugin process for us. @@ -412,7 +415,8 @@ PepperPluginDelegateImpl::CreatePepperPlugin(const FilePath& path) { // Create a new HostDispatcher for the proxying, and hook it to a new // PluginModule. Note that AddLiveModule must be called before any early // returns since the module's destructor will remove itself. - module = new webkit::ppapi::PluginModule(PepperPluginRegistry::GetInstance()); + module = new webkit::ppapi::PluginModule(info->name, + PepperPluginRegistry::GetInstance()); PepperPluginRegistry::GetInstance()->AddLiveModule(path, module); scoped_ptr<DispatcherWrapper> dispatcher(new DispatcherWrapper); if (!dispatcher->Init( |