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:
Matthew Noorenberghe 2019-05-21 13:15:44 +00:00
Родитель f93ea0beb4
Коммит 12bb2a4ea0
1 изменённых файлов: 7 добавлений и 1 удалений

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

@ -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) {}