summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorstuartmorgan@google.com <stuartmorgan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-10 20:42:40 +0000
committerstuartmorgan@google.com <stuartmorgan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-10 20:42:40 +0000
commita1fff11ac34494c558f9d0e1718017510a8df3ba (patch)
tree57ab5a1a5a0431f925792d37f73225b2046ca003 /webkit
parent1500e3cc0927ed8cd16b75497d2d5da3418eb6db (diff)
downloadchromium_src-a1fff11ac34494c558f9d0e1718017510a8df3ba.zip
chromium_src-a1fff11ac34494c558f9d0e1718017510a8df3ba.tar.gz
chromium_src-a1fff11ac34494c558f9d0e1718017510a8df3ba.tar.bz2
Only load whitelisted plugins on the Mac
BUG=12030 TEST=Visit a site with an unsupported plugin (e.g., QuickTime); the plugin should not be loaded at all, rather than loading and then crashing. Review URL: http://codereview.chromium.org/164272 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22951 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/plugins/plugin_list_mac.mm13
1 files changed, 10 insertions, 3 deletions
diff --git a/webkit/glue/plugins/plugin_list_mac.mm b/webkit/glue/plugins/plugin_list_mac.mm
index f675b3e..c502ea6 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.