Back out bug 1131136 part A (revision 9101eb40b8a6 and 9733e78176b2) for assertion failures on a CLOSED TREE
authorBenjamin Smedberg <benjamin@smedbergs.us>
Tue, 10 Feb 2015 13:28:25 -0500
changeset 228468 19cbffb1bf61413cbc185a92da3277f87ca0f409
parent 228467 ce051d575b45cf8e1c6b380859b351583cb79203
child 228469 ee093ca706662491d356484bf729ef32d55bc19c
push idunknown
push userunknown
push dateunknown
bugs1131136
milestone38.0a1
Back out bug 1131136 part A (revision 9101eb40b8a6 and 9733e78176b2) for assertion failures on a CLOSED TREE
dom/plugins/base/nsPluginHost.cpp
dom/plugins/base/nsPluginHost.h
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -929,24 +929,16 @@ nsPluginHost::TrySetUpPluginInstance(con
 
   PR_LOG(nsPluginLogging::gPluginLog, PLUGIN_LOG_NORMAL,
         ("nsPluginHost::TrySetupPluginInstance Begin mime=%s, owner=%p, url=%s\n",
         aMimeType, aOwner, urlSpec.get()));
 
   PR_LogFlush();
 #endif
 
-#ifdef XP_WIN
-  bool changed;
-  if ((mRegKeyHKLM && NS_SUCCEEDED(mRegKeyHKLM->HasChanged(&changed)) && changed) ||
-      (mRegKeyHKCU && NS_SUCCEEDED(mRegKeyHKCU->HasChanged(&changed)) && changed)) {
-    ReloadPlugins();
-  }
-#endif
-
   nsRefPtr<nsNPAPIPlugin> plugin;
   GetPlugin(aMimeType, getter_AddRefs(plugin));
   if (!plugin) {
     return NS_ERROR_FAILURE;
   }
 
   nsPluginTag* pluginTag = FindPluginForType(aMimeType, true);
 
@@ -2111,56 +2103,31 @@ nsPluginHost::ChromeEpochForContent()
 
 void
 nsPluginHost::SetChromeEpochForContent(uint32_t aEpoch)
 {
   MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Content);
   mPluginEpoch = aEpoch;
 }
 
-#ifdef XP_WIN
-static void
-WatchRegKey(uint32_t aRoot, nsCOMPtr<nsIWindowsRegKey>& aKey)
-{
-  MOZ_ASSERT(!aKey);
-  aKey = do_CreateInstance("@mozilla.org/windows-registry-key;1");
-  if (!aKey) {
-    return;
-  }
-  nsresult rv = aKey->Open(aRoot,
-                           NS_LITERAL_STRING("Software\\MozillaPlugins"),
-                           nsIWindowsRegKey::ACCESS_READ | nsIWindowsRegKey::ACCESS_NOTIFY);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    aKey = nullptr;
-    return;
-  }
-  aKey->StartWatching(true);
-}
-#endif
-
 nsresult nsPluginHost::LoadPlugins()
 {
 #ifdef ANDROID
   if (XRE_GetProcessType() == GeckoProcessType_Content) {
     return NS_OK;
   }
 #endif
   // do not do anything if it is already done
   // use ReloadPlugins() to enforce loading
   if (mPluginsLoaded)
     return NS_OK;
 
   if (mPluginsDisabled)
     return NS_OK;
 
-#ifdef XP_WIN
-  WatchRegKey(nsIWindowsRegKey::ROOT_KEY_LOCAL_MACHINE, mRegKeyHKLM);
-  WatchRegKey(nsIWindowsRegKey::ROOT_KEY_CURRENT_USER, mRegKeyHKCU);
-#endif
-
   bool pluginschanged;
   nsresult rv = FindPlugins(true, &pluginschanged);
   if (NS_FAILED(rv))
     return rv;
 
   // only if plugins have changed will we notify plugin-change observers
   if (pluginschanged) {
     if (XRE_GetProcessType() == GeckoProcessType_Default) {
--- a/dom/plugins/base/nsPluginHost.h
+++ b/dom/plugins/base/nsPluginHost.h
@@ -25,20 +25,16 @@
 #include "nsITimer.h"
 #include "nsPluginTags.h"
 #include "nsPluginPlayPreviewInfo.h"
 #include "nsIEffectiveTLDService.h"
 #include "nsIIDNService.h"
 #include "nsCRT.h"
 #include "mozilla/plugins/PluginTypes.h"
 
-#ifdef XP_WIN
-#include "nsIWindowsRegKey.h"
-#endif
-
 namespace mozilla {
 namespace plugins {
 class PluginAsyncSurrogate;
 } // namespace mozilla
 } // namespace plugins
 
 class nsNPAPIPlugin;
 class nsIComponentManager;
@@ -325,21 +321,16 @@ private:
 
   // Any instances in this array will have valid plugin objects via GetPlugin().
   // When removing an instance it might not die - be sure to null out it's plugin.
   nsTArray< nsRefPtr<nsNPAPIPluginInstance> > mInstances;
 
   nsCOMPtr<nsIFile> mPluginRegFile;
 #ifdef XP_WIN
   nsRefPtr<nsPluginDirServiceProvider> mPrivateDirServiceProvider;
-
-  // In order to reload plugins when they change, we watch the registry via
-  // this object.
-  nsCOMPtr<nsIWindowsRegKey> mRegKeyHKLM;
-  nsCOMPtr<nsIWindowsRegKey> mRegKeyHKCU;
 #endif
 
   nsCOMPtr<nsIEffectiveTLDService> mTLDService;
   nsCOMPtr<nsIIDNService> mIDNService;
 
   // Helpers for ClearSiteData and SiteHasData.
   nsresult NormalizeHostname(nsCString& host);
   nsresult EnumerateSiteData(const nsACString& domain,