OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 COMPONENTS_SYNC_USER_EVENTS_USER_EVENT_SYNC_BRIDGE_H_ | 5 #ifndef COMPONENTS_SYNC_USER_EVENTS_USER_EVENT_SYNC_BRIDGE_H_ |
6 #define COMPONENTS_SYNC_USER_EVENTS_USER_EVENT_SYNC_BRIDGE_H_ | 6 #define COMPONENTS_SYNC_USER_EVENTS_USER_EVENT_SYNC_BRIDGE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "components/sync/model/model_type_store.h" | 12 #include "components/sync/model/model_type_store.h" |
13 #include "components/sync/model/model_type_sync_bridge.h" | 13 #include "components/sync/model/model_type_sync_bridge.h" |
14 | 14 |
15 namespace syncer { | 15 namespace syncer { |
16 | 16 |
17 class UserEventSyncBridge : public ModelTypeSyncBridge { | 17 class UserEventSyncBridge : public ModelTypeSyncBridge { |
18 public: | 18 public: |
19 UserEventSyncBridge(const ModelTypeStoreFactory& store_factory, | 19 UserEventSyncBridge(const ModelTypeStoreFactory& store_factory, |
20 const ChangeProcessorFactory& change_processor_factory); | 20 const ChangeProcessorFactory& change_processor_factory); |
21 ~UserEventSyncBridge() override; | 21 ~UserEventSyncBridge() override; |
22 | 22 |
23 // ModelTypeSyncBridge implementation. | 23 // ModelTypeSyncBridge implementation. |
24 std::unique_ptr<MetadataChangeList> CreateMetadataChangeList() override; | 24 std::unique_ptr<MetadataChangeList> CreateMetadataChangeList() override; |
25 base::Optional<ModelError> MergeSyncData( | 25 base::Optional<ModelError> MergeSyncData( |
26 std::unique_ptr<MetadataChangeList> metadata_change_list, | 26 std::unique_ptr<MetadataChangeList> metadata_change_list, |
27 EntityDataMap entity_data_map) override; | 27 EntityChangeList entity_data) override; |
28 base::Optional<ModelError> ApplySyncChanges( | 28 base::Optional<ModelError> ApplySyncChanges( |
29 std::unique_ptr<MetadataChangeList> metadata_change_list, | 29 std::unique_ptr<MetadataChangeList> metadata_change_list, |
30 EntityChangeList entity_changes) override; | 30 EntityChangeList entity_changes) override; |
31 void GetData(StorageKeyList storage_keys, DataCallback callback) override; | 31 void GetData(StorageKeyList storage_keys, DataCallback callback) override; |
32 void GetAllData(DataCallback callback) override; | 32 void GetAllData(DataCallback callback) override; |
33 std::string GetClientTag(const EntityData& entity_data) override; | 33 std::string GetClientTag(const EntityData& entity_data) override; |
34 std::string GetStorageKey(const EntityData& entity_data) override; | 34 std::string GetStorageKey(const EntityData& entity_data) override; |
35 void DisableSync() override; | 35 void DisableSync() override; |
36 | 36 |
37 void RecordUserEvent(std::unique_ptr<sync_pb::UserEventSpecifics> specifics); | 37 void RecordUserEvent(std::unique_ptr<sync_pb::UserEventSpecifics> specifics); |
(...skipping 18 matching lines...) Expand all Loading... |
56 // Persistent storage for in flight events. Should remain quite small, as we | 56 // Persistent storage for in flight events. Should remain quite small, as we |
57 // delete upon commit confirmation. | 57 // delete upon commit confirmation. |
58 std::unique_ptr<ModelTypeStore> store_; | 58 std::unique_ptr<ModelTypeStore> store_; |
59 | 59 |
60 DISALLOW_COPY_AND_ASSIGN(UserEventSyncBridge); | 60 DISALLOW_COPY_AND_ASSIGN(UserEventSyncBridge); |
61 }; | 61 }; |
62 | 62 |
63 } // namespace syncer | 63 } // namespace syncer |
64 | 64 |
65 #endif // COMPONENTS_SYNC_USER_EVENTS_USER_EVENT_SYNC_BRIDGE_H_ | 65 #endif // COMPONENTS_SYNC_USER_EVENTS_USER_EVENT_SYNC_BRIDGE_H_ |
OLD | NEW |