From b84fa3a98d1a38d10a25b54d621d07c28e5a39d4 Mon Sep 17 00:00:00 2001 From: "thestig@chromium.org" Date: Tue, 11 May 2010 21:22:05 +0000 Subject: Linux: Blacklist the gecko-mediaplayer plugin. It sometimes hangs/crashes the browser. BUG=24507 TEST=none Review URL: http://codereview.chromium.org/2014013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46963 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/glue/plugins/plugin_list_posix.cc | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'webkit/glue') diff --git a/webkit/glue/plugins/plugin_list_posix.cc b/webkit/glue/plugins/plugin_list_posix.cc index 0daa4b5..355c2ec 100644 --- a/webkit/glue/plugins/plugin_list_posix.cc +++ b/webkit/glue/plugins/plugin_list_posix.cc @@ -42,17 +42,36 @@ bool CompareTime(const FileAndTime& a, const FileAndTime& b) { // use a "undesirable" plugin if no other option is available. bool IsUndesirablePlugin(const WebPluginInfo& info) { std::string filename = info.path.BaseName().value(); - return (filename.find("npcxoffice") != std::string::npos || // Crossover - filename.find("npwrapper") != std::string::npos); // nspluginwrapper + const char* kUndesiredPlugins[] = { + "npcxoffice", // Crossover + "npwrapper", // nspluginwrapper + }; + for (size_t i = 0; i < arraysize(kUndesiredPlugins); i++) { + if (filename.find(kUndesiredPlugins[i]) != std::string::npos) { + return true; + } + } + return false; } // Return true if we shouldn't load a plugin at all. // This is an ugly hack to blacklist Adobe Acrobat due to not supporting // its Xt-based mainloop. // http://code.google.com/p/chromium/issues/detail?id=38229 +// The gecko-mediaplayer plugins also crashes the entire browser sometimes. +// http://code.google.com/p/chromium/issues/detail?id=24507 bool IsBlacklistedPlugin(const WebPluginInfo& info) { + const char* kBlackListedPlugins[] = { + "nppdf.so", // Adobe PDF + "gecko-mediaplayer", // Gecko Media Player + }; std::string filename = info.path.BaseName().value(); - return filename.find("nppdf.so") != std::string::npos; + for (size_t i = 0; i < arraysize(kBlackListedPlugins); i++) { + if (filename.find(kBlackListedPlugins[i]) != std::string::npos) { + return true; + } + } + return false; } } // anonymous namespace -- cgit v1.1