зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1641496 - P5: Make nsHttpActivityDistributor::AddObserver work if socket process is not ready r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D77276
This commit is contained in:
Родитель
cba8b4bdfc
Коммит
e6bff0a49c
|
@ -152,12 +152,13 @@ nsHttpActivityDistributor::AddObserver(nsIHttpActivityObserver* aObserver) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nsIOService::UseSocketProcess() && wasEmpty) {
|
if (nsIOService::UseSocketProcess() && wasEmpty) {
|
||||||
SocketProcessParent* parent = SocketProcessParent::GetSingleton();
|
auto task = []() {
|
||||||
if (parent && parent->CanSend()) {
|
SocketProcessParent* parent = SocketProcessParent::GetSingleton();
|
||||||
Unused << parent->SendOnHttpActivityDistributorActivated(true);
|
if (parent && parent->CanSend()) {
|
||||||
} else {
|
Unused << parent->SendOnHttpActivityDistributorActivated(true);
|
||||||
return NS_ERROR_FAILURE;
|
}
|
||||||
}
|
};
|
||||||
|
gIOService->CallOrWaitForSocketProcess(task);
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -177,12 +178,13 @@ nsHttpActivityDistributor::RemoveObserver(nsIHttpActivityObserver* aObserver) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nsIOService::UseSocketProcess() && isEmpty) {
|
if (nsIOService::UseSocketProcess() && isEmpty) {
|
||||||
SocketProcessParent* parent = SocketProcessParent::GetSingleton();
|
auto task = []() {
|
||||||
if (parent && parent->CanSend()) {
|
SocketProcessParent* parent = SocketProcessParent::GetSingleton();
|
||||||
Unused << parent->SendOnHttpActivityDistributorActivated(false);
|
if (parent && parent->CanSend()) {
|
||||||
} else {
|
Unused << parent->SendOnHttpActivityDistributorActivated(false);
|
||||||
return NS_ERROR_FAILURE;
|
}
|
||||||
}
|
};
|
||||||
|
gIOService->CallOrWaitForSocketProcess(task);
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче