Bug 933273 - Prevent loading AddonManager in webbrowser actor when not explicitely needed. r=nfitzgerald, a=lsblakk
authorAlexandre Poirot <poirot.alex@gmail.com>
Mon, 04 Nov 2013 17:30:10 -0500
changeset 161001 216511295a98dd8c9586b29986b9786e4bc6cbf2
parent 161000 1bd0de861b334dea32310be690a530a92d643175
child 161002 8a0c3982f7a1f18235b169935cf5c4889c97c956
push id2987
push userryanvm@gmail.com
push dateWed, 06 Nov 2013 20:57:39 +0000
treeherdermozilla-beta@ca693fb76f9b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnfitzgerald, lsblakk
bugs933273
milestone26.0
Bug 933273 - Prevent loading AddonManager in webbrowser actor when not explicitely needed. r=nfitzgerald, a=lsblakk
toolkit/devtools/server/actors/webbrowser.js
--- a/toolkit/devtools/server/actors/webbrowser.js
+++ b/toolkit/devtools/server/actors/webbrowser.js
@@ -2,16 +2,17 @@
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* 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 promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {}).Promise;
+XPCOMUtils.defineLazyModuleGetter(this, "AddonManager", "resource://gre/modules/AddonManager.jsm");
 
 /**
  * Browser-specific actors.
  */
 
 /**
  * Yield all windows of type |aWindowType|, from the oldest window to the
  * youngest, using nsIWindowMediator::getEnumerator. We're usually
@@ -841,18 +842,16 @@ BrowserTabActor.prototype = {
  */
 BrowserTabActor.prototype.requestTypes = {
   "attach": BrowserTabActor.prototype.onAttach,
   "detach": BrowserTabActor.prototype.onDetach,
   "reload": BrowserTabActor.prototype.onReload,
   "navigateTo": BrowserTabActor.prototype.onNavigateTo
 };
 
-Components.utils.import("resource://gre/modules/AddonManager.jsm");
-
 function BrowserAddonList(aConnection)
 {
   this._connection = aConnection;
   this._actorByAddonId = new Map();
   this._onListChanged = null;
 }
 
 BrowserAddonList.prototype.getList = function() {