OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/drive_backend/fake_sync_worker.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/fake_sync_worker.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_constants.
h" | 8 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_constants.
h" |
9 #include "chrome/browser/sync_file_system/drive_backend/sync_engine_context.h" | 9 #include "chrome/browser/sync_file_system/drive_backend/sync_engine_context.h" |
10 #include "chrome/browser/sync_file_system/sync_status_code.h" | 10 #include "chrome/browser/sync_file_system/sync_status_code.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 const SyncStatusCallback& callback) { | 59 const SyncStatusCallback& callback) { |
60 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); | 60 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); |
61 // TODO(peria): Check how it should act on uninstalling non-installed app? | 61 // TODO(peria): Check how it should act on uninstalling non-installed app? |
62 status_map_[origin] = UNINSTALLED; | 62 status_map_[origin] = UNINSTALLED; |
63 callback.Run(SYNC_STATUS_OK); | 63 callback.Run(SYNC_STATUS_OK); |
64 } | 64 } |
65 | 65 |
66 void FakeSyncWorker::ProcessRemoteChange( | 66 void FakeSyncWorker::ProcessRemoteChange( |
67 const SyncFileCallback& callback) { | 67 const SyncFileCallback& callback) { |
68 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); | 68 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); |
69 callback.Run(SYNC_STATUS_OK, fileapi::FileSystemURL()); | 69 callback.Run(SYNC_STATUS_OK, storage::FileSystemURL()); |
70 } | 70 } |
71 | 71 |
72 void FakeSyncWorker::SetRemoteChangeProcessor( | 72 void FakeSyncWorker::SetRemoteChangeProcessor( |
73 RemoteChangeProcessorOnWorker* remote_change_processor_on_worker) { | 73 RemoteChangeProcessorOnWorker* remote_change_processor_on_worker) { |
74 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); | 74 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); |
75 } | 75 } |
76 | 76 |
77 RemoteServiceState FakeSyncWorker::GetCurrentState() const { | 77 RemoteServiceState FakeSyncWorker::GetCurrentState() const { |
78 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); | 78 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); |
79 return REMOTE_SERVICE_OK; | 79 return REMOTE_SERVICE_OK; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 130 |
131 void FakeSyncWorker::PromoteDemotedChanges(const base::Closure& callback) { | 131 void FakeSyncWorker::PromoteDemotedChanges(const base::Closure& callback) { |
132 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); | 132 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); |
133 FOR_EACH_OBSERVER( | 133 FOR_EACH_OBSERVER( |
134 Observer, | 134 Observer, |
135 observers_, | 135 observers_, |
136 OnPendingFileListUpdated(10)); | 136 OnPendingFileListUpdated(10)); |
137 callback.Run(); | 137 callback.Run(); |
138 } | 138 } |
139 | 139 |
140 void FakeSyncWorker::ApplyLocalChange( | 140 void FakeSyncWorker::ApplyLocalChange(const FileChange& local_change, |
141 const FileChange& local_change, | 141 const base::FilePath& local_path, |
142 const base::FilePath& local_path, | 142 const SyncFileMetadata& local_metadata, |
143 const SyncFileMetadata& local_metadata, | 143 const storage::FileSystemURL& url, |
144 const fileapi::FileSystemURL& url, | 144 const SyncStatusCallback& callback) { |
145 const SyncStatusCallback& callback) { | |
146 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); | 145 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); |
147 callback.Run(SYNC_STATUS_OK); | 146 callback.Run(SYNC_STATUS_OK); |
148 } | 147 } |
149 | 148 |
150 void FakeSyncWorker::ActivateService(RemoteServiceState service_state, | 149 void FakeSyncWorker::ActivateService(RemoteServiceState service_state, |
151 const std::string& description) { | 150 const std::string& description) { |
152 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); | 151 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); |
153 UpdateServiceState(service_state, description); | 152 UpdateServiceState(service_state, description); |
154 } | 153 } |
155 | 154 |
(...skipping 15 matching lines...) Expand all Loading... |
171 const std::string& description) { | 170 const std::string& description) { |
172 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); | 171 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); |
173 | 172 |
174 FOR_EACH_OBSERVER( | 173 FOR_EACH_OBSERVER( |
175 Observer, observers_, | 174 Observer, observers_, |
176 UpdateServiceState(state, description)); | 175 UpdateServiceState(state, description)); |
177 } | 176 } |
178 | 177 |
179 } // namespace drive_backend | 178 } // namespace drive_backend |
180 } // namespace sync_file_system | 179 } // namespace sync_file_system |
OLD | NEW |