mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
Bug 1665442 - cleanup in browser migration code while passing by, r=jaws
Differential Revision: https://phabricator.services.mozilla.com/D93617
This commit is contained in:
parent
1d585e9840
commit
79cf5eb5d9
@ -240,7 +240,7 @@ var MigratorPrototype = {
|
|||||||
getMigrateData: async function MP_getMigrateData(aProfile) {
|
getMigrateData: async function MP_getMigrateData(aProfile) {
|
||||||
let resources = await this._getMaybeCachedResources(aProfile);
|
let resources = await this._getMaybeCachedResources(aProfile);
|
||||||
if (!resources) {
|
if (!resources) {
|
||||||
return [];
|
return 0;
|
||||||
}
|
}
|
||||||
let types = resources.map(r => r.type);
|
let types = resources.map(r => r.type);
|
||||||
return types.reduce((a, b) => {
|
return types.reduce((a, b) => {
|
||||||
|
@ -372,7 +372,7 @@ var MigrationWizard = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var items = this.spinResolve(
|
var items = this.spinResolve(
|
||||||
this._migrator.getMigrateData(this._selectedProfile, this._autoMigrate)
|
this._migrator.getMigrateData(this._selectedProfile)
|
||||||
);
|
);
|
||||||
|
|
||||||
for (let itemType of kDataToStringMap.keys()) {
|
for (let itemType of kDataToStringMap.keys()) {
|
||||||
@ -485,7 +485,7 @@ var MigrationWizard = {
|
|||||||
// When automigrating, show all of the data that can be received from this source.
|
// When automigrating, show all of the data that can be received from this source.
|
||||||
if (this._autoMigrate) {
|
if (this._autoMigrate) {
|
||||||
this._itemsFlags = this.spinResolve(
|
this._itemsFlags = this.spinResolve(
|
||||||
this._migrator.getMigrateData(this._selectedProfile, this._autoMigrate)
|
this._migrator.getMigrateData(this._selectedProfile)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,11 +37,10 @@ interface nsIBrowserProfileMigrator : nsISupports
|
|||||||
* offers for import.
|
* offers for import.
|
||||||
* @param aProfile the profile that we are looking for available data
|
* @param aProfile the profile that we are looking for available data
|
||||||
* to import
|
* to import
|
||||||
* @param aDoingStartup "true" if the profile is not currently being used.
|
|
||||||
* @return Promise containing a bit field containing profile items (see above)
|
* @return Promise containing a bit field containing profile items (see above)
|
||||||
* @note a return value of 0 represents no items rather than ALL.
|
* @note a return value of 0 represents no items rather than ALL.
|
||||||
*/
|
*/
|
||||||
jsval getMigrateData(in jsval aProfile, in boolean aDoingStartup);
|
jsval getMigrateData(in jsval aProfile);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the last time data from this browser was modified
|
* Get the last time data from this browser was modified
|
||||||
|
@ -58,7 +58,7 @@ async function promiseMigration(
|
|||||||
succeeds = null
|
succeeds = null
|
||||||
) {
|
) {
|
||||||
// Ensure resource migration is available.
|
// Ensure resource migration is available.
|
||||||
let availableSources = await migrator.getMigrateData(aProfile, false);
|
let availableSources = await migrator.getMigrateData(aProfile);
|
||||||
Assert.ok(
|
Assert.ok(
|
||||||
(availableSources & resourceType) > 0,
|
(availableSources & resourceType) > 0,
|
||||||
"Resource supported by migrator"
|
"Resource supported by migrator"
|
||||||
|
Loading…
Reference in New Issue
Block a user