| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef SYNC_NOTIFIER_OBJECT_ID_STATE_MAP_H_ | |
| 6 #define SYNC_NOTIFIER_OBJECT_ID_STATE_MAP_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "google/cacheinvalidation/include/types.h" | |
| 13 #include "sync/internal_api/public/base/invalidation_state.h" | |
| 14 #include "sync/internal_api/public/base/model_type_state_map.h" | |
| 15 #include "sync/notifier/invalidation_util.h" | |
| 16 | |
| 17 namespace base { | |
| 18 class ListValue; | |
| 19 } // namespace base | |
| 20 | |
| 21 namespace syncer { | |
| 22 | |
| 23 typedef std::map<invalidation::ObjectId, | |
| 24 InvalidationState, | |
| 25 ObjectIdLessThan> ObjectIdStateMap; | |
| 26 | |
| 27 // Converts between ObjectIdStateMaps and ObjectIdSets. | |
| 28 ObjectIdSet ObjectIdStateMapToSet(const ObjectIdStateMap& id_payloads); | |
| 29 ObjectIdStateMap ObjectIdSetToStateMap(const ObjectIdSet& ids, | |
| 30 const std::string& payload); | |
| 31 | |
| 32 bool ObjectIdStateMapEquals(const ObjectIdStateMap& id_state_map1, | |
| 33 const ObjectIdStateMap& id_state_map2); | |
| 34 | |
| 35 scoped_ptr<base::ListValue> ObjectIdStateMapToValue( | |
| 36 const ObjectIdStateMap& model_type_payloads); | |
| 37 | |
| 38 bool ObjectIdStateMapFromValue(const base::ListValue& value, | |
| 39 ObjectIdStateMap* out); | |
| 40 | |
| 41 // Converts between ObjectIdStateMaps and ModelTypeStateMaps. | |
| 42 ModelTypeStateMap ObjectIdStateMapToModelTypeStateMap( | |
| 43 const ObjectIdStateMap& id_payloads); | |
| 44 ObjectIdStateMap ModelTypeStateMapToObjectIdStateMap( | |
| 45 const ModelTypeStateMap& type_payloads); | |
| 46 | |
| 47 } // namespace syncer | |
| 48 | |
| 49 #endif // HOME_DCHENG_SRC_CHROMIUM_SRC_SYNC_NOTIFIER_OBJECT_ID_STATE_MAP_H_ | |
| OLD | NEW |