From 82cc827da881b7258225c9022d91a1819a2ee157 Mon Sep 17 00:00:00 2001 From: Benjamin Smedberg Date: Tue, 3 Jul 2012 17:04:45 -0400 Subject: [PATCH] Bug 769721 - Minimal patch to force OOPP mode on for Windows Vista+ users, because Flash is not tested with the IPP configuration and has known bugs, r=josh --- dom/plugins/base/nsNPAPIPlugin.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dom/plugins/base/nsNPAPIPlugin.cpp b/dom/plugins/base/nsNPAPIPlugin.cpp index 6013c33fc34..c2fd9766d2f 100644 --- a/dom/plugins/base/nsNPAPIPlugin.cpp +++ b/dom/plugins/base/nsNPAPIPlugin.cpp @@ -281,6 +281,20 @@ static bool GMA9XXGraphics() } #endif +#ifdef XP_WIN +static bool +IsVistaOrLater() +{ + OSVERSIONINFO info; + + ZeroMemory(&info, sizeof(OSVERSIONINFO)); + info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&info); + + return info.dwMajorVersion >= 6; +} +#endif + bool nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag) { @@ -292,6 +306,14 @@ nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag) return false; } +#ifdef XP_WIN + // On Windows Vista+, we force Flash to run in OOPP mode because Adobe + // doesn't test Flash in-process and there are known stability bugs. + if (aPluginTag->mIsFlashPlugin && IsVistaOrLater()) { + return true; + } +#endif + #if defined(XP_MACOSX) && defined(__i386__) // Only allow on Mac OS X 10.6 or higher. if (OSXVersion() < 0x00001060) {