Index: content/browser/plugin_service.cc |
=================================================================== |
--- content/browser/plugin_service.cc (revision 101488) |
+++ content/browser/plugin_service.cc (working copy) |
@@ -240,7 +240,8 @@ |
return plugin_host; |
// Validate that the plugin is actually registered. |
- PepperPluginInfo* info = GetRegisteredPpapiPluginInfo(plugin_path); |
+ const webkit::ppapi::PluginInfo* info = |
+ GetRegisteredPpapiPluginInfo(plugin_path); |
if (!info) |
return NULL; |
@@ -263,7 +264,8 @@ |
return plugin_host; |
// Validate that the plugin is actually registered. |
- PepperPluginInfo* info = GetRegisteredPpapiPluginInfo(plugin_path); |
+ const webkit::ppapi::PluginInfo* info = |
+ GetRegisteredPpapiPluginInfo(plugin_path); |
if (!info) |
return NULL; |
@@ -480,40 +482,19 @@ |
} |
void PluginService::RegisterPepperPlugins() { |
- // TODO(abarth): It seems like the PepperPluginRegistry should do this work. |
PepperPluginRegistry::ComputeList(&ppapi_plugins_); |
+ ppapi_plugins_.RegisterAll(); |
+ /*webkit::ppapi::PluginRegistry::ComputeList(&ppapi_plugins_); |
for (size_t i = 0; i < ppapi_plugins_.size(); ++i) { |
webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin( |
ppapi_plugins_[i].ToWebPluginInfo()); |
- } |
+ }*/ |
} |
// There should generally be very few plugins so a brute-force search is fine. |
-PepperPluginInfo* PluginService::GetRegisteredPpapiPluginInfo( |
+const webkit::ppapi::PluginInfo* PluginService::GetRegisteredPpapiPluginInfo( |
const FilePath& plugin_path) { |
- PepperPluginInfo* info = NULL; |
- for (size_t i = 0; i < ppapi_plugins_.size(); i++) { |
- if (ppapi_plugins_[i].path == plugin_path) { |
- info = &ppapi_plugins_[i]; |
- break; |
- } |
- } |
- if (info) |
- return info; |
- // We did not find the plugin in our list. But wait! the plugin can also |
- // be a latecomer, as it happens with pepper flash. This information |
- // can be obtained from the PluginList singleton and we can use it to |
- // construct it and add it to the list. This same deal needs to be done |
- // in the renderer side in PepperPluginRegistry. |
- webkit::WebPluginInfo webplugin_info; |
- if (!webkit::npapi::PluginList::Singleton()->GetPluginInfoByPath( |
- plugin_path, &webplugin_info)) |
- return NULL; |
- PepperPluginInfo new_pepper_info; |
- if (!MakePepperPluginInfo(webplugin_info, &new_pepper_info)) |
- return NULL; |
- ppapi_plugins_.push_back(new_pepper_info); |
- return &ppapi_plugins_[ppapi_plugins_.size() - 1]; |
+ return ppapi_plugins_.GetInfoForPlugin(plugin_path); |
} |
#if defined(OS_POSIX) && !defined(OS_MACOSX) |