| 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 20 matching lines...) Expand all Loading... |
| 31 std::vector<FileChange>, | 31 std::vector<FileChange>, |
| 32 storage::FileSystemURL::Comparator> URLToFileChangesMap; | 32 storage::FileSystemURL::Comparator> URLToFileChangesMap; |
| 33 typedef std::map<storage::FileSystemURL, | 33 typedef std::map<storage::FileSystemURL, |
| 34 FileChangeList, | 34 FileChangeList, |
| 35 storage::FileSystemURL::Comparator> URLToFileChangeList; | 35 storage::FileSystemURL::Comparator> URLToFileChangeList; |
| 36 typedef std::map<storage::FileSystemURL, | 36 typedef std::map<storage::FileSystemURL, |
| 37 SyncFileMetadata, | 37 SyncFileMetadata, |
| 38 storage::FileSystemURL::Comparator> URLToFileMetadata; | 38 storage::FileSystemURL::Comparator> URLToFileMetadata; |
| 39 | 39 |
| 40 FakeRemoteChangeProcessor(); | 40 FakeRemoteChangeProcessor(); |
| 41 virtual ~FakeRemoteChangeProcessor(); | 41 ~FakeRemoteChangeProcessor() override; |
| 42 | 42 |
| 43 // RemoteChangeProcessor overrides. | 43 // RemoteChangeProcessor overrides. |
| 44 virtual void PrepareForProcessRemoteChange( | 44 void PrepareForProcessRemoteChange( |
| 45 const storage::FileSystemURL& url, | 45 const storage::FileSystemURL& url, |
| 46 const PrepareChangeCallback& callback) override; | 46 const PrepareChangeCallback& callback) override; |
| 47 virtual void ApplyRemoteChange(const FileChange& change, | 47 void ApplyRemoteChange(const FileChange& change, |
| 48 const base::FilePath& local_path, | 48 const base::FilePath& local_path, |
| 49 const storage::FileSystemURL& url, | 49 const storage::FileSystemURL& url, |
| 50 const SyncStatusCallback& callback) override; | 50 const SyncStatusCallback& callback) override; |
| 51 virtual void FinalizeRemoteSync( | 51 void FinalizeRemoteSync(const storage::FileSystemURL& url, |
| 52 const storage::FileSystemURL& url, | 52 bool clear_local_changes, |
| 53 bool clear_local_changes, | 53 const base::Closure& completion_callback) override; |
| 54 const base::Closure& completion_callback) override; | 54 void RecordFakeLocalChange(const storage::FileSystemURL& url, |
| 55 virtual void RecordFakeLocalChange( | 55 const FileChange& change, |
| 56 const storage::FileSystemURL& url, | 56 const SyncStatusCallback& callback) override; |
| 57 const FileChange& change, | |
| 58 const SyncStatusCallback& callback) override; | |
| 59 | 57 |
| 60 void UpdateLocalFileMetadata(const storage::FileSystemURL& url, | 58 void UpdateLocalFileMetadata(const storage::FileSystemURL& url, |
| 61 const FileChange& change); | 59 const FileChange& change); |
| 62 void ClearLocalChanges(const storage::FileSystemURL& url); | 60 void ClearLocalChanges(const storage::FileSystemURL& url); |
| 63 | 61 |
| 64 const URLToFileChangesMap& GetAppliedRemoteChanges() const; | 62 const URLToFileChangesMap& GetAppliedRemoteChanges() const; |
| 65 | 63 |
| 66 // Compare |applied_changes_| with |expected_changes|. | 64 // Compare |applied_changes_| with |expected_changes|. |
| 67 // This internally calls EXPECT_FOO, ASSERT_FOO methods in the | 65 // This internally calls EXPECT_FOO, ASSERT_FOO methods in the |
| 68 // verification. | 66 // verification. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 79 | 77 |
| 80 // Initial local file metadata. These are overridden by applied changes. | 78 // Initial local file metadata. These are overridden by applied changes. |
| 81 URLToFileMetadata local_file_metadata_; | 79 URLToFileMetadata local_file_metadata_; |
| 82 | 80 |
| 83 DISALLOW_COPY_AND_ASSIGN(FakeRemoteChangeProcessor); | 81 DISALLOW_COPY_AND_ASSIGN(FakeRemoteChangeProcessor); |
| 84 }; | 82 }; |
| 85 | 83 |
| 86 } // namespace sync_file_system | 84 } // namespace sync_file_system |
| 87 | 85 |
| 88 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_FAKE_REMOTE_CHANGE_PROCESSOR_H_ | 86 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_FAKE_REMOTE_CHANGE_PROCESSOR_H_ |
| OLD | NEW |