Bug 1350690 - Add main thread assertion to nsSystemInfo::Init(). r=froydnj draft
authorAndrew McCreight <continuation@gmail.com>
Mon, 27 Mar 2017 08:03:01 -0700
changeset 553214 942d678ad5a37a1df16829385e3603de1a9d53f5
parent 553213 f4fe6d56212d67abb40416495250b48ed33852e5
child 553221 d257ad6ed35b3cc7ca436c4e59d17fd3bbfe8d8c
push id51552
push userbmo:continuation@gmail.com
push dateWed, 29 Mar 2017 15:33:20 +0000
reviewersfroydnj
bugs1350690
milestone55.0a1
Bug 1350690 - Add main thread assertion to nsSystemInfo::Init(). r=froydnj MozReview-Commit-ID: JtlOXqCtJ8Y
xpcom/base/nsSystemInfo.cpp
--- a/xpcom/base/nsSystemInfo.cpp
+++ b/xpcom/base/nsSystemInfo.cpp
@@ -335,16 +335,20 @@ GetProcessorInformation(int* physical_cp
   }
   return;
 }
 #endif
 
 nsresult
 nsSystemInfo::Init()
 {
+  // This uses the observer service on Windows, so for simplicity
+  // check that it is called from the main thread on all platforms.
+  MOZ_ASSERT(NS_IsMainThread());
+
   nsresult rv;
 
   static const struct
   {
     PRSysInfo cmd;
     const char* name;
   } items[] = {
     { PR_SI_SYSNAME, "name" },