Chromium Code Reviews| Index: webkit/glue/plugins/plugin_list_posix.cc |
| diff --git a/webkit/glue/plugins/plugin_list_posix.cc b/webkit/glue/plugins/plugin_list_posix.cc |
| index 654c0c5792fc09141be47bb51ffdef7cdc8766e4..749c20ada3d41fb7f3fb4104502c67f57ed556b8 100644 |
| --- a/webkit/glue/plugins/plugin_list_posix.cc |
| +++ b/webkit/glue/plugins/plugin_list_posix.cc |
| @@ -164,7 +164,6 @@ void PluginList::GetPluginDirectories(std::vector<FilePath>* plugin_dirs) { |
| } |
| void PluginList::LoadPluginsFromDir(const FilePath& dir_path, |
| - std::vector<WebPluginInfo>* plugins, |
| std::set<FilePath>* visited_plugins) { |
| // See ScanPluginsDirectory near |
| // http://mxr.mozilla.org/firefox/source/modules/plugin/base/src/nsPluginHostImpl.cpp#5052 |
| @@ -233,12 +232,11 @@ void PluginList::LoadPluginsFromDir(const FilePath& dir_path, |
| // Load the files in order. |
| for (FileTimeList::const_iterator i = files.begin(); i != files.end(); ++i) { |
| - LoadPlugin(i->first, plugins); |
| + LoadPlugin(i->first); |
| } |
| } |
| -bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info, |
| - std::vector<WebPluginInfo>* plugins) { |
| +bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info) { |
| LOG_IF(ERROR, PluginList::DebugPluginLoading()) |
| << "Considering " << info.path.value() << " (" << info.name << ")"; |
| @@ -247,15 +245,22 @@ bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info, |
| << info.path.value() << " is undesirable."; |
| // See if we have a better version of this plugin. |
| - for (size_t i = 0; i < plugins->size(); ++i) { |
| - if (plugins->at(i).name == info.name && |
| - !IsUndesirablePlugin(plugins->at(i))) { |
| - // Skip the current undesirable one so we can use the better one |
| - // we just found. |
| - LOG_IF(ERROR, PluginList::DebugPluginLoading()) |
| - << "Skipping " << info.path.value() << ", preferring " |
| - << plugins->at(i).path.value(); |
| - return false; |
| + std::vector<WebPluginInfo*> new_plugins; |
| + for (PluginGroup::PluginMap::iterator it = plugin_groups_.begin(); |
|
danno
2010/12/14 09:43:39
now that you have two iterators, you probably want
pastarmovj
2010/12/15 14:44:51
Done. I guess current_curent meant to be current_g
|
| + it != plugin_groups_.end(); ++it) { |
| + std::vector<WebPluginInfo>& group_plugins = it->second->GetPlugins(); |
| + for (std::vector<WebPluginInfo>::iterator itp = group_plugins.begin(); |
| + itp != group_plugins.end(); |
| + ++itp) { |
| + if (itp->name == info.name && |
| + !IsUndesirablePlugin(*itp)) { |
| + // Skip the current undesirable one so we can use the better one |
| + // we just found. |
| + LOG_IF(ERROR, PluginList::DebugPluginLoading()) |
| + << "Skipping " << info.path.value() << ", preferring " |
| + << itp->path.value(); |
| + return false; |
| + } |
| } |
| } |
| } |