| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/fileapi/file_system_operation.h" | 5 #include "webkit/fileapi/file_system_operation.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/sequenced_task_runner.h" | 8 #include "base/sequenced_task_runner.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 GetUsageAndQuotaThenRunTask( | 376 GetUsageAndQuotaThenRunTask( |
| 377 url, | 377 url, |
| 378 base::Bind(&FileSystemOperation::DoOpenFile, | 378 base::Bind(&FileSystemOperation::DoOpenFile, |
| 379 base::Unretained(deleter.release()), | 379 base::Unretained(deleter.release()), |
| 380 url, callback, file_flags), | 380 url, callback, file_flags), |
| 381 base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED, | 381 base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED, |
| 382 base::kInvalidPlatformFileValue, | 382 base::kInvalidPlatformFileValue, |
| 383 base::kNullProcessHandle)); | 383 base::kNullProcessHandle)); |
| 384 } | 384 } |
| 385 | 385 |
| 386 void FileSystemOperation::NotifyCloseFile(const FileSystemURL& url) { |
| 387 // No particular task to do. This method is for remote file systems that |
| 388 // need synchronization with remote server. |
| 389 delete this; |
| 390 } |
| 391 |
| 386 // We can only get here on a write or truncate that's not yet completed. | 392 // We can only get here on a write or truncate that's not yet completed. |
| 387 // We don't support cancelling any other operation at this time. | 393 // We don't support cancelling any other operation at this time. |
| 388 void FileSystemOperation::Cancel(const StatusCallback& cancel_callback) { | 394 void FileSystemOperation::Cancel(const StatusCallback& cancel_callback) { |
| 389 if (file_writer_delegate_.get()) { | 395 if (file_writer_delegate_.get()) { |
| 390 DCHECK_EQ(kOperationWrite, pending_operation_); | 396 DCHECK_EQ(kOperationWrite, pending_operation_); |
| 391 | 397 |
| 392 // Writes are done without proxying through FileUtilProxy after the initial | 398 // Writes are done without proxying through FileUtilProxy after the initial |
| 393 // opening of the PlatformFile. All state changes are done on this thread, | 399 // opening of the PlatformFile. All state changes are done on this thread, |
| 394 // so we're guaranteed to be able to shut down atomically. | 400 // so we're guaranteed to be able to shut down atomically. |
| 395 const bool delete_now = file_writer_delegate_->Cancel(); | 401 const bool delete_now = file_writer_delegate_->Cancel(); |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 } | 715 } |
| 710 | 716 |
| 711 bool FileSystemOperation::SetPendingOperationType(OperationType type) { | 717 bool FileSystemOperation::SetPendingOperationType(OperationType type) { |
| 712 if (pending_operation_ != kOperationNone) | 718 if (pending_operation_ != kOperationNone) |
| 713 return false; | 719 return false; |
| 714 pending_operation_ = type; | 720 pending_operation_ = type; |
| 715 return true; | 721 return true; |
| 716 } | 722 } |
| 717 | 723 |
| 718 } // namespace fileapi | 724 } // namespace fileapi |
| OLD | NEW |