Bug 1348273 - Convert the network-related annotations; r?mcmanus draft
authorGabriele Svelto <gsvelto@mozilla.com>
Sat, 17 Mar 2018 00:17:40 +0100
changeset 776646 628122fd2eab5aa51968b810db3eb3166092afcd
parent 776645 ce91a86ab7ca2a594dde33e920a63a320b96927f
child 776647 ffddfbba9badbbf3f50daae30cd6850684326688
push id104933
push usergsvelto@mozilla.com
push dateTue, 03 Apr 2018 14:35:30 +0000
reviewersmcmanus
bugs1348273
milestone61.0a1
Bug 1348273 - Convert the network-related annotations; r?mcmanus MozReview-Commit-ID: FG1RRjC1lZR
netwerk/ipc/NeckoMessageUtils.h
toolkit/crashreporter/CrashAnnotations.yaml
widget/windows/LSPAnnotator.cpp
--- a/netwerk/ipc/NeckoMessageUtils.h
+++ b/netwerk/ipc/NeckoMessageUtils.h
@@ -97,17 +97,18 @@ struct ParamTraits<mozilla::net::NetAddr
       // Train's already off the rails:  let's get a stack trace at least...
       MOZ_CRASH("Error: please post stack trace to "
                       "https://bugzilla.mozilla.org/show_bug.cgi?id=661158");
       aMsg->WriteBytes(aParam.local.path, sizeof(aParam.local.path));
 #endif
     } else {
       if (XRE_IsParentProcess()) {
         nsPrintfCString msg("%d", aParam.raw.family);
-        CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Unknown NetAddr socket family"), msg);
+        CrashReporter::AnnotateCrashReport(
+          CrashReporter::Annotation::UnknownNetAddrSocketFamily, msg);
       }
 
       MOZ_CRASH("Unknown socket family");
     }
   }
 
   static bool Read(const Message* aMsg, PickleIterator* aIter, mozilla::net::NetAddr* aResult)
   {
--- a/toolkit/crashreporter/CrashAnnotations.yaml
+++ b/toolkit/crashreporter/CrashAnnotations.yaml
@@ -588,16 +588,22 @@ TotalPhysicalMemory:
 TotalVirtualMemory:
   description: >
     Windows-only, size of the virtual address space. This annotation is
     populated with the contents of the MEMORYSTATUSEX's structure
     ullTotalVirtual field.
   type: string
   ping: true
 
+UnknownNetAddrSocketFamily:
+  description: >
+    An unknown network address family was requested to Necko. The value is the
+    requested family number.
+  type: integer
+
 UnmarshalActCtx:
   description: >
     Proxy stream unmarshalling current activation context.
   type: string
 
 UnmarshalActCtxManifestPath:
   description: >
     Proxy stream unmarshalling current activation context manifest path.
@@ -615,8 +621,13 @@ URL:
   type: string
   content: false
 
 User32BeforeBlocklist:
   description: >
     Set to 1 if user32.dll was loaded before we could install the DLL blocklist.
   type: boolean
   ping: true
+
+Winsock_LSP:
+  description: >
+    Information on winsock LSPs injected in our networking stack.
+  type: string
--- a/widget/windows/LSPAnnotator.cpp
+++ b/widget/windows/LSPAnnotator.cpp
@@ -39,17 +39,18 @@ public:
 
 void
 LSPAnnotationGatherer::Annotate()
 {
   nsCOMPtr<nsICrashReporter> cr =
     do_GetService("@mozilla.org/toolkit/crash-reporter;1");
   bool enabled;
   if (cr && NS_SUCCEEDED(cr->GetEnabled(&enabled)) && enabled) {
-    cr->AnnotateCrashReport(NS_LITERAL_CSTRING("Winsock_LSP"), mString);
+    cr->AnnotateCrashReport(
+      static_cast<uint32_t>(CrashReporter::Annotation::Winsock_LSP), mString);
   }
   mThread->AsyncShutdown();
 }
 
 NS_IMETHODIMP
 LSPAnnotationGatherer::Run()
 {
   NS_SetCurrentThreadName("LSP Annotator");