Bug 770883 - Disable functionality for clearing prefetch. r=taras
authorBrian R. Bondy <netzen@gmail.com>
Fri, 06 Jul 2012 07:41:41 -0400
changeset 98674 dfca0a052c47
parent 98673 137f4655cf25
child 98675 d3cfb134c625
push id11591
push userbbondy@mozilla.com
push date2012-07-09 01:45 +0000
treeherdermozilla-inbound@dfca0a052c47 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstaras
bugs770883
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 770883 - Disable functionality for clearing prefetch. r=taras
browser/components/shell/src/nsWindowsShellService.cpp
toolkit/components/maintenanceservice/workmonitor.cpp
--- a/browser/components/shell/src/nsWindowsShellService.cpp
+++ b/browser/components/shell/src/nsWindowsShellService.cpp
@@ -189,26 +189,29 @@ static SETTING gDDESettings[] = {
   { MAKE_KEY_NAME1("Software\\Classes\\FirefoxURL", SOD) },
 
   // Protocol Handlers
   { MAKE_KEY_NAME1("Software\\Classes\\FTP", SOD) },
   { MAKE_KEY_NAME1("Software\\Classes\\HTTP", SOD) },
   { MAKE_KEY_NAME1("Software\\Classes\\HTTPS", SOD) }
 };
 
+// See Bug 770883
+#if 0
 #if defined(MOZ_MAINTENANCE_SERVICE)
 
 #define ONLY_SERVICE_LAUNCHING
 #include "updatehelper.h"
 #include "updatehelper.cpp"
 
 static const char *kPrefetchClearedPref =
   "app.update.service.lastVersionPrefetchCleared";
 static nsCOMPtr<nsIThread> sThread;
 #endif
+#endif
 
 nsresult
 GetHelperPath(nsAutoString& aPath)
 {
   nsresult rv;
   nsCOMPtr<nsIProperties> directoryService = 
     do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -992,16 +995,18 @@ nsWindowsShellService::SetDesktopBackgro
   NS_ENSURE_SUCCESS(rv, rv);
 
   return regKey->Close();
 }
 
 nsWindowsShellService::nsWindowsShellService() : 
   mCheckedThisSession(false) 
 {
+// See Bug 770883
+#if 0
 #if defined(MOZ_MAINTENANCE_SERVICE)
 
   // Check to make sure the service is installed
   PRUint32 installed = 0;
   nsCOMPtr<nsIWindowsRegKey> regKey = 
     do_CreateInstance("@mozilla.org/windows-registry-key;1");
   if (!regKey || 
       NS_FAILED(regKey->Open(nsIWindowsRegKey::ROOT_KEY_LOCAL_MACHINE,
@@ -1036,32 +1041,38 @@ nsWindowsShellService::nsWindowsShellSer
   // service command.
   mTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
   if (mTimer) {
     mTimer->InitWithFuncCallback(
       nsWindowsShellService::LaunchPrefetchClearCommand, 
       nsnull, CLEAR_PREFETCH_TIMEOUT_MS, nsITimer::TYPE_ONE_SHOT);
   }
 #endif
+#endif
 }
 
 nsWindowsShellService::~nsWindowsShellService()
 {
+// See Bug 770883
+#if 0
 #if defined(MOZ_MAINTENANCE_SERVICE)
  if (mTimer) {
     mTimer->Cancel();
     mTimer = nsnull;
   }
   if (sThread) {
     sThread->Shutdown();
     sThread = nsnull;
   }
 #endif
+#endif
 }
 
+// See Bug 770883
+#if 0
 #if defined(MOZ_MAINTENANCE_SERVICE)
 
 class ClearPrefetchEvent : public nsRunnable {
 public:
   ClearPrefetchEvent()
   {
   }
 
@@ -1074,26 +1085,29 @@ public:
     // If this command fails, it is not critical as prefetch will be cleared
     // on the next software update.
     StartServiceCommand(NS_ARRAY_LENGTH(updaterServiceArgv), 
                         updaterServiceArgv);
     return NS_OK;
   }
 };
 #endif
+#endif
 
 /**
  * For faster startup we attempt to clear the prefetch if the maintenance
  * service is installed.  Please see the definition of ClearPrefetch()
  * in toolkit/components/maintenanceservice/prefetch.cpp for more info.
  * For now the only application that gets prefetch cleaned is Firefox
  * since we have not done performance checking for other applications.
  * This is done on every update but also there is a one time operation done
  * from within the program for first time installs.
  */ 
+// See Bug 770883
+#if 0
 #if defined(MOZ_MAINTENANCE_SERVICE)
 void
 nsWindowsShellService::LaunchPrefetchClearCommand(nsITimer *aTimer, void*)
 {
   // Make sure we don't call this again from the application, it will be
   // called on each application update instead.
   nsCOMPtr<nsIPrefBranch> prefBranch;
   nsCOMPtr<nsIPrefService> prefs =
@@ -1108,16 +1122,17 @@ nsWindowsShellService::LaunchPrefetchCle
   // main thread, so start an event on another thread to handle the operation
   NS_NewThread(getter_AddRefs(sThread));
   if (sThread) {
     nsCOMPtr<nsIRunnable> prefetchEvent = new ClearPrefetchEvent();
     sThread->Dispatch(prefetchEvent, NS_DISPATCH_NORMAL);
   }
 }
 #endif
+#endif
 
 NS_IMETHODIMP
 nsWindowsShellService::OpenApplicationWithURI(nsIFile* aApplication,
                                               const nsACString& aURI)
 {
   nsresult rv;
   nsCOMPtr<nsIProcess> process = 
     do_CreateInstance("@mozilla.org/process/util;1", &rv);
--- a/toolkit/components/maintenanceservice/workmonitor.cpp
+++ b/toolkit/components/maintenanceservice/workmonitor.cpp
@@ -499,19 +499,24 @@ ExecuteServiceCommand(int argc, LPWSTR *
 
   BOOL result = FALSE;
   if (!lstrcmpi(argv[2], L"software-update")) {
     result = ProcessSoftwareUpdateCommand(argc - 3, argv + 3);
     // We might not reach here if the service install succeeded
     // because the service self updates itself and the service
     // installer will stop the service.
     LOG(("Service command %ls complete.\n", argv[2]));
-  } else if (!lstrcmpi(argv[2], L"clear-prefetch")) {
+  }
+  // See Bug 770883
+#if 0
+  else if (!lstrcmpi(argv[2], L"clear-prefetch")) {
     result = ClearKnownPrefetch();
-  } else {
+  } 
+#endif
+  else {
     LOG(("Service command not recognized: %ls.\n", argv[2]));
     // result is already set to FALSE
   }
 
   LOG(("service command %ls complete with result: %ls.\n", 
        argv[1], (result ? L"Success" : L"Failure")));
   return TRUE;
 }