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

Unified Diff: webkit/plugins/npapi/plugin_list_posix.cc

Issue 5699005: Policy: Re-enabled plugin still disabled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Whitespace fixes only. Trybot happiness still applies. Created 9 years, 11 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 | « webkit/plugins/npapi/plugin_list_mac.mm ('k') | webkit/plugins/npapi/plugin_list_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/npapi/plugin_list_posix.cc
diff --git a/webkit/plugins/npapi/plugin_list_posix.cc b/webkit/plugins/npapi/plugin_list_posix.cc
index fd5e5b7b8985bc2664adb26b60aaad9bdec57c4d..f861fc53671ffa1737d2263885e18ee3c4ad8eb8 100644
--- a/webkit/plugins/npapi/plugin_list_posix.cc
+++ b/webkit/plugins/npapi/plugin_list_posix.cc
@@ -165,7 +165,7 @@ void PluginList::GetPluginDirectories(std::vector<FilePath>* plugin_dirs) {
}
void PluginList::LoadPluginsFromDir(const FilePath& dir_path,
- std::vector<WebPluginInfo>* plugins,
+ ScopedVector<PluginGroup>* plugin_groups,
std::set<FilePath>* visited_plugins) {
// See ScanPluginsDirectory near
// http://mxr.mozilla.org/firefox/source/modules/plugin/base/src/nsPluginHostImpl.cpp#5052
@@ -234,12 +234,12 @@ 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, plugin_groups);
}
}
bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info,
- std::vector<WebPluginInfo>* plugins) {
+ ScopedVector<PluginGroup>* plugin_groups) {
LOG_IF(ERROR, PluginList::DebugPluginLoading())
<< "Considering " << info.path.value() << " (" << info.name << ")";
@@ -248,15 +248,19 @@ 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;
+ for (size_t i = 0; i < plugin_groups->size(); ++i) {
+ const std::vector<WebPluginInfo>& plugins =
+ (*plugin_groups)[i]->web_plugins_info();
+ for (size_t j = 0; j < plugins.size(); ++j) {
+ if (plugins[j].name == info.name &&
+ !IsUndesirablePlugin(plugins[j])) {
+ // 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[j].path.value();
+ return false;
+ }
}
}
}
« no previous file with comments | « webkit/plugins/npapi/plugin_list_mac.mm ('k') | webkit/plugins/npapi/plugin_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698