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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
392 } | 392 } |
393 GetUsageAndQuotaThenRunTask( | 393 GetUsageAndQuotaThenRunTask( |
394 src_path_.origin(), src_path_.type(), | 394 src_path_.origin(), src_path_.type(), |
395 base::Bind(&FileSystemOperation::DoOpenFile, | 395 base::Bind(&FileSystemOperation::DoOpenFile, |
396 base::Unretained(deleter.release()), callback, file_flags), | 396 base::Unretained(deleter.release()), callback, file_flags), |
397 base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED, | 397 base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED, |
398 base::kInvalidPlatformFileValue, | 398 base::kInvalidPlatformFileValue, |
399 base::kNullProcessHandle)); | 399 base::kNullProcessHandle)); |
400 } | 400 } |
401 | 401 |
402 void FileSystemOperation::NotifyCloseFile(const GURL& path) { | |
403 // No particular task to do. This method is for remote file systems that | |
404 // need synchronization with remote server. | |
kinuko
2012/06/25 11:46:54
Should we delete this here?
kinaba
2012/06/26 00:15:10
True. Done.
| |
405 } | |
406 | |
402 // We can only get here on a write or truncate that's not yet completed. | 407 // We can only get here on a write or truncate that's not yet completed. |
403 // We don't support cancelling any other operation at this time. | 408 // We don't support cancelling any other operation at this time. |
404 void FileSystemOperation::Cancel(const StatusCallback& cancel_callback) { | 409 void FileSystemOperation::Cancel(const StatusCallback& cancel_callback) { |
405 if (file_writer_delegate_.get()) { | 410 if (file_writer_delegate_.get()) { |
406 DCHECK_EQ(kOperationWrite, pending_operation_); | 411 DCHECK_EQ(kOperationWrite, pending_operation_); |
407 | 412 |
408 // Writes are done without proxying through FileUtilProxy after the initial | 413 // Writes are done without proxying through FileUtilProxy after the initial |
409 // opening of the PlatformFile. All state changes are done on this thread, | 414 // opening of the PlatformFile. All state changes are done on this thread, |
410 // so we're guaranteed to be able to shut down atomically. | 415 // so we're guaranteed to be able to shut down atomically. |
411 const bool delete_now = file_writer_delegate_->Cancel(); | 416 const bool delete_now = file_writer_delegate_->Cancel(); |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
728 } | 733 } |
729 | 734 |
730 bool FileSystemOperation::SetPendingOperationType(OperationType type) { | 735 bool FileSystemOperation::SetPendingOperationType(OperationType type) { |
731 if (pending_operation_ != kOperationNone) | 736 if (pending_operation_ != kOperationNone) |
732 return false; | 737 return false; |
733 pending_operation_ = type; | 738 pending_operation_ = type; |
734 return true; | 739 return true; |
735 } | 740 } |
736 | 741 |
737 } // namespace fileapi | 742 } // namespace fileapi |
OLD | NEW |