Bug 1317110 - Remove QuickTime plugin quirks handling. r=jimm
authorChris Peterson <cpeterson@mozilla.com>
Mon, 14 Nov 2016 22:08:43 -0800
changeset 439827 6abf12a9d408803d49f8cae81ff6a64230198c51
parent 439826 c8f05f715087777d0e7bc46de4a5fbc2c99d364b
child 439828 af3eb6a8e0ae5d925fda8d2f9dda039ed6d0a9ac
push id36113
push userbmo:afarre@mozilla.com
push dateWed, 16 Nov 2016 18:15:04 +0000
reviewersjimm
bugs1317110
milestone53.0a1
Bug 1317110 - Remove QuickTime plugin quirks handling. r=jimm
dom/plugins/base/nsPluginDirServiceProvider.cpp
dom/plugins/base/nsPluginDirServiceProvider.h
dom/plugins/base/nsPluginHost.cpp
dom/plugins/ipc/PluginInstanceChild.cpp
dom/plugins/ipc/PluginInstanceParent.cpp
dom/plugins/ipc/PluginQuirks.cpp
dom/plugins/ipc/PluginQuirks.h
ipc/glue/WindowsMessageLoop.cpp
modules/libpref/init/all.js
--- a/dom/plugins/base/nsPluginDirServiceProvider.cpp
+++ b/dom/plugins/base/nsPluginDirServiceProvider.cpp
@@ -206,57 +206,17 @@ nsPluginDirServiceProvider::GetFile(cons
 
   *_retval = nullptr;
   *persistant = false;
 
   nsCOMPtr<nsIWindowsRegKey> regKey =
     do_CreateInstance("@mozilla.org/windows-registry-key;1");
   NS_ENSURE_TRUE(regKey, NS_ERROR_FAILURE);
 
-  if (nsCRT::strcmp(charProp, NS_WIN_QUICKTIME_SCAN_KEY) == 0) {
-    nsAdoptingCString strVer = Preferences::GetCString(charProp);
-    if (!strVer) {
-      return NS_ERROR_FAILURE;
-    }
-    verBlock minVer;
-    TranslateVersionStr(NS_ConvertASCIItoUTF16(strVer).get(), &minVer);
-
-    // Look for the Quicktime system installation plugins directory
-    verBlock qtVer;
-    ClearVersion(&qtVer);
-
-    // First we need to check the version of Quicktime via checking
-    // the EXE's version table
-    rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_LOCAL_MACHINE,
-                      NS_LITERAL_STRING("software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\QuickTimePlayer.exe"),
-                      nsIWindowsRegKey::ACCESS_READ);
-    if (NS_SUCCEEDED(rv)) {
-      nsAutoString path;
-      rv = regKey->ReadStringValue(NS_LITERAL_STRING(""), path);
-      if (NS_SUCCEEDED(rv)) {
-        GetFileVersion(path.get(), &qtVer);
-      }
-      regKey->Close();
-    }
-    if (CompareVersion(qtVer, minVer) < 0)
-      return rv;
-
-    rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_LOCAL_MACHINE,
-                      NS_LITERAL_STRING("software\\Apple Computer, Inc.\\QuickTime"),
-                      nsIWindowsRegKey::ACCESS_READ);
-    if (NS_SUCCEEDED(rv)) {
-      nsAutoString path;
-      rv = regKey->ReadStringValue(NS_LITERAL_STRING("InstallDir"), path);
-      if (NS_SUCCEEDED(rv)) {
-        path += NS_LITERAL_STRING("\\Plugins");
-        rv = NS_NewLocalFile(path, true,
-                             getter_AddRefs(localFile));
-      }
-    }
-  } else if (nsCRT::strcmp(charProp, NS_WIN_WMP_SCAN_KEY) == 0) {
+  if (nsCRT::strcmp(charProp, NS_WIN_WMP_SCAN_KEY) == 0) {
     nsAdoptingCString strVer = Preferences::GetCString(charProp);
     if (!strVer) {
       return NS_ERROR_FAILURE;
     }
     verBlock minVer;
     TranslateVersionStr(NS_ConvertASCIItoUTF16(strVer).get(), &minVer);
 
     // Look for Windows Media Player system installation plugins directory
--- a/dom/plugins/base/nsPluginDirServiceProvider.h
+++ b/dom/plugins/base/nsPluginDirServiceProvider.h
@@ -11,17 +11,16 @@
 #if defined (XP_WIN)
 #include "nsCOMArray.h"
 #endif
 
 class nsISimpleEnumerator;
 
 // Note: Our directory service provider scan keys are prefs which are check
 //       for minimum versions compatibility
-#define NS_WIN_QUICKTIME_SCAN_KEY      "plugin.scan.Quicktime"
 #define NS_WIN_WMP_SCAN_KEY            "plugin.scan.WindowsMediaPlayer"
 
 //*****************************************************************************
 // class nsPluginDirServiceProvider
 //*****************************************************************************   
 
 class nsPluginDirServiceProvider : public nsIDirectoryServiceProvider
 {
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -2550,18 +2550,17 @@ nsresult nsPluginHost::FindPlugins(bool 
       }
     }
   }
 
 
   // Scan the installation paths of our popular plugins if the prefs are enabled
 
   // This table controls the order of scanning
-  const char* const prefs[] = {NS_WIN_QUICKTIME_SCAN_KEY,
-                               NS_WIN_WMP_SCAN_KEY};
+  const char* const prefs[] = {NS_WIN_WMP_SCAN_KEY};
 
   uint32_t size = sizeof(prefs) / sizeof(prefs[0]);
 
   for (uint32_t i = 0; i < size; i+=1) {
     nsCOMPtr<nsIFile> dirToScan;
     bool bExists;
     if (NS_SUCCEEDED(dirService->Get(prefs[i], NS_GET_IID(nsIFile), getter_AddRefs(dirToScan))) &&
         dirToScan &&
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -1352,21 +1352,16 @@ PluginInstanceChild::AnswerNPP_SetWindow
 
     if (mPluginIface->setwindow)
         (void) mPluginIface->setwindow(&mData, &mWindow);
 
 #elif defined(OS_WIN)
     switch (aWindow.type) {
       case NPWindowTypeWindow:
       {
-          // This check is now done in PluginInstanceParent before this call, so
-          // we should never see it here.
-          MOZ_ASSERT(!(GetQuirks() & QUIRK_QUICKTIME_AVOID_SETWINDOW) ||
-                     aWindow.width != 0 || aWindow.height != 0);
-
           MOZ_ASSERT(mPluginWindowHWND,
                      "Child plugin window must exist before call to SetWindow");
 
           HWND parentHWND =  reinterpret_cast<HWND>(aWindow.window);
           if (mPluginWindowHWND != parentHWND) {
               mPluginParentHWND = parentHWND;
               ShowWindow(mPluginWindowHWND, SW_SHOWNA);
           }
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -1332,22 +1332,16 @@ PluginInstanceParent::NPP_SetWindow(cons
 
 #if defined(OS_WIN)
     // On windowless controls, reset the shared memory surface as needed.
     if (mWindowType == NPWindowTypeDrawable) {
         MaybeCreateChildPopupSurrogate();
     } else {
         SubclassPluginWindow(reinterpret_cast<HWND>(aWindow->window));
 
-        // Skip SetWindow call for hidden QuickTime plugins.
-        if ((mParent->GetQuirks() & QUIRK_QUICKTIME_AVOID_SETWINDOW) &&
-            aWindow->width == 0 && aWindow->height == 0) {
-            return NPERR_NO_ERROR;
-        }
-
         window.window = reinterpret_cast<uint64_t>(aWindow->window);
         window.x = aWindow->x;
         window.y = aWindow->y;
         window.width = aWindow->width;
         window.height = aWindow->height;
         window.type = aWindow->type;
 
         // On Windows we need to create and set the parent before we set the
--- a/dom/plugins/ipc/PluginQuirks.cpp
+++ b/dom/plugins/ipc/PluginQuirks.cpp
@@ -36,31 +36,20 @@ int GetQuirksFromMimeTypeAndFilename(con
         quirks |= QUIRK_FLASH_FIXUP_MOUSE_CAPTURE;
         quirks |= QUIRK_WINLESS_HOOK_IME;
 #if defined(_M_X64) || defined(__x86_64__)
         quirks |= QUIRK_FLASH_HOOK_GETKEYSTATE;
 #endif
 #endif
     }
 
-#ifdef OS_WIN
-    // QuickTime plugin usually loaded with audio/mpeg mimetype
-    NS_NAMED_LITERAL_CSTRING(quicktime, "npqtplugin");
-    if (FindInReadable(quicktime, aPluginFilename)) {
-        quirks |= QUIRK_QUICKTIME_AVOID_SETWINDOW;
-    }
-#endif
-
 #ifdef XP_MACOSX
-    // Whitelist Flash and Quicktime to support offline renderer
-    NS_NAMED_LITERAL_CSTRING(quicktime, "QuickTime Plugin.plugin");
+    // Whitelist Flash to support offline renderer.
     if (specialType == nsPluginHost::eSpecialType_Flash) {
         quirks |= QUIRK_ALLOW_OFFLINE_RENDERER;
-    } else if (FindInReadable(quicktime, aPluginFilename)) {
-        quirks |= QUIRK_ALLOW_OFFLINE_RENDERER;
     }
 #endif
 
 #ifdef OS_WIN
     if (specialType == nsPluginHost::eSpecialType_Unity) {
         quirks |= QUIRK_UNITY_FIXUP_MOUSE_CAPTURE;
     }
 #endif
--- a/dom/plugins/ipc/PluginQuirks.h
+++ b/dom/plugins/ipc/PluginQuirks.h
@@ -32,19 +32,16 @@ enum PluginQuirks {
   QUIRK_FLASH_EXPOSE_COORD_TRANSLATION            = 1 << 4,
   // Win32: Catch get window info calls on the browser and tweak the
   // results so mouse input works when flash is displaying it's settings
   // window.
   QUIRK_FLASH_HOOK_GETWINDOWINFO                  = 1 << 5,
   // Win: Addresses a flash bug with mouse capture and full screen
   // windows.
   QUIRK_FLASH_FIXUP_MOUSE_CAPTURE                 = 1 << 6,
-  // Win: QuickTime steals focus on SetWindow calls even if it's hidden.
-  // Avoid calling SetWindow in that case.
-  QUIRK_QUICKTIME_AVOID_SETWINDOW                 = 1 << 7,
   // Win: Check to make sure the parent window has focus before calling
   // set focus on the child. Addresses a full screen dialog prompt
   // problem in Silverlight.
   QUIRK_SILVERLIGHT_FOCUS_CHECK_PARENT            = 1 << 8,
   // Mac: Allow the plugin to use offline renderer mode.
   // Use this only if the plugin is certified the support the offline renderer.
   QUIRK_ALLOW_OFFLINE_RENDERER                    = 1 << 9,
   // Work around a Flash bug where it fails to check the error code of a
--- a/ipc/glue/WindowsMessageLoop.cpp
+++ b/ipc/glue/WindowsMessageLoop.cpp
@@ -489,20 +489,18 @@ WindowIsDeferredWindow(HWND hWnd)
       StringBeginsWith(className, NS_LITERAL_STRING("Gecko")) ||
       className.EqualsLiteral("nsToolkitClass") ||
       className.EqualsLiteral("nsAppShell:EventWindowClass")) {
     return true;
   }
 
   // Plugin windows that can trigger ipc calls in child:
   // 'ShockwaveFlashFullScreen' - flash fullscreen window
-  // 'QTNSHIDDEN' - QuickTime
   // 'AGFullScreenWinClass' - silverlight fullscreen window
   if (className.EqualsLiteral("ShockwaveFlashFullScreen") ||
-      className.EqualsLiteral("QTNSHIDDEN") ||
       className.EqualsLiteral("AGFullScreenWinClass")) {
     SetPropW(hWnd, k3rdPartyWindowProp, (HANDLE)1);
     return true;
   }
 
   // Google Earth bridging msg window between the plugin instance and a separate
   // earth process. The earth process can trigger a plugin incall on the browser
   // at any time, which is badness if the instance is already making an incall.
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -3430,19 +3430,16 @@ pref("slider.snapMultiplier", 6);
 
 // print_extra_margin enables platforms to specify an extra gap or margin
 // around the content of the page for Print Preview only
 pref("print.print_extra_margin", 90); // twips (90 twips is an eigth of an inch)
 
 // Whether to extend the native dialog with information on printing frames.
 pref("print.extend_native_print_dialog", true);
 
-// Locate plugins by scanning the Quicktime installation directory with a minimum version
-pref("plugin.scan.Quicktime", "5.0");
-
 // Locate and scan the Window Media Player installation directory for plugins with a minimum version
 pref("plugin.scan.WindowsMediaPlayer", "7.0");
 
 // Locate plugins by the directories specified in the Windows registry for PLIDs
 // Which is currently HKLM\Software\MozillaPlugins\xxxPLIDxxx\Path
 pref("plugin.scan.plid.all", true);
 
 // Whether sending WM_MOUSEWHEEL and WM_MOUSEHWHEEL to plugins on Windows.