icecat: add release icecat-140.10.1-1gnu1 for ecne
This commit is contained in:
parent
a5f93cb214
commit
ff85d7c623
1256 changed files with 63469 additions and 24141 deletions
|
|
@ -385,35 +385,45 @@ void FontFaceImpl::SetStatus(FontFaceLoadStatus aStatus) {
|
|||
}
|
||||
|
||||
void FontFaceImpl::UpdateOwnerPromise() {
|
||||
if (!mFontFaceSet->IsOnOwningThread()) {
|
||||
mFontFaceSet->DispatchToOwningThread(
|
||||
"FontFaceImpl::UpdateOwnerPromise",
|
||||
[self = RefPtr{this}] { self->UpdateOwnerPromise(); });
|
||||
mFontFaceSet->DispatchToOwningThread(
|
||||
"FontFaceImpl::UpdateOwnerPromise",
|
||||
[self = RefPtr{this}] { self->UpdateOwnerPromiseSync(); });
|
||||
}
|
||||
|
||||
void FontFaceImpl::UpdateOwnerKeepAlive() {
|
||||
AssertIsOnOwningThread();
|
||||
if (!mOwner) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(!mKeepingOwnerAlive);
|
||||
return;
|
||||
}
|
||||
const bool shouldKeepOwnerAlive =
|
||||
mStatus == FontFaceLoadStatus::Loading && !!mOwner->GetParentObject();
|
||||
if (shouldKeepOwnerAlive == mKeepingOwnerAlive) {
|
||||
return;
|
||||
}
|
||||
mKeepingOwnerAlive = shouldKeepOwnerAlive;
|
||||
if (shouldKeepOwnerAlive) {
|
||||
mOwner->AddRef();
|
||||
} else {
|
||||
mOwner->Release();
|
||||
}
|
||||
}
|
||||
|
||||
void FontFaceImpl::UpdateOwnerPromiseSync() {
|
||||
if (NS_WARN_IF(!mOwner)) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(!mKeepingOwnerAlive);
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr owner = mOwner;
|
||||
UpdateOwnerKeepAlive();
|
||||
if (mStatus == FontFaceLoadStatus::Loaded) {
|
||||
mOwner->MaybeResolve();
|
||||
owner->MaybeResolve();
|
||||
} else if (mStatus == FontFaceLoadStatus::Error) {
|
||||
if (mSourceType == eSourceType_Buffer) {
|
||||
mOwner->MaybeReject(NS_ERROR_DOM_SYNTAX_ERR);
|
||||
owner->MaybeReject(NS_ERROR_DOM_SYNTAX_ERR);
|
||||
} else {
|
||||
mOwner->MaybeReject(NS_ERROR_DOM_NETWORK_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
const bool shouldKeepOwnerAlive = mStatus == FontFaceLoadStatus::Loading;
|
||||
if (shouldKeepOwnerAlive != mKeepingOwnerAlive) {
|
||||
mKeepingOwnerAlive = shouldKeepOwnerAlive;
|
||||
if (shouldKeepOwnerAlive) {
|
||||
mOwner->AddRef();
|
||||
} else {
|
||||
mOwner->Release();
|
||||
owner->MaybeReject(NS_ERROR_DOM_NETWORK_ERR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue