Bug 1348273 - Convert the network-related annotations; r?mcmanus draft
authorGabriele Svelto <gsvelto@mozilla.com>
Sat, 17 Mar 2018 00:17:40 +0100
changeset 781403 ccdfe19b67fa65add5cb6d203837a3d46b2ff155
parent 781402 440dae86ca0bddb14a1d693ae564b1204ae4d000
child 781404 84d17dbe80165ba89c686be4d02a2d6a1ab82ca2
push id106292
push usergsvelto@mozilla.com
push dateThu, 12 Apr 2018 22:06:23 +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
@@ -585,16 +585,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.
@@ -613,8 +619,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");