Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(796)

Unified Diff: content/browser/plugin_service.cc

Issue 7978009: Split ppapi::PluginList from PepperPluginRegistry so that DRT could load pepper plugins. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/plugin_service.h ('k') | content/browser/ppapi_broker_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « content/browser/plugin_service.h ('k') | content/browser/ppapi_broker_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698