OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 SYNC_API_FAKE_SYNC_CHANGE_PROCESSOR_H_ | 5 #ifndef SYNC_API_FAKE_SYNC_CHANGE_PROCESSOR_H_ |
6 #define SYNC_API_FAKE_SYNC_CHANGE_PROCESSOR_H_ | 6 #define SYNC_API_FAKE_SYNC_CHANGE_PROCESSOR_H_ |
7 | 7 |
8 #include "sync/api/sync_change_processor.h" | 8 #include "sync/api/sync_change_processor.h" |
9 | 9 |
10 namespace syncer { | 10 namespace syncer { |
11 | 11 |
12 class FakeSyncChangeProcessor : public SyncChangeProcessor { | 12 class FakeSyncChangeProcessor : public SyncChangeProcessor { |
13 public: | 13 public: |
14 FakeSyncChangeProcessor(); | 14 FakeSyncChangeProcessor(); |
15 virtual ~FakeSyncChangeProcessor(); | 15 ~FakeSyncChangeProcessor() override; |
16 | 16 |
17 // SyncChangeProcessor implementation. | 17 // SyncChangeProcessor implementation. |
18 // | 18 // |
19 // ProcessSyncChanges will accumulate changes in changes() until they are | 19 // ProcessSyncChanges will accumulate changes in changes() until they are |
20 // cleared. | 20 // cleared. |
21 virtual syncer::SyncError ProcessSyncChanges( | 21 syncer::SyncError ProcessSyncChanges( |
22 const tracked_objects::Location& from_here, | 22 const tracked_objects::Location& from_here, |
23 const syncer::SyncChangeList& change_list) override; | 23 const syncer::SyncChangeList& change_list) override; |
24 | 24 |
25 // SyncChangeProcessor implementation. | 25 // SyncChangeProcessor implementation. |
26 // | 26 // |
27 // Returns data(). | 27 // Returns data(). |
28 virtual syncer::SyncDataList GetAllSyncData(syncer::ModelType type) | 28 syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; |
29 const override; | |
30 | 29 |
31 // SyncChangeProcessor implementation. | 30 // SyncChangeProcessor implementation. |
32 // | 31 // |
33 // Updates context(). | 32 // Updates context(). |
34 virtual syncer::SyncError UpdateDataTypeContext( | 33 syncer::SyncError UpdateDataTypeContext(ModelType type, |
35 ModelType type, | 34 ContextRefreshStatus refresh_status, |
36 ContextRefreshStatus refresh_status, | 35 const std::string& context) override; |
37 const std::string& context) override; | |
38 | 36 |
39 virtual const syncer::SyncChangeList& changes() const; | 37 virtual const syncer::SyncChangeList& changes() const; |
40 virtual syncer::SyncChangeList& changes(); | 38 virtual syncer::SyncChangeList& changes(); |
41 | 39 |
42 virtual const syncer::SyncDataList& data() const; | 40 virtual const syncer::SyncDataList& data() const; |
43 virtual syncer::SyncDataList& data(); | 41 virtual syncer::SyncDataList& data(); |
44 | 42 |
45 virtual const std::string& context() const; | 43 virtual const std::string& context() const; |
46 virtual std::string& context(); | 44 virtual std::string& context(); |
47 | 45 |
48 private: | 46 private: |
49 syncer::SyncChangeList changes_; | 47 syncer::SyncChangeList changes_; |
50 syncer::SyncDataList data_; | 48 syncer::SyncDataList data_; |
51 std::string context_; | 49 std::string context_; |
52 | 50 |
53 DISALLOW_COPY_AND_ASSIGN(FakeSyncChangeProcessor); | 51 DISALLOW_COPY_AND_ASSIGN(FakeSyncChangeProcessor); |
54 }; | 52 }; |
55 | 53 |
56 } // namespace syncer | 54 } // namespace syncer |
57 | 55 |
58 #endif // SYNC_API_FAKE_SYNC_CHANGE_PROCESSOR_H_ | 56 #endif // SYNC_API_FAKE_SYNC_CHANGE_PROCESSOR_H_ |
OLD | NEW |