зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1645511 - Improve the provider manager's provider.updateBehavior calls. r=mak
I considered wrapping `provider.tryMethod("updateBehavior", queryContext)` in a promise in case there are implementations that aren't async or don't return a promise. But there's only one implementation of `updateBehavior`, it's async, and we probably won't end up with any more implementations, so for simplicity I didn't. Differential Revision: https://phabricator.services.mozilla.com/D79559
This commit is contained in:
Родитель
7024c06712
Коммит
15284e839e
|
@ -206,12 +206,21 @@ class ProvidersManager {
|
|||
}
|
||||
|
||||
// Update the behavior of extension providers.
|
||||
let updateBehaviorPromises = [];
|
||||
for (let provider of this.providers) {
|
||||
if (
|
||||
provider.type == UrlbarUtils.PROVIDER_TYPE.EXTENSION &&
|
||||
provider.name != "Omnibox"
|
||||
) {
|
||||
await provider.tryMethod("updateBehavior", queryContext);
|
||||
updateBehaviorPromises.push(
|
||||
provider.tryMethod("updateBehavior", queryContext)
|
||||
);
|
||||
}
|
||||
}
|
||||
if (updateBehaviorPromises.length) {
|
||||
await Promise.all(updateBehaviorPromises);
|
||||
if (query.canceled) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче