Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: components/sync/user_events/user_event_sync_bridge.h

Issue 2958303002: [Sync] Maintain a global_id mapping to update UserEvents that references navigations (Closed)
Patch Set: Rebase Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/sync/user_events/user_event_sync_bridge.h
diff --git a/components/sync/user_events/user_event_sync_bridge.h b/components/sync/user_events/user_event_sync_bridge.h
index 8f2409a5a03fa0a979f1cbfbca6e141b3bbab090..bbdef87b8604accc209fd9cd1794ee5b859c80fa 100644
--- a/components/sync/user_events/user_event_sync_bridge.h
+++ b/components/sync/user_events/user_event_sync_bridge.h
@@ -5,19 +5,24 @@
#ifndef COMPONENTS_SYNC_USER_EVENTS_USER_EVENT_SYNC_BRIDGE_H_
#define COMPONENTS_SYNC_USER_EVENTS_USER_EVENT_SYNC_BRIDGE_H_
+#include <stdint.h>
+
+#include <map>
#include <memory>
#include <string>
#include "base/macros.h"
#include "components/sync/model/model_type_store.h"
#include "components/sync/model/model_type_sync_bridge.h"
+#include "components/sync/user_events/global_id_mapper.h"
namespace syncer {
class UserEventSyncBridge : public ModelTypeSyncBridge {
public:
UserEventSyncBridge(const ModelTypeStoreFactory& store_factory,
- const ChangeProcessorFactory& change_processor_factory);
+ const ChangeProcessorFactory& change_processor_factory,
+ GlobalIdMapper* global_id_mapper);
~UserEventSyncBridge() override;
// ModelTypeSyncBridge implementation.
@@ -53,10 +58,18 @@ class UserEventSyncBridge : public ModelTypeSyncBridge {
ModelTypeStore::Result result,
std::unique_ptr<ModelTypeStore::RecordList> data_records);
+ void HandleGlobalIdChange(int64_t old_global_id, int64_t new_global_id);
+
// Persistent storage for in flight events. Should remain quite small, as we
// delete upon commit confirmation.
std::unique_ptr<ModelTypeStore> store_;
+ // The key is the global_id of the navigation the event is linked to.
+ std::multimap<int64_t, sync_pb::UserEventSpecifics>
+ in_flight_nav_linked_events_;
+
+ GlobalIdMapper* global_id_mapper_;
+
DISALLOW_COPY_AND_ASSIGN(UserEventSyncBridge);
};

Powered by Google App Engine
This is Rietveld 408576698