OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_FAKE_REMOTE_CHANGE_PROCESSOR_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_FAKE_REMOTE_CHANGE_PROCESSOR_H_ |
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_FAKE_REMOTE_CHANGE_PROCESSOR_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_FAKE_REMOTE_CHANGE_PROCESSOR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 18 matching lines...) Expand all Loading... |
29 public: | 29 public: |
30 typedef std::map<fileapi::FileSystemURL, std::vector<FileChange>, | 30 typedef std::map<fileapi::FileSystemURL, std::vector<FileChange>, |
31 fileapi::FileSystemURL::Comparator> URLToFileChangesMap; | 31 fileapi::FileSystemURL::Comparator> URLToFileChangesMap; |
32 | 32 |
33 FakeRemoteChangeProcessor(); | 33 FakeRemoteChangeProcessor(); |
34 virtual ~FakeRemoteChangeProcessor(); | 34 virtual ~FakeRemoteChangeProcessor(); |
35 | 35 |
36 // RemoteChangeProcessor overrides. | 36 // RemoteChangeProcessor overrides. |
37 virtual void PrepareForProcessRemoteChange( | 37 virtual void PrepareForProcessRemoteChange( |
38 const fileapi::FileSystemURL& url, | 38 const fileapi::FileSystemURL& url, |
39 const std::string& service_name, | |
40 const PrepareChangeCallback& callback) OVERRIDE; | 39 const PrepareChangeCallback& callback) OVERRIDE; |
41 virtual void ApplyRemoteChange( | 40 virtual void ApplyRemoteChange( |
42 const FileChange& change, | 41 const FileChange& change, |
43 const base::FilePath& local_path, | 42 const base::FilePath& local_path, |
44 const fileapi::FileSystemURL& url, | 43 const fileapi::FileSystemURL& url, |
45 const SyncStatusCallback& callback) OVERRIDE; | 44 const SyncStatusCallback& callback) OVERRIDE; |
46 virtual void ClearLocalChanges( | 45 virtual void ClearLocalChanges( |
47 const fileapi::FileSystemURL& url, | 46 const fileapi::FileSystemURL& url, |
48 const base::Closure& completion_callback) OVERRIDE; | 47 const base::Closure& completion_callback) OVERRIDE; |
49 virtual void RecordFakeLocalChange( | 48 virtual void RecordFakeLocalChange( |
50 const fileapi::FileSystemURL& url, | 49 const fileapi::FileSystemURL& url, |
51 const FileChange& change, | 50 const FileChange& change, |
52 const SyncStatusCallback& callback) OVERRIDE; | 51 const SyncStatusCallback& callback) OVERRIDE; |
53 | 52 |
54 const URLToFileChangesMap& GetAppliedRemoteChanges() const; | 53 const URLToFileChangesMap& GetAppliedRemoteChanges() const; |
55 | 54 |
56 private: | 55 private: |
57 // History of file changes given by ApplyRemoteChange(). Changes are arranged | 56 // History of file changes given by ApplyRemoteChange(). Changes are arranged |
58 // in chronological order, that is, the end of the vector represents the last | 57 // in chronological order, that is, the end of the vector represents the last |
59 // change. | 58 // change. |
60 URLToFileChangesMap applied_changes_; | 59 URLToFileChangesMap applied_changes_; |
61 | 60 |
62 DISALLOW_COPY_AND_ASSIGN(FakeRemoteChangeProcessor); | 61 DISALLOW_COPY_AND_ASSIGN(FakeRemoteChangeProcessor); |
63 }; | 62 }; |
64 | 63 |
65 } // namespace sync_file_system | 64 } // namespace sync_file_system |
66 | 65 |
67 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_FAKE_REMOTE_CHANGE_PROCESSOR_H_ | 66 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_FAKE_REMOTE_CHANGE_PROCESSOR_H_ |
OLD | NEW |