Bug 1412048 - Replace some NS_RUNTIMEABORT(var) calls with MOZ_CRASH_UNSAFE_PRINTF. r?froydnj data-review?francois draft
authorChris Peterson <cpeterson@mozilla.com>
Thu, 26 Oct 2017 00:49:00 -0700
changeset 686977 2d79f13307067bf41c9e4d6996a25e0b901879e3
parent 686976 debaad5399ec8f9f7a2112fb16dd8ff7dd866e4a
child 686978 e476893b2ace7dd7ea8ba6b5c385c629879477c9
push id86367
push usercpeterson@mozilla.com
push dateThu, 26 Oct 2017 18:05:05 +0000
reviewersfroydnj
bugs1412048
milestone58.0a1
Bug 1412048 - Replace some NS_RUNTIMEABORT(var) calls with MOZ_CRASH_UNSAFE_PRINTF. r?froydnj data-review?francois MOZ_CRASH_UNSAFE_PRINTF causes data collection because crash strings are annotated to crash-stats and are publicly visible. Firefox data stewards must do data review on usages of this macro. However, all the crash strings this patch collects with MOZ_CRASH_UNSAFE_PRINTF are already collected with NS_RUNTIMEABORT. MozReview-Commit-ID: 5ujXa9MHH5Z
ipc/glue/ProtocolUtils.cpp
--- a/ipc/glue/ProtocolUtils.cpp
+++ b/ipc/glue/ProtocolUtils.cpp
@@ -311,18 +311,17 @@ void
 LogicError(const char* aMsg)
 {
   MOZ_CRASH_UNSAFE_OOL(aMsg);
 }
 
 void
 ActorIdReadError(const char* aActorDescription)
 {
-  nsPrintfCString message("Error deserializing id for %s", aActorDescription);
-  NS_RUNTIMEABORT(message.get());
+  MOZ_CRASH_UNSAFE_PRINTF("Error deserializing id for %s", aActorDescription);
 }
 
 void
 BadActorIdError(const char* aActorDescription)
 {
   nsPrintfCString message("bad id for %s", aActorDescription);
   ProtocolErrorBreakpoint(message.get());
 }
@@ -340,32 +339,29 @@ MismatchedActorTypeError(const char* aAc
   nsPrintfCString message("actor that should be of type %s has different type",
                           aActorDescription);
   ProtocolErrorBreakpoint(message.get());
 }
 
 void
 UnionTypeReadError(const char* aUnionName)
 {
-  nsPrintfCString message("error deserializing type of union %s", aUnionName);
-  NS_RUNTIMEABORT(message.get());
+  MOZ_CRASH_UNSAFE_PRINTF("error deserializing type of union %s", aUnionName);
 }
 
 void
 ArrayLengthReadError(const char* aElementName)
 {
-  nsPrintfCString message("error deserializing length of %s[]", aElementName);
-  NS_RUNTIMEABORT(message.get());
+  MOZ_CRASH_UNSAFE_PRINTF("error deserializing length of %s[]", aElementName);
 }
 
 void
 SentinelReadError(const char* aClassName)
 {
-  nsPrintfCString message("incorrect sentinel when reading %s", aClassName);
-  NS_RUNTIMEABORT(message.get());
+  MOZ_CRASH_UNSAFE_PRINTF("incorrect sentinel when reading %s", aClassName);
 }
 
 void
 TableToArray(const nsTHashtable<nsPtrHashKey<void>>& aTable,
              nsTArray<void*>& aArray)
 {
   uint32_t i = 0;
   void** elements = aArray.AppendElements(aTable.Count());