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

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

Issue 10860044: 1st CL in a series to remove PluginGroup. Updates PluginList. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 1st CL in series to delete PluginGroup. Updates PluginList only. Created 8 years, 4 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_win.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 ed475ff028f521977435bf20966b61cc85088b43..974a42361aee4da66698527728f96aeb29cd0e54 100644
--- a/webkit/plugins/npapi/plugin_list_posix.cc
+++ b/webkit/plugins/npapi/plugin_list_posix.cc
@@ -266,6 +266,7 @@ void PluginList::GetPluginsInDir(
}
}
+// TODO(ibraaaa): DELETE. http://crbug.com/124396
bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info,
ScopedVector<PluginGroup>* plugin_groups) {
LOG_IF(ERROR, PluginList::DebugPluginLoading())
@@ -300,5 +301,35 @@ bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info,
return true;
}
+bool PluginList::ShouldLoadPluginUsingPluginList(
+ const WebPluginInfo& info, std::vector<webkit::WebPluginInfo>* plugins) {
+ LOG_IF(ERROR, PluginList::DebugPluginLoading())
+ << "Considering " << info.path.value() << " (" << info.name << ")";
+
+ if (IsUndesirablePlugin(info)) {
+ LOG_IF(ERROR, PluginList::DebugPluginLoading())
+ << info.path.value() << " is undesirable.";
+
+ // See if we have a better version of this plugin.
+ 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;
+ }
+ }
+ }
+
+ // TODO(evanm): prefer the newest version of flash, etc. here?
+
+ VLOG_IF(1, PluginList::DebugPluginLoading()) << "Using " << info.path.value();
+
+ return true;
+}
+
} // namespace npapi
} // namespace webkit
« no previous file with comments | « webkit/plugins/npapi/plugin_list_mac.mm ('k') | webkit/plugins/npapi/plugin_list_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698