| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/drive/fileapi/async_file_util.h" | 5 #include "chrome/browser/chromeos/drive/fileapi/async_file_util.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 base::Bind(&fileapi_internal::GetFileSystemFromUrl, url), | 257 base::Bind(&fileapi_internal::GetFileSystemFromUrl, url), |
| 258 base::Bind(&fileapi_internal::TouchFile, | 258 base::Bind(&fileapi_internal::TouchFile, |
| 259 file_path, last_access_time, last_modified_time, | 259 file_path, last_access_time, last_modified_time, |
| 260 google_apis::CreateRelayCallback(callback)), | 260 google_apis::CreateRelayCallback(callback)), |
| 261 base::Bind(callback, base::File::FILE_ERROR_FAILED)); | 261 base::Bind(callback, base::File::FILE_ERROR_FAILED)); |
| 262 } | 262 } |
| 263 | 263 |
| 264 void AsyncFileUtil::Truncate( | 264 void AsyncFileUtil::Truncate( |
| 265 scoped_ptr<storage::FileSystemOperationContext> context, | 265 scoped_ptr<storage::FileSystemOperationContext> context, |
| 266 const storage::FileSystemURL& url, | 266 const storage::FileSystemURL& url, |
| 267 int64 length, | 267 int64_t length, |
| 268 const StatusCallback& callback) { | 268 const StatusCallback& callback) { |
| 269 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 269 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 270 | 270 |
| 271 base::FilePath file_path = util::ExtractDrivePathFromFileSystemUrl(url); | 271 base::FilePath file_path = util::ExtractDrivePathFromFileSystemUrl(url); |
| 272 if (file_path.empty()) { | 272 if (file_path.empty()) { |
| 273 callback.Run(base::File::FILE_ERROR_NOT_FOUND); | 273 callback.Run(base::File::FILE_ERROR_NOT_FOUND); |
| 274 return; | 274 return; |
| 275 } | 275 } |
| 276 | 276 |
| 277 PostFileSystemCallback( | 277 PostFileSystemCallback( |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 base::Bind(&RunCreateSnapshotFileCallback, callback))), | 444 base::Bind(&RunCreateSnapshotFileCallback, callback))), |
| 445 base::Bind(callback, | 445 base::Bind(callback, |
| 446 base::File::FILE_ERROR_FAILED, | 446 base::File::FILE_ERROR_FAILED, |
| 447 base::File::Info(), | 447 base::File::Info(), |
| 448 base::FilePath(), | 448 base::FilePath(), |
| 449 scoped_refptr<storage::ShareableFileReference>())); | 449 scoped_refptr<storage::ShareableFileReference>())); |
| 450 } | 450 } |
| 451 | 451 |
| 452 } // namespace internal | 452 } // namespace internal |
| 453 } // namespace drive | 453 } // namespace drive |
| OLD | NEW |