Bug 1517637: Add launcher process state to crash report annotations; r=mhowell
authorAaron Klotz <aklotz@mozilla.com>
Wed, 09 Jan 2019 23:36:38 +0000
changeset 455175 7aa270ef4b6811e9e04666e6564d5c6507f72004
parent 455174 e125bfe1e2210df1a3bdd85012c032c24b9d3e75
child 455176 45c481199f275c683e16317149924fd4ef502feb
push id111412
push useraciure@mozilla.com
push dateThu, 24 Jan 2019 03:49:22 +0000
treeherdermozilla-inbound@9975fa15b5b7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhowell
bugs1517637
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 1517637: Add launcher process state to crash report annotations; r=mhowell Depends on D15759 Differential Revision: https://phabricator.services.mozilla.com/D15760
toolkit/crashreporter/CrashAnnotations.yaml
toolkit/xre/nsAppRunner.cpp
--- a/toolkit/crashreporter/CrashAnnotations.yaml
+++ b/toolkit/crashreporter/CrashAnnotations.yaml
@@ -474,16 +474,23 @@ JSOutOfMemory:
     A small allocation couldn't be satisfied, the annotation may contain the
     "Reporting", "Reported" or "Recovered" value. The first one means that
     we crashed while responding to the OOM condition (possibly while running a
     memory-pressure observers), the second that we crashed after having tried to
     free some memory, and the last that the GC had managed to free enough memory
     to satisfy the allocation.
   type: string
 
+LauncherProcessState:
+  description: >
+    Launcher process enabled state. The integer value of this annotation must
+    match with one of the values in the
+    mozilla::LauncherRegistryInfo::EnableState enum
+  type: integer
+
 LowCommitSpaceEvents:
   description: >
     Number of times the available memory tracker has detected a that
     commit-space was running low. This is a Windows-specific annotation.
   type: integer
   ping: true
 
 MarshalActCtxManifestPath:
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -1668,16 +1668,20 @@ static void SetupLauncherProcessPref() {
   mozilla::LauncherResult<mozilla::LauncherRegistryInfo::EnabledState>
       enabledState = launcherRegInfo.IsEnabled();
 
   if (enabledState.isOk()) {
     Preferences::SetBool(
         PREF_WIN_LAUNCHER_PROCESS_ENABLED,
         enabledState.unwrap() !=
             mozilla::LauncherRegistryInfo::EnabledState::ForceDisabled);
+
+    CrashReporter::AnnotateCrashReport(
+        CrashReporter::Annotation::LauncherProcessState,
+        static_cast<uint32_t>(enabledState.unwrap()));
   }
 
   Preferences::RegisterCallback(&OnLauncherPrefChanged,
                                 PREF_WIN_LAUNCHER_PROCESS_ENABLED);
 }
 
 #  endif  // defined(MOZ_LAUNCHER_PROCESS)