chromium/chrome/browser/profiles/nuke_profile_directory_utils.cc

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/profiles/nuke_profile_directory_utils.h"

#include <map>

#include "base/check_op.h"
#include "base/containers/contains.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/json/values_util.h"
#include "base/metrics/histogram_functions.h"
#include "base/no_destructor.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile_attributes_entry.h"
#include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_metrics.h"
#include "chrome/common/chrome_paths_internal.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"

namespace {

// Used in metrics for NukeProfileFromDisk(). Keep in sync with enums.xml.
//
// Entries should not be renumbered and numeric values should never be reused.
//
// Note: there are maximum 3 attempts to nuke a profile.
enum class NukeProfileResult {};

const size_t kNukeProfileMaxRetryCount =;

// Profile deletion can pass through two stages:
enum class ProfileDeletionStage {};

ProfileDeletionMap;
ProfileDeletionMap& ProfilesToDelete() {}

NukeProfileResult GetNukeProfileResult(size_t retry_count, bool success) {}

// Implementation of NukeProfileFromDisk(), retrying at most |max_retry_count|
// times on failure. |retry_count| (initially 0) keeps track of the
// number of attempts so far.
void NukeProfileFromDiskImpl(const base::FilePath& profile_path,
                             size_t retry_count,
                             size_t max_retry_count,
                             base::OnceClosure done_callback) {}

}  // namespace

void NukeDeletedProfilesFromDisk() {}

void NukeProfileFromDisk(const base::FilePath& profile_path,
                         base::OnceClosure done_callback) {}

bool IsProfileDirectoryMarkedForDeletion(const base::FilePath& profile_path) {}

void CancelProfileDeletion(const base::FilePath& path) {}

// Schedule a profile for deletion if it isn't already scheduled.
// Returns whether the profile has been newly scheduled.
bool ScheduleProfileDirectoryForDeletion(const base::FilePath& path) {}

void MarkProfileDirectoryForDeletion(const base::FilePath& path) {}