Chromium Code Reviews| Index: components/sync/user_events/global_id_mapper.h |
| diff --git a/components/sync/user_events/global_id_mapper.h b/components/sync/user_events/global_id_mapper.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..480232a941ef9b5dfde8882b2ad4f9df7cc1bef6 |
| --- /dev/null |
| +++ b/components/sync/user_events/global_id_mapper.h |
| @@ -0,0 +1,30 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_SYNC_USER_EVENTS_GLOBAL_ID_MAPPER_H_ |
| +#define COMPONENTS_SYNC_USER_EVENTS_GLOBAL_ID_MAPPER_H_ |
| + |
| +#include <stdint.h> |
| + |
| +#include "base/callback.h" |
| + |
| +namespace syncer { |
| + |
| +using GlobalIdChange = |
| + base::RepeatingCallback<void(int64_t old_global_id, int64_t new_global_id)>; |
| + |
| +class GlobalIdMapper { |
|
Patrick Noland
2017/06/28 22:44:37
Please add a comment explaining what this is class
skym
2017/07/05 19:14:28
Done.
|
| + public: |
| + // Register for information about changing |
| + virtual void AddGlobalIdChangeObserver(GlobalIdChange callback) = 0; |
| + |
| + // Given a |global_id|, returns what the current |global_id| is for the given |
| + // navigation, to the best of our ability. If we do not have such a mapping, |
| + // which is quite possible, the input |global_id| is returned. |
| + virtual int64_t GetLatestGlobalId(int64_t global_id) = 0; |
|
Patrick Noland
2017/06/28 22:44:37
I think I understand what this is doing, but the c
skym
2017/07/05 19:14:28
Done the first and third requests, the class comme
|
| +}; |
| + |
| +} // namespace syncer |
| + |
| +#endif // COMPONENTS_SYNC_USER_EVENTS_GLOBAL_ID_MAPPER_H_ |