зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset d48abd83fc7c (bug 1463884) since it's not the correct fix. r=me
If the font enumeration thread runs during the Servo traversal, it'd end up thinking it _is_ (incorrectly) a Servo thread.
This commit is contained in:
Родитель
a90bc4ed77
Коммит
14326e571a
|
@ -2423,23 +2423,8 @@ gfxFcPlatformFontList::TryLangForGroup(const nsACString& aOSLang,
|
|||
++pos;
|
||||
}
|
||||
|
||||
// We can safely use mLangService->LookupLanguage if we're on the main
|
||||
// thread, or if we're in a Servo traversal that has locked the cache,
|
||||
// but not if we're on the font enumeration thread used to populate the
|
||||
// Font menu in about:preferences.
|
||||
if (IsInServoTraversalWithoutMainThreadAssertion() || NS_IsMainThread()) {
|
||||
nsAtom *atom = mLangService->LookupLanguage(aFcLang);
|
||||
return atom == aLangGroup;
|
||||
}
|
||||
|
||||
// Off-main-thread/non-servo-traversal version: fall back to
|
||||
// GetUncachedLanguageGroup to avoid unsafe access to the lang-group
|
||||
// mapping cache hashtable.
|
||||
nsAutoCString lowered(aFcLang);
|
||||
ToLowerCase(lowered);
|
||||
RefPtr<nsAtom> lang = NS_Atomize(lowered);
|
||||
RefPtr<nsAtom> group = mLangService->GetUncachedLanguageGroup(lang);
|
||||
return group.get() == aLangGroup;
|
||||
nsAtom *atom = mLangService->LookupLanguage(aFcLang);
|
||||
return atom == aLangGroup;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -33,14 +33,6 @@ inline bool IsInServoTraversal()
|
|||
MOZ_ASSERT(sInServoTraversal || NS_IsMainThread());
|
||||
return sInServoTraversal;
|
||||
}
|
||||
|
||||
inline bool IsInServoTraversalWithoutMainThreadAssertion()
|
||||
{
|
||||
// This is for cases when we _only_ want to query whether we're in Servo
|
||||
// traversal, without asserting in the case of other non-main-thread callers.
|
||||
// Use this only if the calling code is safe to use off the main thread.
|
||||
return sInServoTraversal;
|
||||
}
|
||||
} // namespace mozilla
|
||||
|
||||
#define MOZ_DECL_STYLO_CONVERT_METHODS_SERVO(servotype_) \
|
||||
|
|
Загрузка…
Ссылка в новой задаче