| Index: chrome/browser/chromeos/drive/fileapi_worker.cc
|
| diff --git a/chrome/browser/chromeos/drive/fileapi_worker.cc b/chrome/browser/chromeos/drive/fileapi_worker.cc
|
| index 9f59917ca741a8ddc1f6b1334105c80258cc881f..3312fcc595d1442fdf246b0eb4bbf9c33149a8ec 100644
|
| --- a/chrome/browser/chromeos/drive/fileapi_worker.cc
|
| +++ b/chrome/browser/chromeos/drive/fileapi_worker.cc
|
| @@ -136,28 +136,32 @@ void RunCreateSnapshotFileCallback(const CreateSnapshotFileCallback& callback,
|
| void RunCreateWritableSnapshotFileCallback(
|
| const CreateWritableSnapshotFileCallback& callback,
|
| FileError error,
|
| - const base::FilePath& local_path) {
|
| + const base::FilePath& local_path,
|
| + const base::Closure& on_close_callback) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| - callback.Run(FileErrorToPlatformError(error), local_path);
|
| + callback.Run(FileErrorToPlatformError(error), local_path, on_close_callback);
|
| }
|
|
|
| // Runs |callback| with |error| and |platform_file|.
|
| void RunOpenFileCallback(const OpenFileCallback& callback,
|
| + const base::Closure& on_close_callback,
|
| base::PlatformFileError* error,
|
| base::PlatformFile platform_file) {
|
| - callback.Run(*error, platform_file);
|
| + callback.Run(*error, platform_file, on_close_callback);
|
| }
|
|
|
| // Part of OpenFile(). Called after FileSystem::OpenFile().
|
| void OpenFileAfterFileSystemOpenFile(int file_flags,
|
| const OpenFileCallback& callback,
|
| FileError error,
|
| - const base::FilePath& local_path) {
|
| + const base::FilePath& local_path,
|
| + const base::Closure& on_close_callback) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
|
|
| if (error != FILE_ERROR_OK) {
|
| callback.Run(FileErrorToPlatformError(error),
|
| - base::kInvalidPlatformFileValue);
|
| + base::kInvalidPlatformFileValue,
|
| + base::Closure());
|
| return;
|
| }
|
|
|
| @@ -183,16 +187,11 @@ void OpenFileAfterFileSystemOpenFile(int file_flags,
|
| BrowserThread::GetBlockingPool(), FROM_HERE,
|
| base::Bind(&base::CreatePlatformFile,
|
| local_path, file_flags, static_cast<bool*>(NULL), result),
|
| - base::Bind(&RunOpenFileCallback, callback, base::Owned(result)));
|
| + base::Bind(&RunOpenFileCallback,
|
| + callback, on_close_callback, base::Owned(result)));
|
| DCHECK(posted);
|
| }
|
|
|
| -// Emits debug log when FileSystem::CloseFile() is complete.
|
| -void EmitDebugLogForCloseFile(const base::FilePath& local_path,
|
| - FileError file_error) {
|
| - DVLOG(1) << "Closed: " << local_path.AsUTF8Unsafe() << ": " << file_error;
|
| -}
|
| -
|
| } // namespace
|
|
|
| void RunFileSystemCallback(
|
| @@ -336,7 +335,8 @@ void OpenFile(const base::FilePath& file_path,
|
| FROM_HERE,
|
| base::Bind(callback,
|
| base::PLATFORM_FILE_ERROR_FAILED,
|
| - base::kInvalidPlatformFileValue));
|
| + base::kInvalidPlatformFileValue,
|
| + base::Closure()));
|
| return;
|
| }
|
|
|
| @@ -345,13 +345,6 @@ void OpenFile(const base::FilePath& file_path,
|
| base::Bind(&OpenFileAfterFileSystemOpenFile, file_flags, callback));
|
| }
|
|
|
| -void CloseFile(const base::FilePath& file_path,
|
| - FileSystemInterface* file_system) {
|
| - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| - file_system->CloseFile(file_path,
|
| - base::Bind(&EmitDebugLogForCloseFile, file_path));
|
| -}
|
| -
|
| void TouchFile(const base::FilePath& file_path,
|
| const base::Time& last_access_time,
|
| const base::Time& last_modified_time,
|
|
|