Bug 989580 - Lazy load BrowserElementParent.jsm in BrowserElementParent.js. r=jst
authorRichard Newman <rnewman@mozilla.com>
Mon, 31 Mar 2014 14:04:38 -0700
changeset 176758 b5bcfca4bf5bdcf072789a46f08b6d199a97f4ba
parent 176757 ce6c24dd1faeebb0e7845fe613d5b25e7329c6b6
child 176759 aa3898f1f4dfeabad7ba5a5de4ce024b6c9b7e89
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersjst
bugs989580
milestone31.0a1
Bug 989580 - Lazy load BrowserElementParent.jsm in BrowserElementParent.js. r=jst
dom/browser-element/BrowserElementParent.js
--- a/dom/browser-element/BrowserElementParent.js
+++ b/dom/browser-element/BrowserElementParent.js
@@ -1,26 +1,26 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-let Cu = Components.utils;
-let Ci = Components.interfaces;
-let Cc = Components.classes;
-let Cr = Components.results;
+const {utils: Cu, interfaces: Ci} = Components;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/BrowserElementParent.jsm");
 
 const NS_PREFBRANCH_PREFCHANGE_TOPIC_ID = "nsPref:changed";
 const BROWSER_FRAMES_ENABLED_PREF = "dom.mozBrowserFramesEnabled";
 
+XPCOMUtils.defineLazyModuleGetter(this, "BrowserElementParentBuilder",
+                                  "resource://gre/modules/BrowserElementParent.jsm",
+                                  "BrowserElementParentBuilder");
+
 function debug(msg) {
   //dump("BrowserElementParent.js - " + msg + "\n");
 }
 
 /**
  * BrowserElementParent implements one half of <iframe mozbrowser>.  (The other
  * half is, unsurprisingly, BrowserElementChild.)
  *