Bug 614610 - Annotate ProcessType for content and jetpack crashes, r=ted
authorBenjamin Smedberg <benjamin@smedbergs.us>
Tue, 30 Nov 2010 09:54:31 -0500
changeset 58486 c0c537489cbf1de521f7f2b3ead3844c899e9fc1
parent 58485 1fa8a96b1c2c1de1d119c5376bc482cb1faa3c3e
child 58487 57a6ec830cd465d84012835d109d5db561a14cd2
push id17317
push userbsmedberg@mozilla.com
push dateThu, 02 Dec 2010 15:48:16 +0000
treeherdermozilla-central@57a6ec830cd4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs614610
milestone2.0b8pre
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 614610 - Annotate ProcessType for content and jetpack crashes, r=ted
dom/ipc/ContentParent.cpp
js/jetpack/JetpackParent.cpp
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -181,19 +181,26 @@ ContentParent::ActorDestroy(ActorDestroy
 
 #ifdef MOZ_CRASHREPORTER
             nsAutoString dumpID;
 
             nsCOMPtr<nsILocalFile> crashDump;
             TakeMinidump(getter_AddRefs(crashDump)) &&
                 CrashReporter::GetIDFromMinidump(crashDump, dumpID);
 
-            if (!dumpID.IsEmpty())
+            if (!dumpID.IsEmpty()) {
                 props->SetPropertyAsAString(NS_LITERAL_STRING("dumpID"),
                                             dumpID);
+
+                CrashReporter::AnnotationTable notes;
+                notes.Init();
+                notes.Put(NS_LITERAL_CSTRING("ProcessType"), NS_LITERAL_CSTRING("content"));
+                // TODO: Additional per-process annotations.
+                CrashReporter::AppendExtraData(dumpID, notes);
+            }
 #endif
 
             obs->NotifyObservers((nsIPropertyBag2*) props, "ipc:content-shutdown", nsnull);
         }
     }
 
     MessageLoop::current()->
         PostTask(FROM_HERE,
--- a/js/jetpack/JetpackParent.cpp
+++ b/js/jetpack/JetpackParent.cpp
@@ -301,19 +301,29 @@ JetpackParent::OnChannelConnected(int32 
     NS_RUNTIMEABORT("can't open handle to child process");
 
   SetOtherProcess(handle);
 }
 
 void
 JetpackParent::DispatchFailureMessage(const nsString& aDumpID)
 {
-  KeyValue kv(NS_LITERAL_STRING("dumpID"), PrimVariant(aDumpID));
+#ifdef MOZ_CRASHREPORTER
+  CrashReporter::AnnotationTable notes;
+  notes.Init();
+  notes.Put(NS_LITERAL_CSTRING("ProcessType"), NS_LITERAL_CSTRING("jetpack"));
+  // TODO: Additional per-process annotations.
+  CrashReporter::AppendExtraData(aDumpID, notes);
+#endif
+
   InfallibleTArray<KeyValue> keyvalues;
-  keyvalues.AppendElement(kv);
+  if (!aDumpID.IsEmpty()) {
+    KeyValue kv(NS_LITERAL_STRING("dumpID"), PrimVariant(aDumpID));
+    keyvalues.AppendElement(kv);
+  }
 
   CompVariant object(keyvalues);
 
   InfallibleTArray<Variant> arguments;
   arguments.AppendElement(object);
 
   RecvSendMessage(NS_LITERAL_STRING("core:process-error"), arguments);
 }