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:
Gijs Kruitbosch 2020-10-20 13:04:40 +00:00
Родитель 1d585e9840
Коммит 79cf5eb5d9
4 изменённых файлов: 5 добавлений и 6 удалений

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

@ -240,7 +240,7 @@ var MigratorPrototype = {
getMigrateData: async function MP_getMigrateData(aProfile) {
let resources = await this._getMaybeCachedResources(aProfile);
if (!resources) {
return [];
return 0;
}
let types = resources.map(r => r.type);
return types.reduce((a, b) => {

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

@ -372,7 +372,7 @@ var MigrationWizard = {
}
var items = this.spinResolve(
this._migrator.getMigrateData(this._selectedProfile, this._autoMigrate)
this._migrator.getMigrateData(this._selectedProfile)
);
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.
if (this._autoMigrate) {
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.
* @param aProfile the profile that we are looking for available data
* to import
* @param aDoingStartup "true" if the profile is not currently being used.
* @return Promise containing a bit field containing profile items (see above)
* @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

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

@ -58,7 +58,7 @@ async function promiseMigration(
succeeds = null
) {
// Ensure resource migration is available.
let availableSources = await migrator.getMigrateData(aProfile, false);
let availableSources = await migrator.getMigrateData(aProfile);
Assert.ok(
(availableSources & resourceType) > 0,
"Resource supported by migrator"