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/remote_change_processor_
wrapper.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/remote_change_processor_
wrapper.h" |
6 | 6 |
7 #include "base/memory/weak_ptr.h" | 7 #include "base/memory/weak_ptr.h" |
8 #include "chrome/browser/sync_file_system/remote_change_processor.h" | 8 #include "chrome/browser/sync_file_system/remote_change_processor.h" |
9 | 9 |
10 namespace sync_file_system { | 10 namespace sync_file_system { |
11 namespace drive_backend { | 11 namespace drive_backend { |
12 | 12 |
13 RemoteChangeProcessorWrapper::RemoteChangeProcessorWrapper( | 13 RemoteChangeProcessorWrapper::RemoteChangeProcessorWrapper( |
14 RemoteChangeProcessor* remote_change_processor) | 14 RemoteChangeProcessor* remote_change_processor) |
15 : remote_change_processor_(remote_change_processor) {} | 15 : remote_change_processor_(remote_change_processor) {} |
16 | 16 |
17 void RemoteChangeProcessorWrapper::PrepareForProcessRemoteChange( | 17 void RemoteChangeProcessorWrapper::PrepareForProcessRemoteChange( |
18 const storage::FileSystemURL& url, | 18 const storage::FileSystemURL& url, |
19 const RemoteChangeProcessor::PrepareChangeCallback& callback) { | 19 const RemoteChangeProcessor::PrepareChangeCallback& callback) { |
20 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); | 20 DCHECK(sequence_checker_.CalledOnValidSequence()); |
21 remote_change_processor_->PrepareForProcessRemoteChange(url, callback); | 21 remote_change_processor_->PrepareForProcessRemoteChange(url, callback); |
22 } | 22 } |
23 | 23 |
24 void RemoteChangeProcessorWrapper::ApplyRemoteChange( | 24 void RemoteChangeProcessorWrapper::ApplyRemoteChange( |
25 const FileChange& change, | 25 const FileChange& change, |
26 const base::FilePath& local_path, | 26 const base::FilePath& local_path, |
27 const storage::FileSystemURL& url, | 27 const storage::FileSystemURL& url, |
28 const SyncStatusCallback& callback) { | 28 const SyncStatusCallback& callback) { |
29 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); | 29 DCHECK(sequence_checker_.CalledOnValidSequence()); |
30 remote_change_processor_->ApplyRemoteChange( | 30 remote_change_processor_->ApplyRemoteChange( |
31 change, local_path, url, callback); | 31 change, local_path, url, callback); |
32 } | 32 } |
33 | 33 |
34 void RemoteChangeProcessorWrapper::FinalizeRemoteSync( | 34 void RemoteChangeProcessorWrapper::FinalizeRemoteSync( |
35 const storage::FileSystemURL& url, | 35 const storage::FileSystemURL& url, |
36 bool clear_local_changes, | 36 bool clear_local_changes, |
37 const base::Closure& completion_callback) { | 37 const base::Closure& completion_callback) { |
38 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); | 38 DCHECK(sequence_checker_.CalledOnValidSequence()); |
39 remote_change_processor_->FinalizeRemoteSync( | 39 remote_change_processor_->FinalizeRemoteSync( |
40 url, clear_local_changes, completion_callback); | 40 url, clear_local_changes, completion_callback); |
41 } | 41 } |
42 | 42 |
43 void RemoteChangeProcessorWrapper::RecordFakeLocalChange( | 43 void RemoteChangeProcessorWrapper::RecordFakeLocalChange( |
44 const storage::FileSystemURL& url, | 44 const storage::FileSystemURL& url, |
45 const FileChange& change, | 45 const FileChange& change, |
46 const SyncStatusCallback& callback) { | 46 const SyncStatusCallback& callback) { |
47 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); | 47 DCHECK(sequence_checker_.CalledOnValidSequence()); |
48 remote_change_processor_->RecordFakeLocalChange(url, change, callback); | 48 remote_change_processor_->RecordFakeLocalChange(url, change, callback); |
49 } | 49 } |
50 | 50 |
51 } // namespace drive_backend | 51 } // namespace drive_backend |
52 } // namespace sync_file_system | 52 } // namespace sync_file_system |
OLD | NEW |