Bug 1323777 part 3 - Ensure that collecting telemetry on user font usage don't have unwanted side effects. r=smaug

This commit is contained in:
Mats Palmgren 2017-01-25 23:34:22 +02:00
parent daa0033987
commit bf382ceca8
5 changed files with 8 additions and 7 deletions

View File

@ -12782,7 +12782,7 @@ nsAutoSyncOperation::~nsAutoSyncOperation()
}
gfxUserFontSet*
nsIDocument::GetUserFontSet()
nsIDocument::GetUserFontSet(bool aFlushUserFontSet)
{
// We want to initialize the user font set lazily the first time the
// user asks for it, rather than building it too early and forcing
@ -12797,7 +12797,7 @@ nsIDocument::GetUserFontSet()
// Set mGetUserFontSetCalled up front, so that FlushUserFontSet will actually
// flush.
mGetUserFontSetCalled = true;
if (mFontFaceSetDirty) {
if (mFontFaceSetDirty && aFlushUserFontSet) {
// If this assertion fails, and there have actually been changes to
// @font-face rules, then we will call StyleChangeReflow in
// FlushUserFontSet. If we're in the middle of reflow,

View File

@ -2816,7 +2816,7 @@ public:
}
}
gfxUserFontSet* GetUserFontSet();
gfxUserFontSet* GetUserFontSet(bool aFlushUserFontSet = true);
void FlushUserFontSet();
void RebuildUserFontSet(); // asynchronously
mozilla::dom::FontFaceSet* GetFonts() { return mFontFaceSet; }

View File

@ -1169,7 +1169,8 @@ PresShell::Destroy()
}
}
if (mPresContext) {
gfxUserFontSet* fs = mPresContext->GetUserFontSet();
const bool mayFlushUserFontSet = false;
gfxUserFontSet* fs = mPresContext->GetUserFontSet(mayFlushUserFontSet);
if (fs) {
uint32_t fontCount;
uint64_t fontSize;

View File

@ -2212,9 +2212,9 @@ nsPresContext::HasAuthorSpecifiedRules(const nsIFrame *aFrame,
}
gfxUserFontSet*
nsPresContext::GetUserFontSet()
nsPresContext::GetUserFontSet(bool aFlushUserFontSet)
{
return mDocument->GetUserFontSet();
return mDocument->GetUserFontSet(aFlushUserFontSet);
}
void

View File

@ -952,7 +952,7 @@ public:
bool SuppressingResizeReflow() const { return mSuppressResizeReflow; }
gfxUserFontSet* GetUserFontSet();
gfxUserFontSet* GetUserFontSet(bool aFlushUserFontSet = true);
// Should be called whenever the set of fonts available in the user
// font set changes (e.g., because a new font loads, or because the