Bug 1524688: Part 6 - Convert profile migrators to static registration r=MattN

--HG--
rename : browser/components/migration/360seProfileMigrator.js => browser/components/migration/360seProfileMigrator.jsm
rename : browser/components/migration/ChromeProfileMigrator.js => browser/components/migration/ChromeProfileMigrator.jsm
rename : browser/components/migration/EdgeProfileMigrator.js => browser/components/migration/EdgeProfileMigrator.jsm
rename : browser/components/migration/FirefoxProfileMigrator.js => browser/components/migration/FirefoxProfileMigrator.jsm
rename : browser/components/migration/IEProfileMigrator.js => browser/components/migration/IEProfileMigrator.jsm
rename : browser/components/migration/ProfileMigrator.js => browser/components/migration/ProfileMigrator.jsm
rename : browser/components/migration/SafariProfileMigrator.js => browser/components/migration/SafariProfileMigrator.jsm
extra : rebase_source : cf4686c0caab1ee3fef97f75380341461732ea90
This commit is contained in:
Kris Maglione 2019-01-29 18:20:19 -08:00
Родитель d7b92ec19c
Коммит 5990d491bd
11 изменённых файлов: 113 добавлений и 83 удалений

Просмотреть файл

@ -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"];

Просмотреть файл

@ -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

Просмотреть файл

@ -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);

Просмотреть файл

@ -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"];

Просмотреть файл

@ -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"];

Просмотреть файл

@ -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"];

Просмотреть файл

@ -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"];

Просмотреть файл

@ -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"];

Просмотреть файл

@ -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',
},
]

Просмотреть файл

@ -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'

Просмотреть файл

@ -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