Bug 653310 - Always put a dumpID property on ipc:content-shutdown notification property bags. r=cjones
authorCameron McCormack <cam@mcc.id.au>
Fri, 29 Apr 2011 10:03:40 +1200
changeset 68731 9f8e09d29a0da47f9b36c106d73ef555a0f144a7
parent 68730 3723e9c3557e6c1c97ff05f85ad724d442d132c2
child 68732 da0065d6a53f055dc966a48d3454c8c6736aa5b2
push idunknown
push userunknown
push dateunknown
reviewerscjones
bugs653310
milestone6.0a1
Bug 653310 - Always put a dumpID property on ipc:content-shutdown notification property bags. r=cjones
dom/ipc/ContentParent.cpp
dom/ipc/tests/process_error.xul
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -279,20 +279,19 @@ ContentParent::ActorDestroy(ActorDestroy
 
 #ifdef MOZ_CRASHREPORTER
             nsAutoString dumpID;
 
             nsCOMPtr<nsILocalFile> crashDump;
             TakeMinidump(getter_AddRefs(crashDump)) &&
                 CrashReporter::GetIDFromMinidump(crashDump, dumpID);
 
+            props->SetPropertyAsAString(NS_LITERAL_STRING("dumpID"), dumpID);
+
             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"));
 
                 char startTime[32];
                 sprintf(startTime, "%lld", static_cast<PRInt64>(mProcessStartTime));
                 notes.Put(NS_LITERAL_CSTRING("StartupTime"),
                           nsDependentCString(startTime));
--- a/dom/ipc/tests/process_error.xul
+++ b/dom/ipc/tests/process_error.xul
@@ -14,17 +14,17 @@
     const SimpleTest = window.opener.wrappedJSObject.SimpleTest;
 
     function crashObserver(subject, topic, data) {
       is(topic, 'ipc:content-shutdown', 'Received correct observer topic.');
       ok(subject instanceof Components.interfaces.nsIPropertyBag2,
          'Subject implements nsIPropertyBag2.');
       
       if ('nsICrashReporter' in Components.interfaces) {
-        ok(subject.getPropertyAsAString('dumpID'), "dumpID is present");
+        ok(subject.getPropertyAsAString('dumpID'), "dumpID is present and not an empty string");
       }
 
       Services.obs.removeObserver(crashObserver, 'ipc:content-shutdown');
       done();
     }
     Services.obs.addObserver(crashObserver, 'ipc:content-shutdown', false);
 
     document.getElementById('thebrowser').