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 "chrome/browser/sync_file_system/local/local_file_sync_context.h" | 5 #include "chrome/browser/sync_file_system/local/local_file_sync_context.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/files/file_util.h" | 14 #include "base/files/file_util.h" |
15 #include "base/location.h" | 15 #include "base/location.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
18 #include "base/single_thread_task_runner.h" | 18 #include "base/single_thread_task_runner.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 storage::ScopedFile* snapshot_out, | 127 storage::ScopedFile* snapshot_out, |
128 SyncStatusCode status, | 128 SyncStatusCode status, |
129 const LocalFileSyncInfo& sync_file_info, | 129 const LocalFileSyncInfo& sync_file_info, |
130 storage::ScopedFile snapshot) { | 130 storage::ScopedFile snapshot) { |
131 ASSERT_TRUE(ui_task_runner_->RunsTasksOnCurrentThread()); | 131 ASSERT_TRUE(ui_task_runner_->RunsTasksOnCurrentThread()); |
132 has_inflight_prepare_for_sync_ = false; | 132 has_inflight_prepare_for_sync_ = false; |
133 status_ = status; | 133 status_ = status; |
134 *metadata_out = sync_file_info.metadata; | 134 *metadata_out = sync_file_info.metadata; |
135 *changes_out = sync_file_info.changes; | 135 *changes_out = sync_file_info.changes; |
136 if (snapshot_out) | 136 if (snapshot_out) |
137 *snapshot_out = snapshot.Pass(); | 137 *snapshot_out = std::move(snapshot); |
138 base::MessageLoop::current()->QuitWhenIdle(); | 138 base::MessageLoop::current()->QuitWhenIdle(); |
139 } | 139 } |
140 | 140 |
141 SyncStatusCode ApplyRemoteChange(FileSystemContext* file_system_context, | 141 SyncStatusCode ApplyRemoteChange(FileSystemContext* file_system_context, |
142 const FileChange& change, | 142 const FileChange& change, |
143 const base::FilePath& local_path, | 143 const base::FilePath& local_path, |
144 const FileSystemURL& url, | 144 const FileSystemURL& url, |
145 SyncFileType expected_file_type) { | 145 SyncFileType expected_file_type) { |
146 SCOPED_TRACE(testing::Message() << "ApplyChange for " << | 146 SCOPED_TRACE(testing::Message() << "ApplyChange for " << |
147 url.DebugString()); | 147 url.DebugString()); |
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 | 953 |
954 // Make sure kDir and kFile are created by ApplyRemoteChange. | 954 // Make sure kDir and kFile are created by ApplyRemoteChange. |
955 EXPECT_EQ(base::File::FILE_OK, file_system.FileExists(kFile)); | 955 EXPECT_EQ(base::File::FILE_OK, file_system.FileExists(kFile)); |
956 EXPECT_EQ(base::File::FILE_OK, file_system.DirectoryExists(kDir)); | 956 EXPECT_EQ(base::File::FILE_OK, file_system.DirectoryExists(kDir)); |
957 | 957 |
958 sync_context_->ShutdownOnUIThread(); | 958 sync_context_->ShutdownOnUIThread(); |
959 file_system.TearDown(); | 959 file_system.TearDown(); |
960 } | 960 } |
961 | 961 |
962 } // namespace sync_file_system | 962 } // namespace sync_file_system |
OLD | NEW |