Bug 1228932 - Create Quota background actor directly if PBackgroundChild exists; r=khuey

This commit is contained in:
Jan Varga 2015-12-01 11:54:40 +01:00
Родитель cb705a63a6
Коммит b3c22dc9ac
1 изменённых файлов: 9 добавлений и 6 удалений

Просмотреть файл

@ -333,12 +333,15 @@ QuotaManagerService::InitiateRequest(nsAutoPtr<PendingRequestInfo>& aInfo)
}
if (!mBackgroundActor && mPendingRequests.IsEmpty()) {
// We need to start the sequence to create a background actor for this
// thread.
RefPtr<BackgroundCreateCallback> cb = new BackgroundCreateCallback(this);
if (NS_WARN_IF(!BackgroundChild::GetOrCreateForCurrentThread(cb))) {
return NS_ERROR_FAILURE;
if (PBackgroundChild* actor = BackgroundChild::GetForCurrentThread()) {
BackgroundActorCreated(actor);
} else {
// We need to start the sequence to create a background actor for this
// thread.
RefPtr<BackgroundCreateCallback> cb = new BackgroundCreateCallback(this);
if (NS_WARN_IF(!BackgroundChild::GetOrCreateForCurrentThread(cb))) {
return NS_ERROR_FAILURE;
}
}
}