static void SetStaticGLContext(GLContext* context) { if (!sGLContext.initialized()) { mozilla::DebugOnly<bool> success = sGLContext.init(); MOZ_ASSERT(success); } sGLContext.set(context); }
void NS_SetMainThread() { if (!sTLSIsMainThread.initialized()) { if (!sTLSIsMainThread.init()) { MOZ_CRASH(); } sTLSIsMainThread.set(true); } MOZ_ASSERT(NS_IsMainThread()); }
void InitScriptSettings() { if (!sScriptSettingsTLS.initialized()) { bool success = sScriptSettingsTLS.init(); if (!success) { MOZ_CRASH(); } } sScriptSettingsTLS.set(nullptr); }
void EnsureGLContext(const GrGLInterface* i) { const DrawTarget* drawTarget = reinterpret_cast<const DrawTarget*>(i->fCallbackData); GLContext* gl = static_cast<GLContext*>(drawTarget->GetGLContext()); gl->MakeCurrent(); if (!sGLContext.initialized()) { mozilla::DebugOnly<bool> success = sGLContext.init(); MOZ_ASSERT(success); } sGLContext.set(gl); }
void EnsureGLContext(const GrGLInterface* i) { const SkiaGLGlue* contextSkia = reinterpret_cast<const SkiaGLGlue*>(i->fCallbackData); GLContext* gl = contextSkia->GetGLContext(); gl->MakeCurrent(); if (!sGLContext.initialized()) { mozilla::DebugOnly<bool> success = sGLContext.init(); MOZ_ASSERT(success); } sGLContext.set(gl); }
void InitScriptSettings() { if (!sScriptSettingsTLS.initialized()) { bool success = sScriptSettingsTLS.init(); if (!success) { MOZ_CRASH(); } } ScriptSettingsStack* ptr = new ScriptSettingsStack(); sScriptSettingsTLS.set(ptr); }
void InitTaskTracer(uint32_t aFlags) { if (aFlags & FORKED_AFTER_NUWA) { ObsoleteCurrentTraceInfos(); return; } MOZ_ASSERT(!sTraceInfos); sTraceInfos = new nsTArray<nsAutoPtr<TraceInfo>>(); if (!sTraceInfoTLS.initialized()) { Unused << sTraceInfoTLS.init(); } }
TraceInfo* GetOrCreateTraceInfo() { ENSURE_TRUE(sTraceInfoTLS.initialized(), nullptr); ENSURE_TRUE(IsStartLogging(), nullptr); TraceInfo* info = sTraceInfoTLS.get(); if (info && info->mObsolete) { // TraceInfo is obsolete: remove it. FreeTraceInfo(info); info = nullptr; } if (!info) { info = AllocTraceInfo(gettid()); sTraceInfoTLS.set(info); } return info; }
bool ScriptSettingsInitialized() { return sScriptSettingsTLS.initialized(); }