diff --git a/browser/components/migration/360seProfileMigrator.js b/browser/components/migration/360seProfileMigrator.jsm similarity index 99% rename from browser/components/migration/360seProfileMigrator.js rename to browser/components/migration/360seProfileMigrator.jsm index e9e90af4d63a..ce17190dd3ef 100644 --- a/browser/components/migration/360seProfileMigrator.js +++ b/browser/components/migration/360seProfileMigrator.jsm @@ -321,4 +321,4 @@ Qihoo360seProfileMigrator.prototype.classDescription = "360 Secure Browser Profi Qihoo360seProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=360se"; Qihoo360seProfileMigrator.prototype.classID = Components.ID("{d0037b95-296a-4a4e-94b2-c3d075d20ab1}"); -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([Qihoo360seProfileMigrator]); +var EXPORTED_SYMBOLS = ["Qihoo360seProfileMigrator"]; diff --git a/browser/components/migration/BrowserProfileMigrators.manifest b/browser/components/migration/BrowserProfileMigrators.manifest deleted file mode 100644 index d1365d5ea948..000000000000 --- a/browser/components/migration/BrowserProfileMigrators.manifest +++ /dev/null @@ -1,38 +0,0 @@ -component {6F8BB968-C14F-4D6F-9733-6C6737B35DCE} ProfileMigrator.js -contract @mozilla.org/toolkit/profile-migrator;1 {6F8BB968-C14F-4D6F-9733-6C6737B35DCE} - -#if defined(XP_WIN) || defined(XP_MACOSX) -component {4bf85aa5-4e21-46ca-825f-f9c51a5e8c76} ChromeProfileMigrator.js -contract @mozilla.org/profile/migrator;1?app=browser&type=canary {4bf85aa5-4e21-46ca-825f-f9c51a5e8c76} -#else -component {47f75963-840b-4950-a1f0-d9c1864f8b8e} ChromeProfileMigrator.js -contract @mozilla.org/profile/migrator;1?app=browser&type=chrome-beta {47f75963-840b-4950-a1f0-d9c1864f8b8e} -component {7370a02a-4886-42c3-a4ec-d48c726ec30a} ChromeProfileMigrator.js -contract @mozilla.org/profile/migrator;1?app=browser&type=chrome-dev {7370a02a-4886-42c3-a4ec-d48c726ec30a} -#endif -component {4cec1de4-1671-4fc3-a53e-6c539dc77a26} ChromeProfileMigrator.js -contract @mozilla.org/profile/migrator;1?app=browser&type=chrome {4cec1de4-1671-4fc3-a53e-6c539dc77a26} -component {8cece922-9720-42de-b7db-7cef88cb07ca} ChromeProfileMigrator.js -contract @mozilla.org/profile/migrator;1?app=browser&type=chromium {8cece922-9720-42de-b7db-7cef88cb07ca} - -component {91185366-ba97-4438-acba-48deaca63386} FirefoxProfileMigrator.js -contract @mozilla.org/profile/migrator;1?app=browser&type=firefox {91185366-ba97-4438-acba-48deaca63386} - -#ifdef HAS_IE_MIGRATOR -component {3d2532e3-4932-4774-b7ba-968f5899d3a4} IEProfileMigrator.js -contract @mozilla.org/profile/migrator;1?app=browser&type=ie {3d2532e3-4932-4774-b7ba-968f5899d3a4} -#endif - -#ifdef HAS_EDGE_MIGRATOR -component {62e8834b-2d17-49f5-96ff-56344903a2ae} EdgeProfileMigrator.js -contract @mozilla.org/profile/migrator;1?app=browser&type=edge {62e8834b-2d17-49f5-96ff-56344903a2ae} -#endif - -#ifdef HAS_SAFARI_MIGRATOR -component {4b609ecf-60b2-4655-9df4-dc149e474da1} SafariProfileMigrator.js -contract @mozilla.org/profile/migrator;1?app=browser&type=safari {4b609ecf-60b2-4655-9df4-dc149e474da1} -#endif -#ifdef HAS_360SE_MIGRATOR -component {d0037b95-296a-4a4e-94b2-c3d075d20ab1} 360seProfileMigrator.js -contract @mozilla.org/profile/migrator;1?app=browser&type=360se {d0037b95-296a-4a4e-94b2-c3d075d20ab1} -#endif diff --git a/browser/components/migration/ChromeProfileMigrator.js b/browser/components/migration/ChromeProfileMigrator.jsm similarity index 98% rename from browser/components/migration/ChromeProfileMigrator.js rename to browser/components/migration/ChromeProfileMigrator.jsm index 9ba78d1ce7f8..930897e7c788 100644 --- a/browser/components/migration/ChromeProfileMigrator.js +++ b/browser/components/migration/ChromeProfileMigrator.jsm @@ -16,7 +16,6 @@ const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.j const {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm"); const {OS} = ChromeUtils.import("resource://gre/modules/osfile.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); -const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const {ChromeMigrationUtils} = ChromeUtils.import("resource:///modules/ChromeMigrationUtils.jsm"); const {MigrationUtils, MigratorPrototype} = ChromeUtils.import("resource:///modules/MigrationUtils.jsm"); @@ -432,7 +431,7 @@ ChromiumProfileMigrator.prototype.classDescription = "Chromium Profile Migrator" ChromiumProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=chromium"; ChromiumProfileMigrator.prototype.classID = Components.ID("{8cece922-9720-42de-b7db-7cef88cb07ca}"); -var componentsArray = [ChromeProfileMigrator, ChromiumProfileMigrator]; +var EXPORTED_SYMBOLS = ["ChromeProfileMigrator", "ChromiumProfileMigrator"]; /** * Chrome Canary @@ -447,7 +446,7 @@ CanaryProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?ap CanaryProfileMigrator.prototype.classID = Components.ID("{4bf85aa5-4e21-46ca-825f-f9c51a5e8c76}"); if (AppConstants.platform == "win" || AppConstants.platform == "macosx") { - componentsArray.push(CanaryProfileMigrator); + EXPORTED_SYMBOLS.push("CanaryProfileMigrator"); } /** @@ -470,7 +469,5 @@ if (AppConstants.platform != "win" && AppConstants.platform != "macosx") { ChromeBetaMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=chrome-beta"; ChromeBetaMigrator.prototype.classID = Components.ID("{47f75963-840b-4950-a1f0-d9c1864f8b8e}"); - componentsArray.push(ChromeDevMigrator, ChromeBetaMigrator); + EXPORTED_SYMBOLS.push("ChromeDevMigrator", "ChromeBetaMigrator"); } - -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(componentsArray); diff --git a/browser/components/migration/EdgeProfileMigrator.js b/browser/components/migration/EdgeProfileMigrator.jsm similarity index 99% rename from browser/components/migration/EdgeProfileMigrator.js rename to browser/components/migration/EdgeProfileMigrator.jsm index f1d9ffe477a2..6f0ed3f290b6 100644 --- a/browser/components/migration/EdgeProfileMigrator.js +++ b/browser/components/migration/EdgeProfileMigrator.jsm @@ -496,4 +496,4 @@ EdgeProfileMigrator.prototype.classDescription = "Edge Profile Migrator"; EdgeProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=edge"; EdgeProfileMigrator.prototype.classID = Components.ID("{62e8834b-2d17-49f5-96ff-56344903a2ae}"); -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([EdgeProfileMigrator]); +var EXPORTED_SYMBOLS = ["EdgeProfileMigrator"]; diff --git a/browser/components/migration/FirefoxProfileMigrator.js b/browser/components/migration/FirefoxProfileMigrator.jsm similarity index 98% rename from browser/components/migration/FirefoxProfileMigrator.js rename to browser/components/migration/FirefoxProfileMigrator.jsm index 0591717e5d06..d333833e69a0 100644 --- a/browser/components/migration/FirefoxProfileMigrator.js +++ b/browser/components/migration/FirefoxProfileMigrator.jsm @@ -13,7 +13,6 @@ * from the source profile. */ -const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const {MigrationUtils, MigratorPrototype} = ChromeUtils.import("resource:///modules/MigrationUtils.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); @@ -276,4 +275,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}"); -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([FirefoxProfileMigrator]); +var EXPORTED_SYMBOLS = ["FirefoxProfileMigrator"]; diff --git a/browser/components/migration/IEProfileMigrator.js b/browser/components/migration/IEProfileMigrator.jsm similarity index 99% rename from browser/components/migration/IEProfileMigrator.js rename to browser/components/migration/IEProfileMigrator.jsm index 1f952526c220..a465753fa195 100644 --- a/browser/components/migration/IEProfileMigrator.js +++ b/browser/components/migration/IEProfileMigrator.jsm @@ -356,4 +356,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}"); -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([IEProfileMigrator]); +var EXPORTED_SYMBOLS = ["IEProfileMigrator"]; diff --git a/browser/components/migration/ProfileMigrator.js b/browser/components/migration/ProfileMigrator.jsm similarity index 81% rename from browser/components/migration/ProfileMigrator.js rename to browser/components/migration/ProfileMigrator.jsm index 0c5f8069a261..baf3b4197bca 100644 --- a/browser/components/migration/ProfileMigrator.js +++ b/browser/components/migration/ProfileMigrator.jsm @@ -4,7 +4,6 @@ "use strict"; -const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const {MigrationUtils} = ChromeUtils.import("resource:///modules/MigrationUtils.jsm"); function ProfileMigrator() { @@ -18,4 +17,4 @@ ProfileMigrator.prototype = { classID: Components.ID("6F8BB968-C14F-4D6F-9733-6C6737B35DCE"), }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ProfileMigrator]); +var EXPORTED_SYMBOLS = ["ProfileMigrator"]; diff --git a/browser/components/migration/SafariProfileMigrator.js b/browser/components/migration/SafariProfileMigrator.jsm similarity index 99% rename from browser/components/migration/SafariProfileMigrator.js rename to browser/components/migration/SafariProfileMigrator.jsm index 6a859b8dae43..f98ae0cc987c 100644 --- a/browser/components/migration/SafariProfileMigrator.js +++ b/browser/components/migration/SafariProfileMigrator.jsm @@ -382,4 +382,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}"); -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SafariProfileMigrator]); +var EXPORTED_SYMBOLS = ["SafariProfileMigrator"]; diff --git a/browser/components/migration/components.conf b/browser/components/migration/components.conf new file mode 100644 index 000000000000..ed53692e6553 --- /dev/null +++ b/browser/components/migration/components.conf @@ -0,0 +1,92 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# 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/. + +XP_WIN = buildconfig.substs['OS_ARCH'] == 'WINNT' +XP_MACOSX = buildconfig.substs['MOZ_WIDGET_TOOLKIT'] == 'cocoa' + +Classes = [ + { + 'cid': '{6F8BB968-C14F-4D6F-9733-6C6737B35DCE}', + 'contract_ids': ['@mozilla.org/toolkit/profile-migrator;1'], + 'jsm': 'resource:///modules/ProfileMigrator.jsm', + 'constructor': 'ProfileMigrator', + }, + { + 'cid': '{4cec1de4-1671-4fc3-a53e-6c539dc77a26}', + 'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=chrome'], + 'jsm': 'resource:///modules/ChromeProfileMigrator.jsm', + 'constructor': 'ChromeProfileMigrator', + }, + { + 'cid': '{8cece922-9720-42de-b7db-7cef88cb07ca}', + 'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=chromium'], + 'jsm': 'resource:///modules/ChromeProfileMigrator.jsm', + 'constructor': 'ChromiumProfileMigrator', + }, + { + 'cid': '{91185366-ba97-4438-acba-48deaca63386}', + 'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=firefox'], + 'jsm': 'resource:///modules/FirefoxProfileMigrator.jsm', + 'constructor': 'FirefoxProfileMigrator', + }, +] + +if XP_WIN or XP_MACOSX: + Classes += [ + { + 'cid': '{4bf85aa5-4e21-46ca-825f-f9c51a5e8c76}', + 'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=canary'], + 'jsm': 'resource:///modules/ChromeProfileMigrator.jsm', + 'constructor': 'CanaryProfileMigrator', + }, + ] +else: + Classes += [ + { + 'cid': '{47f75963-840b-4950-a1f0-d9c1864f8b8e}', + 'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=chrome-beta'], + 'jsm': 'resource:///modules/ChromeProfileMigrator.jsm', + 'constructor': ' ChromeBetaMigrator', + }, + { + 'cid': '{7370a02a-4886-42c3-a4ec-d48c726ec30a}', + 'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=chrome-dev'], + 'jsm': 'resource:///modules/ChromeProfileMigrator.jsm', + 'constructor': ' ChromeDevMigrator', + }, + ] + +if XP_WIN: + Classes += [ + { + 'cid': '{3d2532e3-4932-4774-b7ba-968f5899d3a4}', + 'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=ie'], + 'jsm': 'resource:///modules/IEProfileMigrator.jsm', + 'constructor': 'IEProfileMigrator', + }, + { + 'cid': '{62e8834b-2d17-49f5-96ff-56344903a2ae}', + 'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=edge'], + 'jsm': 'resource:///modules/EdgeProfileMigrator.jsm', + 'constructor': 'EdgeProfileMigrator', + }, + { + 'cid': '{d0037b95-296a-4a4e-94b2-c3d075d20ab1}', + 'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=360se'], + 'jsm': 'resource:///modules/360seProfileMigrator.jsm', + 'constructor': 'Qihoo360seProfileMigrator', + }, + ] + +if XP_MACOSX: + Classes += [ + { + 'cid': '{4b609ecf-60b2-4655-9df4-dc149e474da1}', + 'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=safari'], + 'jsm': 'resource:///modules/SafariProfileMigrator.jsm', + 'constructor': 'SafariProfileMigrator', + }, + ] diff --git a/browser/components/migration/moz.build b/browser/components/migration/moz.build index a4240468d3bf..06e079f31c34 100644 --- a/browser/components/migration/moz.build +++ b/browser/components/migration/moz.build @@ -16,43 +16,34 @@ XPIDL_SOURCES += [ XPIDL_MODULE = 'migration' -EXTRA_COMPONENTS += [ - 'ChromeProfileMigrator.js', - 'FirefoxProfileMigrator.js', - 'ProfileMigrator.js', -] - -EXTRA_PP_COMPONENTS += [ - 'BrowserProfileMigrators.manifest', -] - EXTRA_JS_MODULES += [ 'ChromeMigrationUtils.jsm', + 'ChromeProfileMigrator.jsm', + 'FirefoxProfileMigrator.jsm', 'MigrationUtils.jsm', + 'ProfileMigrator.jsm', ] if CONFIG['OS_ARCH'] == 'WINNT': SOURCES += [ 'nsIEHistoryEnumerator.cpp', ] - EXTRA_COMPONENTS += [ - '360seProfileMigrator.js', - 'EdgeProfileMigrator.js', - 'IEProfileMigrator.js', - ] EXTRA_JS_MODULES += [ + '360seProfileMigrator.jsm', + 'EdgeProfileMigrator.jsm', 'ESEDBReader.jsm', + 'IEProfileMigrator.jsm', 'MSMigrationUtils.jsm', ] - DEFINES['HAS_360SE_MIGRATOR'] = True - DEFINES['HAS_IE_MIGRATOR'] = True - DEFINES['HAS_EDGE_MIGRATOR'] = True if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': - EXTRA_COMPONENTS += [ - 'SafariProfileMigrator.js', + EXTRA_JS_MODULES += [ + 'SafariProfileMigrator.jsm', ] - DEFINES['HAS_SAFARI_MIGRATOR'] = True + +XPCOM_MANIFESTS += [ + 'components.conf', +] FINAL_LIBRARY = 'browsercomps' diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index 9fcedc2e66ef..34ef22262469 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -254,17 +254,7 @@ @RESPATH@/components/nsInputListAutoComplete.js @RESPATH@/components/contentAreaDropListener.manifest @RESPATH@/components/contentAreaDropListener.js -@RESPATH@/browser/components/BrowserProfileMigrators.manifest -@RESPATH@/browser/components/ProfileMigrator.js -@RESPATH@/browser/components/ChromeProfileMigrator.js -@RESPATH@/browser/components/FirefoxProfileMigrator.js -#ifdef XP_WIN -@RESPATH@/browser/components/360seProfileMigrator.js -@RESPATH@/browser/components/EdgeProfileMigrator.js -@RESPATH@/browser/components/IEProfileMigrator.js -#endif #ifdef XP_MACOSX -@RESPATH@/browser/components/SafariProfileMigrator.js @RESPATH@/browser/components/MacTouchBar.manifest @RESPATH@/browser/components/MacTouchBar.js #endif