mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1214516 - Sync check PBackgroundChild existence to initiate indexed DB open/delete request right away if it exists. r=khuey
This commit is contained in:
parent
44dd382ffd
commit
0bde4bb147
@ -684,8 +684,6 @@ IDBFactory::OpenInternal(nsIPrincipal* aPrincipal,
|
||||
}
|
||||
|
||||
if (!mBackgroundActor && mPendingRequests.IsEmpty()) {
|
||||
// We need to start the sequence to create a background actor for this
|
||||
// thread.
|
||||
BackgroundChildImpl::ThreadLocal* threadLocal =
|
||||
BackgroundChildImpl::GetThreadLocalForCurrentThread();
|
||||
|
||||
@ -705,12 +703,18 @@ IDBFactory::OpenInternal(nsIPrincipal* aPrincipal,
|
||||
newIDBThreadLocal = idbThreadLocal = new ThreadLocal(id);
|
||||
}
|
||||
|
||||
RefPtr<BackgroundCreateCallback> cb =
|
||||
new BackgroundCreateCallback(this, idbThreadLocal->GetLoggingInfo());
|
||||
if (NS_WARN_IF(!BackgroundChild::GetOrCreateForCurrentThread(cb))) {
|
||||
IDB_REPORT_INTERNAL_ERR();
|
||||
aRv.Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
||||
return nullptr;
|
||||
if (PBackgroundChild* actor = BackgroundChild::GetForCurrentThread()) {
|
||||
BackgroundActorCreated(actor, idbThreadLocal->GetLoggingInfo());
|
||||
} else {
|
||||
// We need to start the sequence to create a background actor for this
|
||||
// thread.
|
||||
RefPtr<BackgroundCreateCallback> cb =
|
||||
new BackgroundCreateCallback(this, idbThreadLocal->GetLoggingInfo());
|
||||
if (NS_WARN_IF(!BackgroundChild::GetOrCreateForCurrentThread(cb))) {
|
||||
IDB_REPORT_INTERNAL_ERR();
|
||||
aRv.Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (newIDBThreadLocal) {
|
||||
|
Loading…
Reference in New Issue
Block a user