Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 836177 - Temporarily merge more JSMs to mitigate compartment over…
Browse files Browse the repository at this point in the history
…head; r=rnewman

As with bug 834936, this is meant to be temporary until zones land and
we have decent JSM overhead levels.
  • Loading branch information
indygreg committed Jan 30, 2013
1 parent 2a7284c commit 7b20591
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 8 deletions.
12 changes: 8 additions & 4 deletions services/common/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,21 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk

modules := \
async.js \
log4moz.js \
observers.js \
preferences.js \
rest.js \
storageservice.js \
stringbundle.js \
tokenserverclient.js \
utils.js \
$(NULL)

pp_modules := \
async.js \
bagheeraclient.js \
observers.js \
rest.js \
$(NULL)

testing_modules := \
aitcserver.js \
bagheeraserver.js \
Expand All @@ -44,7 +48,7 @@ INSTALL_TARGETS += MODULES
TESTING_JS_MODULES := $(addprefix modules-testing/,$(testing_modules))
TESTING_JS_MODULE_DIR := services-common

PP_JS_MODULES := bagheeraclient.js
PP_JS_MODULES := $(pp_modules)
PP_JS_MODULES_PATH = $(FINAL_TARGET)/modules/services-common
PP_TARGETS += PP_JS_MODULES

Expand Down
4 changes: 4 additions & 0 deletions services/common/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
* 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/. */

#ifndef MERGED_COMPARTMENT

this.EXPORTED_SYMBOLS = ["Async"];

const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;

#endif

// Constants for makeSyncCallback, waitForSyncCallback.
const CB_READY = {};
const CB_COMPLETE = {};
Expand Down
2 changes: 1 addition & 1 deletion services/common/bagheeraclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ this.EXPORTED_SYMBOLS = [

const {classes: Cc, interfaces: Ci, utils: Cu} = Components;

Cu.import("resource://services-common/rest.js");
#endif

Cu.import("resource://gre/modules/commonjs/promise/core.js");
Cu.import("resource://services-common/log4moz.js");
Cu.import("resource://services-common/rest.js");
Cu.import("resource://services-common/utils.js");


Expand Down
4 changes: 4 additions & 0 deletions services/common/observers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
* 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/. */

#ifndef MERGED_COMPARTMENT

this.EXPORTED_SYMBOLS = ["Observers"];

const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
const Cu = Components.utils;

#endif

Cu.import("resource://gre/modules/XPCOMUtils.jsm");

/**
Expand Down
8 changes: 7 additions & 1 deletion services/common/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* 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/. */

#ifndef MERGED_COMPARTMENT

const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;

this.EXPORTED_SYMBOLS = [
Expand All @@ -10,13 +12,17 @@ this.EXPORTED_SYMBOLS = [
"TokenAuthenticatedRESTRequest"
];

#endif

Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://services-crypto/utils.js");
Cu.import("resource://services-common/log4moz.js");
Cu.import("resource://services-common/preferences.js");
Cu.import("resource://services-common/utils.js");

XPCOMUtils.defineLazyModuleGetter(this, "CryptoUtils",
"resource://services-crypto/utils.js");

const Prefs = new Preferences("services.common.rest.");

/**
Expand Down
3 changes: 2 additions & 1 deletion services/datareporting/DataReportingService.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;

Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://services-common/observers.js");
Cu.import("resource://services-common/preferences.js");
Cu.import("resource://services-common/utils.js");

Expand Down Expand Up @@ -257,6 +256,8 @@ this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DataReportingService]);

#define MERGED_COMPARTMENT

#include ../common/observers.js
;
#include policy.jsm
;
#include sessions.jsm
Expand Down
2 changes: 2 additions & 0 deletions services/healthreport/HealthReport.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
// issue.
#define MERGED_COMPARTMENT

#include ../common/async.js
;
#include ../common/bagheeraclient.js
;
#include ../metrics/Metrics.jsm
Expand Down
2 changes: 1 addition & 1 deletion services/healthreport/healthreporter.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;

Cu.import("resource://gre/modules/Metrics.jsm");
Cu.import("resource://services-common/bagheeraclient.js");
Cu.import("resource://services-common/async.js");
#endif

Cu.import("resource://services-common/async.js");
Cu.import("resource://services-common/log4moz.js");
Cu.import("resource://services-common/preferences.js");
Cu.import("resource://services-common/utils.js");
Expand Down

0 comments on commit 7b20591

Please sign in to comment.