#include "components/bookmarks/browser/bookmark_storage.h"
#include <stddef.h>
#include <algorithm>
#include <unordered_map>
#include <utility>
#include "base/compiler_specific.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/json/json_file_value_serializer.h"
#include "base/json/json_writer.h"
#include "base/notreached.h"
#include "base/numerics/safe_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "base/uuid.h"
#include "components/bookmarks/browser/bookmark_codec.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_node.h"
#include "components/bookmarks/common/bookmark_metrics.h"
namespace bookmarks {
namespace {
const base::FilePath::CharType kBackupExtension[] = …);
void BackupCallback(const base::FilePath& path) { … }
base::Value::Dict EncodeModelToDict(
const BookmarkModel* model,
BookmarkStorage::PermanentNodeSelection permanent_node_selection) { … }
bool ShouldSaveBackupFile(
BookmarkStorage::PermanentNodeSelection permanent_node_selection) { … }
}
constexpr base::TimeDelta BookmarkStorage::kSaveDelay;
BookmarkStorage::BookmarkStorage(
const BookmarkModel* model,
PermanentNodeSelection permanent_node_selection,
const base::FilePath& file_path)
: … { … }
BookmarkStorage::~BookmarkStorage() { … }
void BookmarkStorage::ScheduleSave() { … }
base::ImportantFileWriter::BackgroundDataProducerCallback
BookmarkStorage::GetSerializedDataProducerForBackgroundSequence() { … }
bool BookmarkStorage::HasScheduledSaveForTesting() const { … }
void BookmarkStorage::SaveNowIfScheduledForTesting() { … }
void BookmarkStorage::SaveNowIfScheduled() { … }
}