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