Bug 1293126 - Remove Schemas.load from content's ExtensionContext draft
authorRob Wu <rob@robwu.nl>
Sun, 07 Aug 2016 17:59:58 -0700
changeset 397692 7b113f92b760cb9841187f35c8cd9c3a5bb93219
parent 397691 85ffdf45bd017aad86d6af94380694ce93c872cd
child 527503 1f62dbc59a5586d4506fbd48a31d34ddff060fd9
push id25352
push userbmo:rob@robwu.nl
push dateMon, 08 Aug 2016 01:15:16 +0000
bugs1293126
milestone51.0a1
Bug 1293126 - Remove Schemas.load from content's ExtensionContext MozReview-Commit-ID: JOToEC2Aokp
toolkit/components/extensions/ExtensionContent.jsm
--- a/toolkit/components/extensions/ExtensionContent.jsm
+++ b/toolkit/components/extensions/ExtensionContent.jsm
@@ -410,31 +410,23 @@ class ExtensionContext extends BaseConte
     this.messenger = new Messenger(this, [mm], sender, filter, delegate);
 
     this.chromeObj = Cu.createObjectIn(this.sandbox, {defineAs: "browser"});
 
     // Sandboxes don't get Xrays for some weird compatibility
     // reason. However, we waive here anyway in case that changes.
     Cu.waiveXrays(this.sandbox).chrome = this.chromeObj;
 
-    let apis = {
-      "storage": "chrome://extensions/content/schemas/storage.json",
-      "test": "chrome://extensions/content/schemas/test.json",
-    };
-
     let incognito = PrivateBrowsingUtils.isContentWindowPrivate(this.contentWindow);
-    this.childManager = new ChildAPIManager(this, mm, Object.keys(apis), {
+    this.childManager = new ChildAPIManager(this, mm, ["storage", "test"], {
       type: "content_script",
       url,
       incognito,
     });
 
-    for (let api in apis) {
-      Schemas.load(apis[api]);
-    }
     Schemas.inject(this.chromeObj, this.childManager);
 
     injectAPI(api(this), this.chromeObj);
 
     // This is an iframe with content script API enabled. (See Bug 1214658 for rationale)
     if (isExtensionPage) {
       Cu.waiveXrays(this.contentWindow).chrome = this.chromeObj;
       Cu.waiveXrays(this.contentWindow).browser = this.chromeObj;