Bug 1203330 Part 2 Convert EventManager uses to SingletonEventManager r=kmag

MozReview-Commit-ID: A12TPwAYzTS
This commit is contained in:
Andrew Swan
2017-01-26 11:27:03 -08:00
parent 1ac8741081
commit d23b45b581
12 changed files with 66 additions and 67 deletions

View File

@@ -6,7 +6,7 @@ Cu.import("resource://devtools/shared/event-emitter.js");
Cu.import("resource://gre/modules/ExtensionUtils.jsm");
var {
EventManager,
SingletonEventManager,
PlatformInfo,
} = ExtensionUtils;
@@ -245,9 +245,9 @@ extensions.registerSchemaAPI("commands", "addon_parent", context => {
});
}));
},
onCommand: new EventManager(context, "commands.onCommand", fire => {
onCommand: new SingletonEventManager(context, "commands.onCommand", fire => {
let listener = (eventName, commandName) => {
fire(commandName);
fire.async(commandName);
};
commandsMap.get(extension).on("command", listener);
return () => {