Bug 1520617: LauncherRegistryInfo - when the image timestamp changes, only avoid clearing start timestamps when force disabled; r=mhowell
authorAaron Klotz <aklotz@mozilla.com>
Wed, 16 Jan 2019 22:05:54 +0000
changeset 514145 62cf6d29e787107d8632a31f0ef4ca7645287df3
parent 514144 c82dc10b75c089465aa167d3905ffbe8f0643e31
child 514146 b9ab3e3e109a0bf5716918ce90775df3586ca077
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhowell
bugs1520617
milestone66.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 1520617: LauncherRegistryInfo - when the image timestamp changes, only avoid clearing start timestamps when force disabled; r=mhowell Differential Revision: https://phabricator.services.mozilla.com/D16752
toolkit/xre/LauncherRegistryInfo.cpp
--- a/toolkit/xre/LauncherRegistryInfo.cpp
+++ b/toolkit/xre/LauncherRegistryInfo.cpp
@@ -333,20 +333,20 @@ LauncherResult<bool> LauncherRegistryInf
   if (result == ERROR_FILE_NOT_FOUND) {
     return false;
   }
 
   return LAUNCHER_ERROR_FROM_WIN32(result);
 }
 
 LauncherVoidResult LauncherRegistryInfo::ClearStartTimestamps() {
-  LauncherResult<uint64_t> lastBrowserTimestamp =
-      GetStartTimestamp(ProcessType::Browser);
-  if (lastBrowserTimestamp.isOk() && lastBrowserTimestamp.unwrap() == 0ULL) {
-    // Only proceed when the browser timestamp is non-zero
+  LauncherResult<EnabledState> enabled = IsEnabled();
+  if (enabled.isOk() && enabled.unwrap() == EnabledState::ForceDisabled) {
+    // We don't clear anything when we're force disabled - we need to maintain
+    // the current registry state in this case.
     return Ok();
   }
 
   LauncherResult<bool> clearedLauncherTimestamp =
       ClearStartTimestamp(ProcessType::Launcher);
   if (clearedLauncherTimestamp.isErr()) {
     return LAUNCHER_ERROR_FROM_RESULT(clearedLauncherTimestamp);
   }