OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 // Definition of ModelTypePayloadMap and various utility functions. | 5 // Definition of ModelTypePayloadMap and various utility functions. |
6 | 6 |
7 #ifndef CHROME_BROWSER_SYNC_SYNCABLE_MODEL_TYPE_PAYLOAD_MAP_H_ | 7 #ifndef SYNC_SYNCABLE_MODEL_TYPE_PAYLOAD_MAP_H_ |
8 #define CHROME_BROWSER_SYNC_SYNCABLE_MODEL_TYPE_PAYLOAD_MAP_H_ | 8 #define SYNC_SYNCABLE_MODEL_TYPE_PAYLOAD_MAP_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
11 #include <map> | 11 #include <map> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "chrome/browser/sync/engine/model_safe_worker.h" | 14 #include "sync/engine/model_safe_worker.h" |
15 #include "chrome/browser/sync/syncable/model_type.h" | 15 #include "sync/syncable/model_type.h" |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 class DictionaryValue; | 18 class DictionaryValue; |
19 } | 19 } |
20 | 20 |
21 namespace syncable { | 21 namespace syncable { |
22 | 22 |
23 // A container that contains a set of datatypes with possible string | 23 // A container that contains a set of datatypes with possible string |
24 // payloads. | 24 // payloads. |
25 typedef std::map<ModelType, std::string> ModelTypePayloadMap; | 25 typedef std::map<ModelType, std::string> ModelTypePayloadMap; |
(...skipping 24 matching lines...) Expand all Loading... |
50 // Coalesce |update| into |original|, overwriting only when |update| has | 50 // Coalesce |update| into |original|, overwriting only when |update| has |
51 // a non-empty payload. | 51 // a non-empty payload. |
52 void CoalescePayloads(ModelTypePayloadMap* original, | 52 void CoalescePayloads(ModelTypePayloadMap* original, |
53 const ModelTypePayloadMap& update); | 53 const ModelTypePayloadMap& update); |
54 | 54 |
55 void PurgeStalePayload(ModelTypePayloadMap* original, | 55 void PurgeStalePayload(ModelTypePayloadMap* original, |
56 const browser_sync::ModelSafeRoutingInfo& routing_info); | 56 const browser_sync::ModelSafeRoutingInfo& routing_info); |
57 | 57 |
58 } // namespace syncable | 58 } // namespace syncable |
59 | 59 |
60 #endif // CHROME_BROWSER_SYNC_SYNCABLE_MODEL_TYPE_PAYLOAD_MAP_H_ | 60 #endif // SYNC_SYNCABLE_MODEL_TYPE_PAYLOAD_MAP_H_ |
OLD | NEW |