OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/copy_or_move_operation_delegate.h" | 5 #include "storage/browser/fileapi/copy_or_move_operation_delegate.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <tuple> |
8 #include <utility> | 9 #include <utility> |
9 | 10 |
10 #include "base/bind.h" | 11 #include "base/bind.h" |
11 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "net/base/io_buffer.h" | 14 #include "net/base/io_buffer.h" |
14 #include "net/base/net_errors.h" | 15 #include "net/base/net_errors.h" |
15 #include "storage/browser/blob/shareable_file_reference.h" | 16 #include "storage/browser/blob/shareable_file_reference.h" |
16 #include "storage/browser/fileapi/copy_or_move_file_validator.h" | 17 #include "storage/browser/fileapi/copy_or_move_file_validator.h" |
17 #include "storage/browser/fileapi/file_observers.h" | 18 #include "storage/browser/fileapi/file_observers.h" |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 void Cancel() override { | 405 void Cancel() override { |
405 cancel_requested_ = true; | 406 cancel_requested_ = true; |
406 if (copy_helper_) | 407 if (copy_helper_) |
407 copy_helper_->Cancel(); | 408 copy_helper_->Cancel(); |
408 } | 409 } |
409 | 410 |
410 private: | 411 private: |
411 void NotifyOnStartUpdate(const FileSystemURL& url) { | 412 void NotifyOnStartUpdate(const FileSystemURL& url) { |
412 if (file_system_context_->GetUpdateObservers(url.type())) { | 413 if (file_system_context_->GetUpdateObservers(url.type())) { |
413 file_system_context_->GetUpdateObservers(url.type()) | 414 file_system_context_->GetUpdateObservers(url.type()) |
414 ->Notify(&FileUpdateObserver::OnStartUpdate, base::MakeTuple(url)); | 415 ->Notify(&FileUpdateObserver::OnStartUpdate, std::make_tuple(url)); |
415 } | 416 } |
416 } | 417 } |
417 | 418 |
418 void NotifyOnModifyFile(const FileSystemURL& url) { | 419 void NotifyOnModifyFile(const FileSystemURL& url) { |
419 if (file_system_context_->GetChangeObservers(url.type())) { | 420 if (file_system_context_->GetChangeObservers(url.type())) { |
420 file_system_context_->GetChangeObservers(url.type()) | 421 file_system_context_->GetChangeObservers(url.type()) |
421 ->Notify(&FileChangeObserver::OnModifyFile, base::MakeTuple(url)); | 422 ->Notify(&FileChangeObserver::OnModifyFile, std::make_tuple(url)); |
422 } | 423 } |
423 } | 424 } |
424 | 425 |
425 void NotifyOnEndUpdate(const FileSystemURL& url) { | 426 void NotifyOnEndUpdate(const FileSystemURL& url) { |
426 if (file_system_context_->GetUpdateObservers(url.type())) { | 427 if (file_system_context_->GetUpdateObservers(url.type())) { |
427 file_system_context_->GetUpdateObservers(url.type()) | 428 file_system_context_->GetUpdateObservers(url.type()) |
428 ->Notify(&FileUpdateObserver::OnEndUpdate, base::MakeTuple(url)); | 429 ->Notify(&FileUpdateObserver::OnEndUpdate, std::make_tuple(url)); |
429 } | 430 } |
430 } | 431 } |
431 | 432 |
432 void RunAfterGetMetadataForSource( | 433 void RunAfterGetMetadataForSource( |
433 const CopyOrMoveOperationDelegate::StatusCallback& callback, | 434 const CopyOrMoveOperationDelegate::StatusCallback& callback, |
434 base::File::Error error, | 435 base::File::Error error, |
435 const base::File::Info& file_info) { | 436 const base::File::Info& file_info) { |
436 if (cancel_requested_) | 437 if (cancel_requested_) |
437 error = base::File::FILE_ERROR_ABORT; | 438 error = base::File::FILE_ERROR_ABORT; |
438 | 439 |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 base::FilePath relative = dest_root_.virtual_path(); | 1027 base::FilePath relative = dest_root_.virtual_path(); |
1027 src_root_.virtual_path().AppendRelativePath(src_url.virtual_path(), | 1028 src_root_.virtual_path().AppendRelativePath(src_url.virtual_path(), |
1028 &relative); | 1029 &relative); |
1029 return file_system_context()->CreateCrackedFileSystemURL( | 1030 return file_system_context()->CreateCrackedFileSystemURL( |
1030 dest_root_.origin(), | 1031 dest_root_.origin(), |
1031 dest_root_.mount_type(), | 1032 dest_root_.mount_type(), |
1032 relative); | 1033 relative); |
1033 } | 1034 } |
1034 | 1035 |
1035 } // namespace storage | 1036 } // namespace storage |
OLD | NEW |