зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1550131 - Expose an iterator for AboutLoginsParent subscribers. r=jaws
Differential Revision: https://phabricator.services.mozilla.com/D31698 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
f93ea0beb4
Коммит
12bb2a4ea0
|
@ -141,7 +141,7 @@ var AboutLoginsParent = {
|
|||
}
|
||||
},
|
||||
|
||||
messageSubscribers(name, details) {
|
||||
* _subscriberIterator() {
|
||||
let subscribers = ChromeUtils.nondeterministicGetWeakSetKeys(this._subscribers);
|
||||
for (let subscriber of subscribers) {
|
||||
if (subscriber.remoteType != EXPECTED_ABOUTLOGINS_REMOTE_TYPE ||
|
||||
|
@ -150,6 +150,12 @@ var AboutLoginsParent = {
|
|||
this._subscribers.delete(subscriber);
|
||||
continue;
|
||||
}
|
||||
yield subscriber;
|
||||
}
|
||||
},
|
||||
|
||||
messageSubscribers(name, details) {
|
||||
for (let subscriber of this._subscriberIterator()) {
|
||||
try {
|
||||
subscriber.messageManager.sendAsyncMessage(name, details);
|
||||
} catch (ex) {}
|
||||
|
|
Загрузка…
Ссылка в новой задаче