#include "chrome/browser/sync_file_system/local/sync_file_system_backend.h"
#include <string>
#include <utility>
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/types/pass_key.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/sync_file_system/local/local_file_change_tracker.h"
#include "chrome/browser/sync_file_system/local/local_file_sync_context.h"
#include "chrome/browser/sync_file_system/local/syncable_file_system_operation.h"
#include "chrome/browser/sync_file_system/sync_file_system_service.h"
#include "chrome/browser/sync_file_system/sync_file_system_service_factory.h"
#include "chrome/browser/sync_file_system/syncable_file_system_util.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "storage/browser/file_system/file_stream_reader.h"
#include "storage/browser/file_system/file_stream_writer.h"
#include "storage/browser/file_system/file_system_context.h"
#include "storage/browser/file_system/file_system_operation.h"
#include "storage/browser/file_system/file_system_util.h"
#include "storage/common/file_system/file_system_util.h"
BrowserThread;
namespace sync_file_system {
namespace {
bool CalledOnUIThread() { … }
}
SyncFileSystemBackend::SyncFileSystemBackend(Profile* profile)
: … { … }
SyncFileSystemBackend::~SyncFileSystemBackend() { … }
std::unique_ptr<SyncFileSystemBackend>
SyncFileSystemBackend::CreateForTesting() { … }
bool SyncFileSystemBackend::CanHandleType(storage::FileSystemType type) const { … }
void SyncFileSystemBackend::Initialize(storage::FileSystemContext* context) { … }
void SyncFileSystemBackend::ResolveURL(const storage::FileSystemURL& url,
storage::OpenFileSystemMode mode,
ResolveURLCallback callback) { … }
storage::AsyncFileUtil* SyncFileSystemBackend::GetAsyncFileUtil(
storage::FileSystemType type) { … }
storage::WatcherManager* SyncFileSystemBackend::GetWatcherManager(
storage::FileSystemType type) { … }
storage::CopyOrMoveFileValidatorFactory*
SyncFileSystemBackend::GetCopyOrMoveFileValidatorFactory(
storage::FileSystemType type,
base::File::Error* error_code) { … }
std::unique_ptr<storage::FileSystemOperation>
SyncFileSystemBackend::CreateFileSystemOperation(
storage::OperationType type,
const storage::FileSystemURL& url,
storage::FileSystemContext* context,
base::File::Error* error_code) const { … }
bool SyncFileSystemBackend::SupportsStreaming(
const storage::FileSystemURL& url) const { … }
bool SyncFileSystemBackend::HasInplaceCopyImplementation(
storage::FileSystemType type) const { … }
std::unique_ptr<storage::FileStreamReader>
SyncFileSystemBackend::CreateFileStreamReader(
const storage::FileSystemURL& url,
int64_t offset,
int64_t max_bytes_to_read,
const base::Time& expected_modification_time,
storage::FileSystemContext* context,
file_access::ScopedFileAccessDelegate::
RequestFilesAccessIOCallback ) const { … }
std::unique_ptr<storage::FileStreamWriter>
SyncFileSystemBackend::CreateFileStreamWriter(
const storage::FileSystemURL& url,
int64_t offset,
storage::FileSystemContext* context) const { … }
storage::FileSystemQuotaUtil* SyncFileSystemBackend::GetQuotaUtil() { … }
const storage::UpdateObserverList* SyncFileSystemBackend::GetUpdateObservers(
storage::FileSystemType type) const { … }
const storage::ChangeObserverList* SyncFileSystemBackend::GetChangeObservers(
storage::FileSystemType type) const { … }
const storage::AccessObserverList* SyncFileSystemBackend::GetAccessObservers(
storage::FileSystemType type) const { … }
SyncFileSystemBackend* SyncFileSystemBackend::GetBackend(
const storage::FileSystemContext* file_system_context) { … }
void SyncFileSystemBackend::SetLocalFileChangeTracker(
std::unique_ptr<LocalFileChangeTracker> tracker) { … }
void SyncFileSystemBackend::set_sync_context(
LocalFileSyncContext* sync_context) { … }
storage::SandboxFileSystemBackendDelegate* SyncFileSystemBackend::GetDelegate()
const { … }
void SyncFileSystemBackend::InitializeSyncFileSystemService(
const GURL& origin_url,
SyncStatusCallback callback) { … }
void SyncFileSystemBackend::DidInitializeSyncFileSystemService(
storage::FileSystemContext* context,
const GURL& origin_url,
storage::FileSystemType type,
storage::OpenFileSystemMode mode,
ResolveURLCallback callback,
SyncStatusCode status) { … }
}