diff options
Diffstat (limited to 'components/migration/FirefoxProfileMigrator.js')
-rw-r--r-- | components/migration/FirefoxProfileMigrator.js | 71 |
1 files changed, 1 insertions, 70 deletions
diff --git a/components/migration/FirefoxProfileMigrator.js b/components/migration/FirefoxProfileMigrator.js index f0339f6..c88ce0d 100644 --- a/components/migration/FirefoxProfileMigrator.js +++ b/components/migration/FirefoxProfileMigrator.js @@ -170,77 +170,8 @@ FirefoxProfileMigrator.prototype._getResourcesInternal = function(sourceProfileD }; } - // Telemetry related migrations. - let times = { - name: "times", // name is used only by tests. - type: types.OTHERDATA, - migrate: aCallback => { - let file = this._getFileObject(sourceProfileDir, "times.json"); - if (file) { - file.copyTo(currentProfileDir, ""); - } - // And record the fact a migration (ie, a reset) happened. - let timesAccessor = new ProfileAge(currentProfileDir.path); - timesAccessor.recordProfileReset().then( - () => aCallback(true), - () => aCallback(false) - ); - } - }; - let telemetry = { - name: "telemetry", // name is used only by tests... - type: types.OTHERDATA, - migrate: aCallback => { - let createSubDir = (name) => { - let dir = currentProfileDir.clone(); - dir.append(name); - dir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY); - return dir; - }; - - // If the 'datareporting' directory exists we migrate files from it. - let haveStateFile = false; - let dataReportingDir = this._getFileObject(sourceProfileDir, "datareporting"); - if (dataReportingDir && dataReportingDir.isDirectory()) { - // Copy only specific files. - let toCopy = ["state.json", "session-state.json"]; - - let dest = createSubDir("datareporting"); - let enumerator = dataReportingDir.directoryEntries; - while (enumerator.hasMoreElements()) { - let file = enumerator.getNext().QueryInterface(Ci.nsIFile); - if (file.isDirectory() || toCopy.indexOf(file.leafName) == -1) { - continue; - } - - if (file.leafName == "state.json") { - haveStateFile = true; - } - file.copyTo(dest, ""); - } - } - - if (!haveStateFile) { - // Fall back to migrating the state file that contains the client id from healthreport/. - // We first moved the client id management from the FHR implementation to the datareporting - // service. - // Consequently, we try to migrate an existing FHR state file here as a fallback. - let healthReportDir = this._getFileObject(sourceProfileDir, "healthreport"); - if (healthReportDir && healthReportDir.isDirectory()) { - let stateFile = this._getFileObject(healthReportDir, "state.json"); - if (stateFile) { - let dest = createSubDir("healthreport"); - stateFile.copyTo(dest, ""); - } - } - } - - aCallback(true); - } - }; - return [places, cookies, passwords, formData, dictionary, bookmarksBackups, - session, times, telemetry].filter(r => r); + session].filter(r => r); }; Object.defineProperty(FirefoxProfileMigrator.prototype, "startupOnlyMigrator", { |