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

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

Issue 5699005: Policy: Re-enabled plugin still disabled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Plugin reloading works completely now. Lint made happy as well. Created 10 years 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
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..b2a7945e6597ad9e1dca29a97d925ae5273bb939 100644
--- a/webkit/glue/plugins/plugin_list_posix.cc
+++ b/webkit/glue/plugins/plugin_list_posix.cc
@@ -164,7 +164,7 @@ void PluginList::GetPluginDirectories(std::vector<FilePath>* plugin_dirs) {
}
void PluginList::LoadPluginsFromDir(const FilePath& dir_path,
- std::vector<WebPluginInfo>* plugins,
+ 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
@@ -238,7 +238,7 @@ void PluginList::LoadPluginsFromDir(const FilePath& dir_path,
}
bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info,
- std::vector<WebPluginInfo>* plugins) {
+ std::vector<WebPluginInfo*>* plugins) {
LOG_IF(ERROR, PluginList::DebugPluginLoading())
<< "Considering " << info.path.value() << " (" << info.name << ")";
@@ -247,14 +247,16 @@ 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))) {
+ for (std::vector<WebPluginInfo*>::iterator it = plugins->begin();
+ it != plugins->end();
+ ++it) {
+ if ((*it)->name == info.name &&
+ !IsUndesirablePlugin(**it)) {
// 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();
+ << (*it)->path.value();
return false;
}
}

Powered by Google App Engine
This is Rietveld 408576698