Bug 773845: lazy-load some social modules to see what effect that has on maxheap/allocs tests FIREFOX_AURORA_16_BASE
authorGavin Sharp <gavin@gavinsharp.com>
Mon, 16 Jul 2012 08:43:50 -0700
changeset 101218 6fdf9985acfe
parent 101217 934ef44ce5af
child 101219 9697eadafa13
push id18
push usershu@rfrn.org
push dateMon, 06 Aug 2012 22:42:45 +0000
bugs773845
milestone16.0a1
Bug 773845: lazy-load some social modules to see what effect that has on maxheap/allocs tests
toolkit/components/social/SocialProvider.jsm
toolkit/components/social/SocialService.jsm
--- a/toolkit/components/social/SocialProvider.jsm
+++ b/toolkit/components/social/SocialProvider.jsm
@@ -2,18 +2,20 @@
 /* vim: set 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/. */
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/FrameWorker.jsm");
-Cu.import("resource://gre/modules/WorkerAPI.jsm");
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+
+XPCOMUtils.defineLazyModuleGetter(this, "getFrameWorkerHandle", "resource://gre/modules/FrameWorker.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "WorkerAPI", "resource://gre/modules/WorkerAPI.jsm");
 
 const EXPORTED_SYMBOLS = ["SocialProvider"];
 
 /**
  * The SocialProvider object represents a social provider, and allows
  * access to its FrameWorker (if it has one).
  *
  * @constructor
--- a/toolkit/components/social/SocialService.jsm
+++ b/toolkit/components/social/SocialService.jsm
@@ -3,17 +3,18 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const EXPORTED_SYMBOLS = ["SocialService"];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/SocialProvider.jsm");
+
+XPCOMUtils.defineLazyModuleGetter(this, "SocialProvider", "resource://gre/modules/SocialProvider.jsm");
 
 // Internal helper methods and state
 let SocialServiceInternal = {
   enabled: Services.prefs.getBoolPref("social.enabled"),
   get providerArray() {
     return [p for ([, p] of Iterator(this.providers))];
   }
 };