Index: webkit/glue/plugins/plugin_list_win.cc |
diff --git a/webkit/glue/plugins/plugin_list_win.cc b/webkit/glue/plugins/plugin_list_win.cc |
index 486926251b8cb48774389c3a4d9e8824307a2c25..4c854b93721d1bab941cf86399b6e0a33b54233c 100644 |
--- a/webkit/glue/plugins/plugin_list_win.cc |
+++ b/webkit/glue/plugins/plugin_list_win.cc |
@@ -270,9 +270,8 @@ void PluginList::LoadPluginsFromDir(const FilePath &path, |
FindClose(find_handle); |
} |
-void PluginList::LoadPluginsFromRegistry( |
- std::vector<WebPluginInfo>* plugins, |
- std::set<FilePath>* visited_plugins) { |
+void PluginList::LoadPluginsFromRegistry(std::set<FilePath>* visited_plugins, |
+ std::vector<WebPluginInfo>* plugins) { |
std::set<FilePath> plugin_dirs; |
GetPluginsInRegistryDirectory( |
@@ -333,18 +332,22 @@ bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info, |
std::vector<WebPluginInfo>* plugins) { |
// Version check |
- for (size_t i = 0; i < plugins->size(); ++i) { |
+ for (std::vector<WebPluginInfo>::iterator it = plugins->begin(); |
jam
2010/12/17 19:14:45
please leave as before
pastarmovj
2010/12/20 19:57:37
Done.
|
+ it != plugins->end(); |
+ ++it) { |
std::wstring plugin1 = |
- StringToLowerASCII((*plugins)[i].path.BaseName().ToWStringHack()); |
+ StringToLowerASCII(it->path.BaseName().ToWStringHack()); |
std::wstring plugin2 = |
StringToLowerASCII(info.path.BaseName().ToWStringHack()); |
- if ((plugin1 == plugin2 && HaveSharedMimeType((*plugins)[i], info)) || |
+ if ((plugin1 == plugin2 && HaveSharedMimeType(*it, info)) || |
(plugin1 == kJavaDeploy1 && plugin2 == kJavaDeploy2) || |
(plugin1 == kJavaDeploy2 && plugin2 == kJavaDeploy1)) { |
- if (!IsNewerVersion((*plugins)[i].version, info.version)) |
+ if (!IsNewerVersion(it->version, info.version)) |
return false; // We have loaded a plugin whose version is newer. |
- plugins->erase(plugins->begin() + i); |
+ // TODO(pastarmovj): We can't just remove it like that. We could possibly |
+ // disable it first. |
+ plugins->erase(it); |
break; |
} |
} |
@@ -391,15 +394,21 @@ bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info, |
if (dont_load_new_wmp_) |
return false; |
- for (size_t i = 0; i < plugins->size(); ++i) { |
- if ((*plugins)[i].path.BaseName().value() == kOldWMPPlugin) { |
- plugins->erase(plugins->begin() + i); |
+ for (std::vector<WebPluginInfo>::iterator it = plugins->begin(); |
jam
2010/12/17 19:14:45
please leave as before
pastarmovj
2010/12/20 19:57:37
Done.
|
+ it != plugins->end(); |
+ ++it) { |
+ if (it->path.BaseName().value() == kOldWMPPlugin) { |
+ // TODO(pastarmovj): We can't just remove it like that. We could |
+ // possibly disable it first. |
jam
2010/12/17 19:14:45
why can't we remove it like this? why is this a T
pastarmovj
2010/12/20 19:57:37
Now we can again :)
|
+ plugins->erase(it); |
break; |
} |
} |
} else if (filename == kOldWMPPlugin) { |
- for (size_t i = 0; i < plugins->size(); ++i) { |
- if ((*plugins)[i].path.BaseName().value() == kNewWMPPlugin) |
+ for (std::vector<WebPluginInfo>::iterator it = plugins->begin(); |
jam
2010/12/17 19:14:45
please leave as before
pastarmovj
2010/12/20 19:57:37
Done.
|
+ it != plugins->end(); |
+ ++it) { |
+ if (it->path.BaseName().value() == kNewWMPPlugin) |
return false; |
} |
} |