Skip to content

Commit

Permalink
Bug 798491: Add an option to stick all chrome JSMs/JS components in t…
Browse files Browse the repository at this point in the history
…he same compartment. r=mrbkap,philikon
  • Loading branch information
khuey committed Oct 30, 2012
1 parent 5578554 commit 50b5d3f
Show file tree
Hide file tree
Showing 477 changed files with 2,319 additions and 2,089 deletions.
4 changes: 2 additions & 2 deletions accessible/src/jsat/AccessFu.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;

var EXPORTED_SYMBOLS = ['AccessFu'];
this.EXPORTED_SYMBOLS = ['AccessFu'];

Cu.import('resource://gre/modules/Services.jsm');
Cu.import('resource://gre/modules/Geometry.jsm');
Expand All @@ -21,7 +21,7 @@ const ACCESSFU_DISABLE = 0;
const ACCESSFU_ENABLE = 1;
const ACCESSFU_AUTO = 2;

var AccessFu = {
this.AccessFu = {
/**
* Initialize chrome-layer accessibility functionality.
* If accessibility is enabled on the platform, then a special accessibility
Expand Down
4 changes: 2 additions & 2 deletions accessible/src/jsat/EventManager.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Cu.import('resource://gre/modules/accessibility/TraversalRules.jsm');
Cu.import('resource://gre/modules/Services.jsm');
Cu.import('resource://gre/modules/XPCOMUtils.jsm');

var EXPORTED_SYMBOLS = ['EventManager'];
this.EXPORTED_SYMBOLS = ['EventManager'];

var EventManager = {
this.EventManager = {
editState: {},

start: function start(aSendMsgFunc) {
Expand Down
18 changes: 9 additions & 9 deletions accessible/src/jsat/Presenters.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ Cu.import('resource://gre/modules/accessibility/Utils.jsm');
Cu.import('resource://gre/modules/accessibility/UtteranceGenerator.jsm');
Cu.import('resource://gre/modules/Geometry.jsm');

var EXPORTED_SYMBOLS = ['VisualPresenter',
'AndroidPresenter',
'DummyAndroidPresenter',
'SpeechPresenter',
'PresenterContext'];
this.EXPORTED_SYMBOLS = ['VisualPresenter',
'AndroidPresenter',
'DummyAndroidPresenter',
'SpeechPresenter',
'PresenterContext'];

/**
* The interface for all presenter classes. A presenter could be, for example,
Expand Down Expand Up @@ -111,7 +111,7 @@ Presenter.prototype = {
* Visual presenter. Draws a box around the virtual cursor's position.
*/

function VisualPresenter() {}
this.VisualPresenter = function VisualPresenter() {}

VisualPresenter.prototype = {
__proto__: Presenter.prototype,
Expand Down Expand Up @@ -179,7 +179,7 @@ VisualPresenter.prototype = {
* Android presenter. Fires Android a11y events.
*/

function AndroidPresenter() {}
this.AndroidPresenter = function AndroidPresenter() {}

AndroidPresenter.prototype = {
__proto__: Presenter.prototype,
Expand Down Expand Up @@ -332,7 +332,7 @@ AndroidPresenter.prototype = {
* A speech presenter for direct TTS output
*/

function SpeechPresenter() {}
this.SpeechPresenter = function SpeechPresenter() {}

SpeechPresenter.prototype = {
__proto__: Presenter.prototype,
Expand Down Expand Up @@ -376,7 +376,7 @@ SpeechPresenter.prototype = {
* PresenterContext: An object that generates and caches context information
* for a given accessible and its relationship with another accessible.
*/
function PresenterContext(aAccessible, aOldAccessible) {
this.PresenterContext = function PresenterContext(aAccessible, aOldAccessible) {
this._accessible = aAccessible;
this._oldAccessible =
this._isDefunct(aOldAccessible) ? null : aOldAccessible;
Expand Down
6 changes: 3 additions & 3 deletions accessible/src/jsat/TouchAdapter.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;

var EXPORTED_SYMBOLS = ['TouchAdapter', 'AndroidTouchAdapter'];
this.EXPORTED_SYMBOLS = ['TouchAdapter', 'AndroidTouchAdapter'];

Cu.import('resource://gre/modules/accessibility/Utils.jsm');

// We should not be emitting explore events more than 10 times a second.
// It is granular enough to feel natural, and it does not hammer the CPU.
const EXPLORE_THROTTLE = 100;

var TouchAdapter = {
this.TouchAdapter = {
// minimal swipe distance in inches
SWIPE_MIN_DISTANCE: 0.4,

Expand Down Expand Up @@ -366,7 +366,7 @@ var Mouse2Touch = {
}
};

var AndroidTouchAdapter = {
this.AndroidTouchAdapter = {
attach: function AndroidTouchAdapter_attach(aWindow) {
if (this.chromeWin)
return;
Expand Down
4 changes: 2 additions & 2 deletions accessible/src/jsat/TraversalRules.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;

var EXPORTED_SYMBOLS = ['TraversalRules'];
this.EXPORTED_SYMBOLS = ['TraversalRules'];

Cu.import('resource://gre/modules/accessibility/Utils.jsm');
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
Expand Down Expand Up @@ -70,7 +70,7 @@ var gSimpleTraversalRoles =
// Used for traversing in to child OOP frames.
Ci.nsIAccessibleRole.ROLE_INTERNAL_FRAME];

var TraversalRules = {
this.TraversalRules = {
Simple: new BaseTraversalRule(
gSimpleTraversalRoles,
function Simple_match(aAccessible) {
Expand Down
6 changes: 3 additions & 3 deletions accessible/src/jsat/Utils.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ const Ci = Components.interfaces;

Cu.import('resource://gre/modules/Services.jsm');

var EXPORTED_SYMBOLS = ['Utils', 'Logger'];
this.EXPORTED_SYMBOLS = ['Utils', 'Logger'];

var Utils = {
this.Utils = {
_buildAppMap: {
'{3c2e2abc-06d4-11e1-ac3b-374f68613e61}': 'b2g',
'{ec8030f7-c20a-464f-9b0e-13a3a9e97384}': 'browser',
Expand Down Expand Up @@ -156,7 +156,7 @@ var Utils = {
}
};

var Logger = {
this.Logger = {
DEBUG: 0,
INFO: 1,
WARNING: 2,
Expand Down
4 changes: 2 additions & 2 deletions accessible/src/jsat/UtteranceGenerator.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var gStringBundle = Cc['@mozilla.org/intl/stringbundle;1'].
createBundle('chrome://global/locale/AccessFu.properties');


var EXPORTED_SYMBOLS = ['UtteranceGenerator'];
this.EXPORTED_SYMBOLS = ['UtteranceGenerator'];

Cu.import('resource://gre/modules/accessibility/Utils.jsm');

Expand All @@ -38,7 +38,7 @@ Cu.import('resource://gre/modules/accessibility/Utils.jsm');
* clicked event. Speaking only 'clicked' makes sense. Speaking 'button' does
* not.
*/
var UtteranceGenerator = {
this.UtteranceGenerator = {
gActionMap: {
jump: 'jumpAction',
press: 'pressAction',
Expand Down
2 changes: 2 additions & 0 deletions b2g/app/b2g.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,3 +576,5 @@ pref("network.activity.blipIntervalMilliseconds", 250);
// Send some sites a custom user-agent.
pref("general.useragent.override.facebook.com", "\(Mobile#(Android; Mobile");
pref("general.useragent.override.youtube.com", "\(Mobile#(Android; Mobile");

pref("jsloader.reuseGlobal", true);
2 changes: 1 addition & 1 deletion b2g/components/ActivitiesGlue.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ ActivitiesDialog.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIActivityUIGlue, Ci.nsIRunnable])
}

const NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivitiesDialog]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivitiesDialog]);

2 changes: 1 addition & 1 deletion b2g/components/AlertsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ AlertsService.prototype = {
}
};

const NSGetFactory = XPCOMUtils.generateNSGetFactory([AlertsService]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AlertsService]);
2 changes: 1 addition & 1 deletion b2g/components/ContentHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ ContentHandler.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentHandler])
};

var NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentHandler]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentHandler]);
2 changes: 1 addition & 1 deletion b2g/components/ContentPermissionPrompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,4 @@ ContentPermissionPrompt.prototype = {


//module initialization
const NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPermissionPrompt]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPermissionPrompt]);
2 changes: 1 addition & 1 deletion b2g/components/DirectoryProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ DirectoryProvider.prototype = {
}
};

const NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]);
2 changes: 1 addition & 1 deletion b2g/components/MailtoProtocolHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ MailtoProtocolHandler.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler])
};

let NSGetFactory = XPCOMUtils.generateNSGetFactory([MailtoProtocolHandler]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([MailtoProtocolHandler]);
2 changes: 1 addition & 1 deletion b2g/components/MozKeyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,5 @@ MozKeyboard.prototype = {
}
};

const NSGetFactory = XPCOMUtils.generateNSGetFactory([MozKeyboard]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([MozKeyboard]);

2 changes: 1 addition & 1 deletion b2g/components/PaymentGlue.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@ PaymentUI.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIPaymentUIGlue])
}

const NSGetFactory = XPCOMUtils.generateNSGetFactory([PaymentUI]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PaymentUI]);
2 changes: 1 addition & 1 deletion b2g/components/ProcessGlobal.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ ProcessGlobal.prototype = {
},
};

var NSGetFactory = XPCOMUtils.generateNSGetFactory([ProcessGlobal]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ProcessGlobal]);
2 changes: 1 addition & 1 deletion b2g/components/RecoveryService.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ RecoveryService.prototype = {
}
};

const NSGetFactory = XPCOMUtils.generateNSGetFactory([RecoveryService]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RecoveryService]);
2 changes: 1 addition & 1 deletion b2g/components/SmsProtocolHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ SmsProtocolHandler.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler])
};

let NSGetFactory = XPCOMUtils.generateNSGetFactory([SmsProtocolHandler]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SmsProtocolHandler]);
2 changes: 1 addition & 1 deletion b2g/components/TelProtocolHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ TelProtocolHandler.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler])
};

let NSGetFactory = XPCOMUtils.generateNSGetFactory([TelProtocolHandler]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TelProtocolHandler]);
4 changes: 2 additions & 2 deletions b2g/components/TelURIParser.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

"use strict";

let EXPORTED_SYMBOLS = ["TelURIParser"];
this.EXPORTED_SYMBOLS = ["TelURIParser"];

/**
* Singleton providing functionality for parsing tel: and sms: URIs
*/
let TelURIParser = {
this.TelURIParser = {
parseURI: function(scheme, uri) {
// Ignore MWI and USSD codes. See 794034.
if (uri.indexOf('*') != -1 || uri.indexOf('#') != -1) {
Expand Down
2 changes: 1 addition & 1 deletion b2g/components/UpdatePrompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,4 +411,4 @@ UpdatePrompt.prototype = {
onStatus: function UP_onStatus(aRequest, aUpdate, aStatus, aStatusArg) { }
};

const NSGetFactory = XPCOMUtils.generateNSGetFactory([UpdatePrompt]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([UpdatePrompt]);
2 changes: 1 addition & 1 deletion b2g/components/YoutubeProtocolHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@ YoutubeProtocolHandler.prototype = {
}
};

const NSGetFactory = XPCOMUtils.generateNSGetFactory([YoutubeProtocolHandler]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([YoutubeProtocolHandler]);
4 changes: 2 additions & 2 deletions browser/components/distribution.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* 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/. */

EXPORTED_SYMBOLS = [ "DistributionCustomizer" ];
this.EXPORTED_SYMBOLS = [ "DistributionCustomizer" ];

const Ci = Components.interfaces;
const Cc = Components.classes;
Expand All @@ -16,7 +16,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
"resource://gre/modules/PlacesUtils.jsm");

function DistributionCustomizer() {
this.DistributionCustomizer = function DistributionCustomizer() {
let dirSvc = Cc["@mozilla.org/file/directory_service;1"].
getService(Ci.nsIProperties);
let iniFile = dirSvc.get("XCurProcD", Ci.nsIFile);
Expand Down
4 changes: 2 additions & 2 deletions browser/components/downloads/src/DownloadsCommon.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

"use strict";

var EXPORTED_SYMBOLS = [
this.EXPORTED_SYMBOLS = [
"DownloadsCommon",
];

Expand Down Expand Up @@ -87,7 +87,7 @@ XPCOMUtils.defineLazyGetter(this, "DownloadsLocalFileCtor", function () {
* This object is exposed directly to the consumers of this JavaScript module,
* and provides shared methods for all the instances of the user interface.
*/
const DownloadsCommon = {
this.DownloadsCommon = {
/**
* Returns an object whose keys are the string names from the downloads string
* bundle, and whose values are either the translated strings or functions
Expand Down
2 changes: 1 addition & 1 deletion browser/components/downloads/src/DownloadsStartup.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,4 @@ DownloadsStartup.prototype = {
////////////////////////////////////////////////////////////////////////////////
//// Module

const NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadsStartup]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadsStartup]);
2 changes: 1 addition & 1 deletion browser/components/downloads/src/DownloadsUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ DownloadsUI.prototype = {
////////////////////////////////////////////////////////////////////////////////
//// Module

const NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadsUI]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadsUI]);
2 changes: 1 addition & 1 deletion browser/components/feeds/src/FeedConverter.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,4 +579,4 @@ var components = [FeedConverter,
PodCastProtocolHandler];


const NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
2 changes: 1 addition & 1 deletion browser/components/feeds/src/FeedWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1378,4 +1378,4 @@ FeedWriter.prototype = {
Ci.nsINavHistoryObserver])
};

var NSGetFactory = XPCOMUtils.generateNSGetFactory([FeedWriter]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([FeedWriter]);
2 changes: 1 addition & 1 deletion browser/components/feeds/src/WebContentConverter.js
Original file line number Diff line number Diff line change
Expand Up @@ -899,4 +899,4 @@ WebContentConverterRegistrar.prototype = {
}]
};

var NSGetFactory = XPCOMUtils.generateNSGetFactory([WebContentConverterRegistrar]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WebContentConverterRegistrar]);
2 changes: 1 addition & 1 deletion browser/components/migration/src/ChromeProfileMigrator.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,4 +340,4 @@ ChromeProfileMigrator.prototype.classDescription = "Chrome Profile Migrator";
ChromeProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=chrome";
ChromeProfileMigrator.prototype.classID = Components.ID("{4cec1de4-1671-4fc3-a53e-6c539dc77a26}");

const NSGetFactory = XPCOMUtils.generateNSGetFactory([ChromeProfileMigrator]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ChromeProfileMigrator]);
2 changes: 1 addition & 1 deletion browser/components/migration/src/FirefoxProfileMigrator.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ FirefoxProfileMigrator.prototype.classDescription = "Firefox Profile Migrator";
FirefoxProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=firefox";
FirefoxProfileMigrator.prototype.classID = Components.ID("{91185366-ba97-4438-acba-48deaca63386}");

const NSGetFactory = XPCOMUtils.generateNSGetFactory([FirefoxProfileMigrator]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([FirefoxProfileMigrator]);
2 changes: 1 addition & 1 deletion browser/components/migration/src/IEProfileMigrator.js
Original file line number Diff line number Diff line change
Expand Up @@ -675,4 +675,4 @@ IEProfileMigrator.prototype.classDescription = "IE Profile Migrator";
IEProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=ie";
IEProfileMigrator.prototype.classID = Components.ID("{3d2532e3-4932-4774-b7ba-968f5899d3a4}");

const NSGetFactory = XPCOMUtils.generateNSGetFactory([IEProfileMigrator]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([IEProfileMigrator]);
6 changes: 3 additions & 3 deletions browser/components/migration/src/MigrationUtils.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

"use strict";

let EXPORTED_SYMBOLS = ["MigrationUtils", "MigratorPrototype"];
this.EXPORTED_SYMBOLS = ["MigrationUtils", "MigratorPrototype"];

const Cu = Components.utils;
const Ci = Components.interfaces;
Expand Down Expand Up @@ -86,7 +86,7 @@ function getMigratorKeyForDefaultBrowser() {
* override |sourceHomePageURL| getter.
* 7. For startup-only migrators, override |startupOnlyMigrator|.
*/
let MigratorPrototype = {
this.MigratorPrototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIBrowserProfileMigrator]),

/**
Expand Down Expand Up @@ -323,7 +323,7 @@ let MigratorPrototype = {
}
};

let MigrationUtils = Object.freeze({
this.MigrationUtils = Object.freeze({
resourceTypes: {
SETTINGS: Ci.nsIBrowserProfileMigrator.SETTINGS,
COOKIES: Ci.nsIBrowserProfileMigrator.COOKIES,
Expand Down
2 changes: 1 addition & 1 deletion browser/components/migration/src/ProfileMigrator.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ ProfileMigrator.prototype = {
classID: Components.ID("6F8BB968-C14F-4D6F-9733-6C6737B35DCE")
};

let NSGetFactory = XPCOMUtils.generateNSGetFactory([ProfileMigrator]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ProfileMigrator]);
2 changes: 1 addition & 1 deletion browser/components/migration/src/SafariProfileMigrator.js
Original file line number Diff line number Diff line change
Expand Up @@ -677,4 +677,4 @@ SafariProfileMigrator.prototype.classDescription = "Safari Profile Migrator";
SafariProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=safari";
SafariProfileMigrator.prototype.classID = Components.ID("{4b609ecf-60b2-4655-9df4-dc149e474da1}");

const NSGetFactory = XPCOMUtils.generateNSGetFactory([SafariProfileMigrator]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SafariProfileMigrator]);
Loading

0 comments on commit 50b5d3f

Please sign in to comment.