| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <tuple> |
| 9 #include <utility> | 10 #include <utility> |
| 10 | 11 |
| 11 #include "base/bind.h" | 12 #include "base/bind.h" |
| 12 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 14 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 15 #include "base/trace_event/trace_event.h" | 16 #include "base/trace_event/trace_event.h" |
| 16 #include "net/base/escape.h" | 17 #include "net/base/escape.h" |
| 17 #include "net/url_request/url_request.h" | 18 #include "net/url_request/url_request.h" |
| 18 #include "storage/browser/blob/shareable_file_reference.h" | 19 #include "storage/browser/blob/shareable_file_reference.h" |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 const FileSystemURL& url, | 575 const FileSystemURL& url, |
| 575 const WriteCallback& write_callback, | 576 const WriteCallback& write_callback, |
| 576 base::File::Error rv, | 577 base::File::Error rv, |
| 577 int64_t bytes, | 578 int64_t bytes, |
| 578 FileWriterDelegate::WriteProgressStatus write_status) { | 579 FileWriterDelegate::WriteProgressStatus write_status) { |
| 579 const bool complete = ( | 580 const bool complete = ( |
| 580 write_status != FileWriterDelegate::SUCCESS_IO_PENDING); | 581 write_status != FileWriterDelegate::SUCCESS_IO_PENDING); |
| 581 if (complete && write_status != FileWriterDelegate::ERROR_WRITE_NOT_STARTED) { | 582 if (complete && write_status != FileWriterDelegate::ERROR_WRITE_NOT_STARTED) { |
| 582 DCHECK(operation_context_); | 583 DCHECK(operation_context_); |
| 583 operation_context_->change_observers()->Notify( | 584 operation_context_->change_observers()->Notify( |
| 584 &FileChangeObserver::OnModifyFile, base::MakeTuple(url)); | 585 &FileChangeObserver::OnModifyFile, std::make_tuple(url)); |
| 585 } | 586 } |
| 586 | 587 |
| 587 StatusCallback cancel_callback = cancel_callback_; | 588 StatusCallback cancel_callback = cancel_callback_; |
| 588 write_callback.Run(rv, bytes, complete); | 589 write_callback.Run(rv, bytes, complete); |
| 589 if (!cancel_callback.is_null()) | 590 if (!cancel_callback.is_null()) |
| 590 cancel_callback.Run(base::File::FILE_OK); | 591 cancel_callback.Run(base::File::FILE_OK); |
| 591 } | 592 } |
| 592 | 593 |
| 593 bool FileSystemOperationImpl::SetPendingOperationType(OperationType type) { | 594 bool FileSystemOperationImpl::SetPendingOperationType(OperationType type) { |
| 594 if (pending_operation_ != kOperationNone) | 595 if (pending_operation_ != kOperationNone) |
| 595 return false; | 596 return false; |
| 596 pending_operation_ = type; | 597 pending_operation_ = type; |
| 597 return true; | 598 return true; |
| 598 } | 599 } |
| 599 | 600 |
| 600 } // namespace storage | 601 } // namespace storage |
| OLD | NEW |