#include "chrome/browser/sync_file_system/drive_backend/sync_engine_initializer.h"
#include <stddef.h>
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/logging.h"
#include "chrome/browser/sync_file_system/drive_backend/drive_backend_constants.h"
#include "chrome/browser/sync_file_system/drive_backend/drive_backend_util.h"
#include "chrome/browser/sync_file_system/drive_backend/metadata_database.h"
#include "chrome/browser/sync_file_system/drive_backend/sync_engine_context.h"
#include "chrome/browser/sync_file_system/drive_backend/sync_task_manager.h"
#include "chrome/browser/sync_file_system/drive_backend/sync_task_token.h"
#include "chrome/browser/sync_file_system/logger.h"
#include "components/drive/service/drive_api_service.h"
#include "google_apis/drive/drive_api_parser.h"
namespace sync_file_system {
namespace drive_backend {
namespace {
bool HasNoParents(const google_apis::FileResource& entry) { … }
bool HasFolderAsParent(const google_apis::FileResource& entry,
const std::string& parent_id) { … }
bool LessOnCreationTime(const google_apis::FileResource& left,
const google_apis::FileResource& right) { … }
}
SyncEngineInitializer::SyncEngineInitializer(
SyncEngineContext* sync_context,
const base::FilePath& database_path,
leveldb::Env* env_override)
: … { … }
SyncEngineInitializer::~SyncEngineInitializer() { … }
void SyncEngineInitializer::RunPreflight(std::unique_ptr<SyncTaskToken> token) { … }
std::unique_ptr<MetadataDatabase>
SyncEngineInitializer::PassMetadataDatabase() { … }
void SyncEngineInitializer::GetAboutResource(
std::unique_ptr<SyncTaskToken> token) { … }
void SyncEngineInitializer::DidGetAboutResource(
std::unique_ptr<SyncTaskToken> token,
google_apis::ApiErrorCode error,
std::unique_ptr<google_apis::AboutResource> about_resource) { … }
void SyncEngineInitializer::FindSyncRoot(std::unique_ptr<SyncTaskToken> token) { … }
void SyncEngineInitializer::DidFindSyncRoot(
std::unique_ptr<SyncTaskToken> token,
google_apis::ApiErrorCode error,
std::unique_ptr<google_apis::FileList> file_list) { … }
void SyncEngineInitializer::CreateSyncRoot(
std::unique_ptr<SyncTaskToken> token) { … }
void SyncEngineInitializer::DidCreateSyncRoot(
std::unique_ptr<SyncTaskToken> token,
google_apis::ApiErrorCode error,
std::unique_ptr<google_apis::FileResource> entry) { … }
void SyncEngineInitializer::DetachSyncRoot(
std::unique_ptr<SyncTaskToken> token) { … }
void SyncEngineInitializer::DidDetachSyncRoot(
std::unique_ptr<SyncTaskToken> token,
google_apis::ApiErrorCode error) { … }
void SyncEngineInitializer::ListAppRootFolders(
std::unique_ptr<SyncTaskToken> token) { … }
void SyncEngineInitializer::DidListAppRootFolders(
std::unique_ptr<SyncTaskToken> token,
google_apis::ApiErrorCode error,
std::unique_ptr<google_apis::FileList> file_list) { … }
void SyncEngineInitializer::PopulateDatabase(
std::unique_ptr<SyncTaskToken> token) { … }
}
}