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