зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1376964 - Part 10: Allow style worker threads to pick fonts out of the user font cache. r=jfkthame
MozReview-Commit-ID: FX0T5ltA2u4 --HG-- extra : rebase_source : fc8a271f5ae1e0a897cd051b30da252be4176a4e
This commit is contained in:
Родитель
82079904e6
Коммит
55c888b885
|
@ -474,6 +474,12 @@ gfxUserFontEntry::ContinueLoad()
|
|||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
IgnorePrincipal(gfxFontSrcURI* aURI)
|
||||
{
|
||||
return aURI->InheritsSecurityContext();
|
||||
}
|
||||
|
||||
void
|
||||
gfxUserFontEntry::DoLoadNextSrc(bool aForceAsync)
|
||||
{
|
||||
|
@ -535,9 +541,16 @@ gfxUserFontEntry::DoLoadNextSrc(bool aForceAsync)
|
|||
currSrc.mFormatFlags)) {
|
||||
|
||||
if (ServoStyleSet* set = ServoStyleSet::Current()) {
|
||||
set->AppendTask(PostTraversalTask::LoadFontEntry(this));
|
||||
SetLoadState(STATUS_LOAD_PENDING);
|
||||
return;
|
||||
// Only support style worker threads synchronously getting
|
||||
// entries from the font cache when it's not a data: URI
|
||||
// @font-face that came from UA or user sheets, since we
|
||||
// were not able to call IsFontLoadAllowed ahead of time
|
||||
// for these entries.
|
||||
if (currSrc.mUseOriginPrincipal && IgnorePrincipal(currSrc.mURI)) {
|
||||
set->AppendTask(PostTraversalTask::LoadFontEntry(this));
|
||||
SetLoadState(STATUS_LOAD_PENDING);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
gfxFontSrcPrincipal* principal = nullptr;
|
||||
|
@ -567,6 +580,14 @@ gfxUserFontEntry::DoLoadNextSrc(bool aForceAsync)
|
|||
}
|
||||
}
|
||||
|
||||
if (ServoStyleSet* set = ServoStyleSet::Current()) {
|
||||
// If we need to start a font load and we're on a style
|
||||
// worker thread, we have to defer it.
|
||||
set->AppendTask(PostTraversalTask::LoadFontEntry(this));
|
||||
SetLoadState(STATUS_LOAD_PENDING);
|
||||
return;
|
||||
}
|
||||
|
||||
// record the principal returned by CheckFontLoad,
|
||||
// for use when creating a channel
|
||||
// and when caching the loaded entry
|
||||
|
@ -1136,12 +1157,6 @@ gfxUserFontSet::UserFontCache::Flusher::Observe(nsISupports* aSubject,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
static bool
|
||||
IgnorePrincipal(gfxFontSrcURI* aURI)
|
||||
{
|
||||
return aURI->InheritsSecurityContext();
|
||||
}
|
||||
|
||||
bool
|
||||
gfxUserFontSet::UserFontCache::Entry::KeyEquals(const KeyTypePointer aKey) const
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче