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

Unified Diff: webkit/glue/plugins/plugin_list_mac.mm

Issue 164272: Only load whitelisted plugins on the Mac (Closed)
Patch Set: Created 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/plugin_list_mac.mm
diff --git a/webkit/glue/plugins/plugin_list_mac.mm b/webkit/glue/plugins/plugin_list_mac.mm
index f675b3e69698040251c540e1ad2bc91e162ef76f..c502ea64090d4e593e89e0e39907b4f40d294164 100644
--- a/webkit/glue/plugins/plugin_list_mac.mm
+++ b/webkit/glue/plugins/plugin_list_mac.mm
@@ -8,6 +8,7 @@
#include "base/file_util.h"
#include "base/mac_util.h"
+#include "base/string_util.h"
#include "webkit/glue/plugins/plugin_lib.h"
namespace {
@@ -66,12 +67,18 @@ void PluginList::LoadPluginsFromDir(const FilePath &path) {
}
bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info) {
+ // For now, only load plugins that we know are working reasonably well.
+ // Anything using QuickDraw-based drawing, for example, would crash
+ // immediately.
+ std::string plugin_name = WideToUTF8(info.name);
+ if (!(plugin_name == "Shockwave Flash" || // CG drawing + Carbon events.
+ plugin_name == "Picasa")) { // No drawing or event handling.
+ return false;
+ }
+
// Hierarchy check
// (we're loading plugins hierarchically from Library folders, so plugins we
// encounter earlier must override plugins we encounter later)
-
- // first, test to make sure the user really wants plugins
-
for (size_t i = 0; i < plugins_.size(); ++i) {
if (plugins_[i].path.BaseName() == info.path.BaseName()) {
return false; // We already have a loaded plugin higher in the hierarchy.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698