Bug 1350690 - Add main thread assertion to nsSystemInfo::Init(). r=froydnj
MozReview-Commit-ID: JtlOXqCtJ8Y
--- 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" },