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.
5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_REMOTE_CHANGE_PROCESSOR_WRAPPER_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_REMOTE_CHANGE_PROCESSOR_WRAPPER_H_
8 #include "base/memory/weak_ptr.h"
9 #include "base/sequence_checker.h"
10 #include "chrome/browser/sync_file_system/remote_change_processor.h"
12 namespace sync_file_system {
13 namespace drive_backend {
15 // This class wraps a part of RemoteChangeProcessor class to support weak
16 // pointer. Each method wraps corresponding name method of
17 // RemoteChangeProcessor. See comments in remote_change_processor.h
19 class RemoteChangeProcessorWrapper
20 : public base::SupportsWeakPtr<RemoteChangeProcessorWrapper> {
22 explicit RemoteChangeProcessorWrapper(
23 RemoteChangeProcessor* remote_change_processor);
25 void PrepareForProcessRemoteChange(
26 const storage::FileSystemURL& url,
27 const RemoteChangeProcessor::PrepareChangeCallback& callback);
29 void ApplyRemoteChange(const FileChange& change,
30 const base::FilePath& local_path,
31 const storage::FileSystemURL& url,
32 const SyncStatusCallback& callback);
34 void FinalizeRemoteSync(const storage::FileSystemURL& url,
35 bool clear_local_changes,
36 const base::Closure& completion_callback);
38 void RecordFakeLocalChange(const storage::FileSystemURL& url,
39 const FileChange& change,
40 const SyncStatusCallback& callback);
43 RemoteChangeProcessor* remote_change_processor_;
44 base::SequenceChecker sequence_checker_;
46 DISALLOW_COPY_AND_ASSIGN(RemoteChangeProcessorWrapper);
49 } // namespace drive_backend
50 } // namespace sync_file_system
52 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_REMOTE_CHANGE_PROCESSOR_WRAPPER_H_