/* static */ IOInterposer* IOInterposer::GetInstance() { if (!sSingleton) { // We can't actually use this assertion because we initialize this code // before XPCOM is initialized, so NS_IsMainThread() always returns false. // MOZ_ASSERT(NS_IsMainThread()); sSingleton = new IOInterposer(); sSingleton->Init(); } return sSingleton.get(); }
void LogModule::Init() { // NB: This method is not threadsafe; it is expected to be called very early // in startup prior to any other threads being run. if (sLogModuleManager) { // Already initialized. return; } // NB: We intentionally do not register for ClearOnShutdown as that happens // before all logging is complete. And, yes, that means we leak, but // we're doing that intentionally. sLogModuleManager = new LogModuleManager(); sLogModuleManager->Init(); }