#include "chrome/browser/downgrade/user_data_downgrade.h"
#include <string>
#include "base/check.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/downgrade/snapshot_manager.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
namespace downgrade {
namespace {
base::Version GetVersionFromFileName(const base::FilePath& path) { … }
bool IsValidSnapshotDirectory(const base::FilePath& path) { … }
}
const base::FilePath::StringPieceType kDowngradeLastVersionFile(
FILE_PATH_LITERAL("Last Version"));
const base::FilePath::StringPieceType kDowngradeDeleteSuffix(
FILE_PATH_LITERAL(".CHROME_DELETE"));
const base::FilePath::StringPieceType kSnapshotsDir(
FILE_PATH_LITERAL("Snapshots"));
base::FilePath GetLastVersionFile(const base::FilePath& user_data_dir) { … }
std::optional<base::Version> GetLastVersion(
const base::FilePath& user_data_dir) { … }
base::FilePath GetDiskCacheDir() { … }
base::flat_set<base::Version> GetAvailableSnapshots(
const base::FilePath& snapshot_dir) { … }
std::vector<base::FilePath> GetInvalidSnapshots(
const base::FilePath& snapshot_dir) { … }
std::optional<base::Version> GetSnapshotToRestore(
const base::Version& version,
const base::FilePath& user_data_dir) { … }
void RemoveDataForProfile(base::Time delete_begin,
const base::FilePath& profile_path,
uint64_t remove_mask) { … }
}