Bug 1295082 - Put Extension in BaseContext r=kmag

ExtensionContext in Extension.jsm has |extension| as an instance member,
so use it instead of passing |extension| to registerSchemaAPI's
callback.

And to make sure that this pattern also works in content processes, move
the |extension| member to BaseContext.

MozReview-Commit-ID: BgsGGCPQxJR
This commit is contained in:
Rob Wu
2016-08-15 01:04:58 -07:00
parent ede65c6768
commit 6189daa99f
28 changed files with 83 additions and 69 deletions

View File

@@ -228,7 +228,8 @@ extensions.on("shutdown", (type, extension) => {
});
/* eslint-enable mozilla/balanced-listeners */
extensions.registerSchemaAPI("commands", (extension, context) => {
extensions.registerSchemaAPI("commands", context => {
let {extension} = context;
return {
commands: {
getAll() {