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 "storage/browser/fileapi/file_system_operation_impl.h" | 5 #include "storage/browser/fileapi/file_system_operation_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 const FileSystemURL& url, | 544 const FileSystemURL& url, |
545 const WriteCallback& write_callback, | 545 const WriteCallback& write_callback, |
546 base::File::Error rv, | 546 base::File::Error rv, |
547 int64 bytes, | 547 int64 bytes, |
548 FileWriterDelegate::WriteProgressStatus write_status) { | 548 FileWriterDelegate::WriteProgressStatus write_status) { |
549 const bool complete = ( | 549 const bool complete = ( |
550 write_status != FileWriterDelegate::SUCCESS_IO_PENDING); | 550 write_status != FileWriterDelegate::SUCCESS_IO_PENDING); |
551 if (complete && write_status != FileWriterDelegate::ERROR_WRITE_NOT_STARTED) { | 551 if (complete && write_status != FileWriterDelegate::ERROR_WRITE_NOT_STARTED) { |
552 DCHECK(operation_context_); | 552 DCHECK(operation_context_); |
553 operation_context_->change_observers()->Notify( | 553 operation_context_->change_observers()->Notify( |
554 &FileChangeObserver::OnModifyFile, MakeTuple(url)); | 554 &FileChangeObserver::OnModifyFile, base::MakeTuple(url)); |
555 } | 555 } |
556 | 556 |
557 StatusCallback cancel_callback = cancel_callback_; | 557 StatusCallback cancel_callback = cancel_callback_; |
558 write_callback.Run(rv, bytes, complete); | 558 write_callback.Run(rv, bytes, complete); |
559 if (!cancel_callback.is_null()) | 559 if (!cancel_callback.is_null()) |
560 cancel_callback.Run(base::File::FILE_OK); | 560 cancel_callback.Run(base::File::FILE_OK); |
561 } | 561 } |
562 | 562 |
563 bool FileSystemOperationImpl::SetPendingOperationType(OperationType type) { | 563 bool FileSystemOperationImpl::SetPendingOperationType(OperationType type) { |
564 if (pending_operation_ != kOperationNone) | 564 if (pending_operation_ != kOperationNone) |
565 return false; | 565 return false; |
566 pending_operation_ = type; | 566 pending_operation_ = type; |
567 return true; | 567 return true; |
568 } | 568 } |
569 | 569 |
570 } // namespace storage | 570 } // namespace storage |
OLD | NEW |