зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1338446 Part 2 - Label FontFaceSet::CheckLoadingFinishedAfterDelay. r=heycam
mDocument is always valid because we get mDocument from the argument of FontFaceSet's constructor, and FontFaceSet is always created in nsIDocument's methods. Delay giving checkTask a name until we dispatch it. No need to name it twice. MozReview-Commit-ID: 6nKYRcRqvQ0 --HG-- extra : rebase_source : 5d7be9c1bcf41ce6fae9ba37a4013144c23fa832
This commit is contained in:
Родитель
f0c29bc5fc
Коммит
bef3641333
|
@ -104,6 +104,8 @@ FontFaceSet::FontFaceSet(nsPIDOMWindowInner* aWindow, nsIDocument* aDocument)
|
||||||
, mHasLoadingFontFacesIsDirty(false)
|
, mHasLoadingFontFacesIsDirty(false)
|
||||||
, mDelayedLoadCheck(false)
|
, mDelayedLoadCheck(false)
|
||||||
{
|
{
|
||||||
|
MOZ_ASSERT(mDocument, "We should get a valid document from the caller!");
|
||||||
|
|
||||||
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aWindow);
|
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aWindow);
|
||||||
|
|
||||||
// If the pref is not set, don't create the Promise (which the page wouldn't
|
// If the pref is not set, don't create the Promise (which the page wouldn't
|
||||||
|
@ -1473,9 +1475,9 @@ FontFaceSet::OnFontFaceStatusChanged(FontFace* aFontFace)
|
||||||
if (!mDelayedLoadCheck) {
|
if (!mDelayedLoadCheck) {
|
||||||
mDelayedLoadCheck = true;
|
mDelayedLoadCheck = true;
|
||||||
nsCOMPtr<nsIRunnable> checkTask =
|
nsCOMPtr<nsIRunnable> checkTask =
|
||||||
NewRunnableMethod("FontFaceSet::CheckLoadingFinishedAfterDelay",
|
NewRunnableMethod(this, &FontFaceSet::CheckLoadingFinishedAfterDelay);
|
||||||
this, &FontFaceSet::CheckLoadingFinishedAfterDelay);
|
mDocument->Dispatch("FontFaceSet::CheckLoadingFinishedAfterDelay",
|
||||||
NS_DispatchToMainThread(checkTask);
|
TaskCategory::Other, checkTask.forget());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче