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

Side by Side Diff: sync/internal_api/public/base/model_type_payload_map.h

Issue 10700180: [Sync] Add sync_export.h (Step 1 for componentizing sync) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert model_type_test_util changes Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 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 SYNC_INTERNAL_PUBLIC_API_BASE_MODEL_TYPE_PAYLOAD_MAP_H_ 7 #ifndef SYNC_INTERNAL_PUBLIC_API_BASE_MODEL_TYPE_PAYLOAD_MAP_H_
8 #define SYNC_INTERNAL_PUBLIC_API_BASE_MODEL_TYPE_PAYLOAD_MAP_H_ 8 #define SYNC_INTERNAL_PUBLIC_API_BASE_MODEL_TYPE_PAYLOAD_MAP_H_
9 9
10 #include <map> 10 #include <map>
11 #include <string> 11 #include <string>
12 12
13 #include "sync/base/sync_export.h"
13 #include "sync/internal_api/public/base/model_type.h" 14 #include "sync/internal_api/public/base/model_type.h"
14 15
15 namespace base { 16 namespace base {
16 class DictionaryValue; 17 class DictionaryValue;
17 } 18 }
18 19
19 namespace syncer { 20 namespace syncer {
20 21
21 // A container that contains a set of datatypes with possible string 22 // A container that contains a set of datatypes with possible string
22 // payloads. 23 // payloads.
23 typedef std::map<ModelType, std::string> ModelTypePayloadMap; 24 typedef std::map<ModelType, std::string> ModelTypePayloadMap;
24 25
25 // Helper functions for building ModelTypePayloadMaps. 26 // Helper functions for building ModelTypePayloadMaps.
26 27
27 // Make a TypePayloadMap from all the types in a ModelTypeSet using a 28 // Make a TypePayloadMap from all the types in a ModelTypeSet using a
28 // default payload. 29 // default payload.
29 ModelTypePayloadMap ModelTypePayloadMapFromEnumSet( 30 SYNC_EXPORT ModelTypePayloadMap ModelTypePayloadMapFromEnumSet(
30 ModelTypeSet model_types, const std::string& payload); 31 ModelTypeSet model_types, const std::string& payload);
31 32
32 ModelTypeSet ModelTypePayloadMapToEnumSet( 33 SYNC_EXPORT ModelTypeSet ModelTypePayloadMapToEnumSet(
33 const ModelTypePayloadMap& payload_map); 34 const ModelTypePayloadMap& payload_map);
34 35
35 std::string ModelTypePayloadMapToString( 36 SYNC_EXPORT std::string ModelTypePayloadMapToString(
36 const ModelTypePayloadMap& model_type_payloads); 37 const ModelTypePayloadMap& model_type_payloads);
37 38
38 // Caller takes ownership of the returned dictionary. 39 // Caller takes ownership of the returned dictionary.
39 base::DictionaryValue* ModelTypePayloadMapToValue( 40 SYNC_EXPORT base::DictionaryValue* ModelTypePayloadMapToValue(
40 const ModelTypePayloadMap& model_type_payloads); 41 const ModelTypePayloadMap& model_type_payloads);
41 42
42 // Coalesce |update| into |original|, overwriting only when |update| has 43 // Coalesce |update| into |original|, overwriting only when |update| has
43 // a non-empty payload. 44 // a non-empty payload.
44 void CoalescePayloads(ModelTypePayloadMap* original, 45 SYNC_EXPORT void CoalescePayloads(ModelTypePayloadMap* original,
45 const ModelTypePayloadMap& update); 46 const ModelTypePayloadMap& update);
46 47
47 } // namespace syncer 48 } // namespace syncer
48 49
49 #endif // SYNC_INTERNAL_PUBLIC_API_BASE_MODEL_TYPE_PAYLOAD_MAP_H_ 50 #endif // SYNC_INTERNAL_PUBLIC_API_BASE_MODEL_TYPE_PAYLOAD_MAP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698