| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" | 5 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/sync_file_system/local/local_file_change_tracker.h" | 9 #include "chrome/browser/sync_file_system/local/local_file_change_tracker.h" |
| 10 #include "chrome/browser/sync_file_system/local/local_file_sync_context.h" | 10 #include "chrome/browser/sync_file_system/local/local_file_sync_context.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 } | 130 } |
| 131 | 131 |
| 132 fileapi::AsyncFileUtil* SyncFileSystemBackend::GetAsyncFileUtil( | 132 fileapi::AsyncFileUtil* SyncFileSystemBackend::GetAsyncFileUtil( |
| 133 fileapi::FileSystemType type) { | 133 fileapi::FileSystemType type) { |
| 134 return GetDelegate()->file_util(); | 134 return GetDelegate()->file_util(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 fileapi::CopyOrMoveFileValidatorFactory* | 137 fileapi::CopyOrMoveFileValidatorFactory* |
| 138 SyncFileSystemBackend::GetCopyOrMoveFileValidatorFactory( | 138 SyncFileSystemBackend::GetCopyOrMoveFileValidatorFactory( |
| 139 fileapi::FileSystemType type, | 139 fileapi::FileSystemType type, |
| 140 base::PlatformFileError* error_code) { | 140 base::File::Error* error_code) { |
| 141 DCHECK(error_code); | 141 DCHECK(error_code); |
| 142 *error_code = base::PLATFORM_FILE_OK; | 142 *error_code = base::File::FILE_OK; |
| 143 return NULL; | 143 return NULL; |
| 144 } | 144 } |
| 145 | 145 |
| 146 fileapi::FileSystemOperation* | 146 fileapi::FileSystemOperation* |
| 147 SyncFileSystemBackend::CreateFileSystemOperation( | 147 SyncFileSystemBackend::CreateFileSystemOperation( |
| 148 const fileapi::FileSystemURL& url, | 148 const fileapi::FileSystemURL& url, |
| 149 fileapi::FileSystemContext* context, | 149 fileapi::FileSystemContext* context, |
| 150 base::PlatformFileError* error_code) const { | 150 base::File::Error* error_code) const { |
| 151 DCHECK(CanHandleType(url.type())); | 151 DCHECK(CanHandleType(url.type())); |
| 152 DCHECK(context); | 152 DCHECK(context); |
| 153 DCHECK(error_code); | 153 DCHECK(error_code); |
| 154 | 154 |
| 155 scoped_ptr<fileapi::FileSystemOperationContext> operation_context = | 155 scoped_ptr<fileapi::FileSystemOperationContext> operation_context = |
| 156 GetDelegate()->CreateFileSystemOperationContext(url, context, error_code); | 156 GetDelegate()->CreateFileSystemOperationContext(url, context, error_code); |
| 157 if (!operation_context) | 157 if (!operation_context) |
| 158 return NULL; | 158 return NULL; |
| 159 | 159 |
| 160 if (url.type() == fileapi::kFileSystemTypeSyncableForInternalSync) { | 160 if (url.type() == fileapi::kFileSystemTypeSyncableForInternalSync) { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 BrowserThread::PostTask( | 270 BrowserThread::PostTask( |
| 271 BrowserThread::IO, FROM_HERE, | 271 BrowserThread::IO, FROM_HERE, |
| 272 base::Bind(&SyncFileSystemBackend::DidInitializeSyncFileSystemService, | 272 base::Bind(&SyncFileSystemBackend::DidInitializeSyncFileSystemService, |
| 273 base::Unretained(this), make_scoped_refptr(context), | 273 base::Unretained(this), make_scoped_refptr(context), |
| 274 origin_url, type, mode, callback, status)); | 274 origin_url, type, mode, callback, status)); |
| 275 return; | 275 return; |
| 276 } | 276 } |
| 277 | 277 |
| 278 if (status != sync_file_system::SYNC_STATUS_OK) { | 278 if (status != sync_file_system::SYNC_STATUS_OK) { |
| 279 callback.Run(GURL(), std::string(), | 279 callback.Run(GURL(), std::string(), |
| 280 SyncStatusCodeToPlatformFileError(status)); | 280 SyncStatusCodeToFileError(status)); |
| 281 return; | 281 return; |
| 282 } | 282 } |
| 283 | 283 |
| 284 callback.Run(GetSyncableFileSystemRootURI(origin_url), | 284 callback.Run(GetSyncableFileSystemRootURI(origin_url), |
| 285 GetFileSystemName(origin_url, type), | 285 GetFileSystemName(origin_url, type), |
| 286 base::PLATFORM_FILE_OK); | 286 base::File::FILE_OK); |
| 287 } | 287 } |
| 288 | 288 |
| 289 } // namespace sync_file_system | 289 } // namespace sync_file_system |
| OLD | NEW |