Bug 1356695 - Ensure gfxPrefs is initialized if gfxPlatform::AsyncPanZoomEnabled is called early in startup. r=milan

MozReview-Commit-ID: CnHHcuZRPTc
This commit is contained in:
Kartikaya Gupta 2017-04-17 11:56:26 -04:00
parent 4444fcf4d5
commit 7a4b7a370e

View File

@ -2590,6 +2590,11 @@ gfxPlatform::AsyncPanZoomEnabled()
#ifdef MOZ_WIDGET_ANDROID #ifdef MOZ_WIDGET_ANDROID
return true; return true;
#else #else
if (!gfxPrefs::SingletonExists()) {
// Make sure the gfxPrefs has been initialized before reading from it.
MOZ_ASSERT(NS_IsMainThread());
gfxPrefs::GetSingleton();
}
return gfxPrefs::AsyncPanZoomEnabledDoNotUseDirectly(); return gfxPrefs::AsyncPanZoomEnabledDoNotUseDirectly();
#endif #endif
} }