Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: chrome/browser/sync_file_system/local/sync_file_system_backend.cc

Issue 492873002: Collapse fileapi, webkit_blob, webkit_database, quota, and webkit_common namespaces into single sto… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chromeos build Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync_file_system/local/sync_file_system_backend.cc
diff --git a/chrome/browser/sync_file_system/local/sync_file_system_backend.cc b/chrome/browser/sync_file_system/local/sync_file_system_backend.cc
index 4229d1d7b4f5924557bd9ef3269b2a510ea5140d..c6b620cd06b7ee950a81600d0eb690c834de1fc3 100644
--- a/chrome/browser/sync_file_system/local/sync_file_system_backend.cc
+++ b/chrome/browser/sync_file_system/local/sync_file_system_backend.cc
@@ -91,25 +91,24 @@ SyncFileSystemBackend* SyncFileSystemBackend::CreateForTesting() {
return backend;
}
-bool SyncFileSystemBackend::CanHandleType(
- fileapi::FileSystemType type) const {
- return type == fileapi::kFileSystemTypeSyncable ||
- type == fileapi::kFileSystemTypeSyncableForInternalSync;
+bool SyncFileSystemBackend::CanHandleType(storage::FileSystemType type) const {
+ return type == storage::kFileSystemTypeSyncable ||
+ type == storage::kFileSystemTypeSyncableForInternalSync;
}
-void SyncFileSystemBackend::Initialize(fileapi::FileSystemContext* context) {
+void SyncFileSystemBackend::Initialize(storage::FileSystemContext* context) {
DCHECK(context);
DCHECK(!context_);
context_ = context;
- fileapi::SandboxFileSystemBackendDelegate* delegate = GetDelegate();
- delegate->RegisterQuotaUpdateObserver(fileapi::kFileSystemTypeSyncable);
+ storage::SandboxFileSystemBackendDelegate* delegate = GetDelegate();
+ delegate->RegisterQuotaUpdateObserver(storage::kFileSystemTypeSyncable);
delegate->RegisterQuotaUpdateObserver(
- fileapi::kFileSystemTypeSyncableForInternalSync);
+ storage::kFileSystemTypeSyncableForInternalSync);
}
-void SyncFileSystemBackend::ResolveURL(const fileapi::FileSystemURL& url,
- fileapi::OpenFileSystemMode mode,
+void SyncFileSystemBackend::ResolveURL(const storage::FileSystemURL& url,
+ storage::OpenFileSystemMode mode,
const OpenFileSystemCallback& callback) {
DCHECK(CanHandleType(url.type()));
@@ -134,36 +133,35 @@ void SyncFileSystemBackend::ResolveURL(const fileapi::FileSystemURL& url,
InitializeSyncFileSystemService(url.origin(), initialize_callback);
}
-fileapi::AsyncFileUtil* SyncFileSystemBackend::GetAsyncFileUtil(
- fileapi::FileSystemType type) {
+storage::AsyncFileUtil* SyncFileSystemBackend::GetAsyncFileUtil(
+ storage::FileSystemType type) {
return GetDelegate()->file_util();
}
-fileapi::CopyOrMoveFileValidatorFactory*
+storage::CopyOrMoveFileValidatorFactory*
SyncFileSystemBackend::GetCopyOrMoveFileValidatorFactory(
- fileapi::FileSystemType type,
+ storage::FileSystemType type,
base::File::Error* error_code) {
DCHECK(error_code);
*error_code = base::File::FILE_OK;
return NULL;
}
-fileapi::FileSystemOperation*
-SyncFileSystemBackend::CreateFileSystemOperation(
- const fileapi::FileSystemURL& url,
- fileapi::FileSystemContext* context,
+storage::FileSystemOperation* SyncFileSystemBackend::CreateFileSystemOperation(
+ const storage::FileSystemURL& url,
+ storage::FileSystemContext* context,
base::File::Error* error_code) const {
DCHECK(CanHandleType(url.type()));
DCHECK(context);
DCHECK(error_code);
- scoped_ptr<fileapi::FileSystemOperationContext> operation_context =
+ scoped_ptr<storage::FileSystemOperationContext> operation_context =
GetDelegate()->CreateFileSystemOperationContext(url, context, error_code);
if (!operation_context)
return NULL;
- if (url.type() == fileapi::kFileSystemTypeSyncableForInternalSync) {
- return fileapi::FileSystemOperation::Create(
+ if (url.type() == storage::kFileSystemTypeSyncableForInternalSync) {
+ return storage::FileSystemOperation::Create(
url, context, operation_context.Pass());
}
@@ -172,47 +170,47 @@ SyncFileSystemBackend::CreateFileSystemOperation(
}
bool SyncFileSystemBackend::SupportsStreaming(
- const fileapi::FileSystemURL& url) const {
+ const storage::FileSystemURL& url) const {
return false;
}
bool SyncFileSystemBackend::HasInplaceCopyImplementation(
- fileapi::FileSystemType type) const {
+ storage::FileSystemType type) const {
return false;
}
-scoped_ptr<webkit_blob::FileStreamReader>
+scoped_ptr<storage::FileStreamReader>
SyncFileSystemBackend::CreateFileStreamReader(
- const fileapi::FileSystemURL& url,
+ const storage::FileSystemURL& url,
int64 offset,
const base::Time& expected_modification_time,
- fileapi::FileSystemContext* context) const {
+ storage::FileSystemContext* context) const {
DCHECK(CanHandleType(url.type()));
return GetDelegate()->CreateFileStreamReader(
url, offset, expected_modification_time, context);
}
-scoped_ptr<fileapi::FileStreamWriter>
+scoped_ptr<storage::FileStreamWriter>
SyncFileSystemBackend::CreateFileStreamWriter(
- const fileapi::FileSystemURL& url,
+ const storage::FileSystemURL& url,
int64 offset,
- fileapi::FileSystemContext* context) const {
+ storage::FileSystemContext* context) const {
DCHECK(CanHandleType(url.type()));
return GetDelegate()->CreateFileStreamWriter(
- url, offset, context, fileapi::kFileSystemTypeSyncableForInternalSync);
+ url, offset, context, storage::kFileSystemTypeSyncableForInternalSync);
}
-fileapi::FileSystemQuotaUtil* SyncFileSystemBackend::GetQuotaUtil() {
+storage::FileSystemQuotaUtil* SyncFileSystemBackend::GetQuotaUtil() {
return GetDelegate();
}
// static
SyncFileSystemBackend* SyncFileSystemBackend::GetBackend(
- const fileapi::FileSystemContext* file_system_context) {
+ const storage::FileSystemContext* file_system_context) {
DCHECK(file_system_context);
return static_cast<SyncFileSystemBackend*>(
file_system_context->GetFileSystemBackend(
- fileapi::kFileSystemTypeSyncable));
+ storage::kFileSystemTypeSyncable));
}
void SyncFileSystemBackend::SetLocalFileChangeTracker(
@@ -221,15 +219,13 @@ void SyncFileSystemBackend::SetLocalFileChangeTracker(
DCHECK(tracker);
change_tracker_ = tracker.Pass();
- fileapi::SandboxFileSystemBackendDelegate* delegate = GetDelegate();
- delegate->AddFileUpdateObserver(
- fileapi::kFileSystemTypeSyncable,
- change_tracker_.get(),
- delegate->file_task_runner());
- delegate->AddFileChangeObserver(
- fileapi::kFileSystemTypeSyncable,
- change_tracker_.get(),
- delegate->file_task_runner());
+ storage::SandboxFileSystemBackendDelegate* delegate = GetDelegate();
+ delegate->AddFileUpdateObserver(storage::kFileSystemTypeSyncable,
+ change_tracker_.get(),
+ delegate->file_task_runner());
+ delegate->AddFileChangeObserver(storage::kFileSystemTypeSyncable,
+ change_tracker_.get(),
+ delegate->file_task_runner());
}
void SyncFileSystemBackend::set_sync_context(
@@ -238,8 +234,8 @@ void SyncFileSystemBackend::set_sync_context(
sync_context_ = sync_context;
}
-fileapi::SandboxFileSystemBackendDelegate*
-SyncFileSystemBackend::GetDelegate() const {
+storage::SandboxFileSystemBackendDelegate* SyncFileSystemBackend::GetDelegate()
+ const {
DCHECK(context_);
DCHECK(context_->sandbox_delegate());
return context_->sandbox_delegate();
@@ -272,10 +268,10 @@ void SyncFileSystemBackend::InitializeSyncFileSystemService(
}
void SyncFileSystemBackend::DidInitializeSyncFileSystemService(
- fileapi::FileSystemContext* context,
+ storage::FileSystemContext* context,
const GURL& origin_url,
- fileapi::FileSystemType type,
- fileapi::OpenFileSystemMode mode,
+ storage::FileSystemType type,
+ storage::OpenFileSystemMode mode,
const OpenFileSystemCallback& callback,
SyncStatusCode status) {
// Repost to switch from UI thread to IO thread.

Powered by Google App Engine
This is Rietveld 408576698