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

Side by Side Diff: sync/notifier/invalidation_util.h

Issue 10837214: Refactor ModelTypePayloadMap and ObjectIdPayloadMap to StateMaps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit test Created 8 years, 3 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
« no previous file with comments | « sync/notifier/invalidation_notifier_unittest.cc ('k') | sync/notifier/invalidation_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Various utilities for dealing with invalidation data types. 5 // Various utilities for dealing with invalidation data types.
6 6
7 #ifndef SYNC_NOTIFIER_INVALIDATION_UTIL_H_ 7 #ifndef SYNC_NOTIFIER_INVALIDATION_UTIL_H_
8 #define SYNC_NOTIFIER_INVALIDATION_UTIL_H_ 8 #define SYNC_NOTIFIER_INVALIDATION_UTIL_H_
9 9
10 #include <iosfwd>
10 #include <set> 11 #include <set>
11 #include <string> 12 #include <string>
12 13
13 #include "sync/internal_api/public/base/model_type.h" 14 #include "sync/internal_api/public/base/model_type.h"
14 15
15 namespace invalidation { 16 namespace invalidation {
16 17
17 class Invalidation; 18 class Invalidation;
18 class ObjectId; 19 class ObjectId;
19 20
21 // Gmock print helper
22 void PrintTo(const invalidation::ObjectId& id, std::ostream* os);
23
20 } // namespace invalidation 24 } // namespace invalidation
21 25
22 namespace syncer { 26 namespace syncer {
23 27
24 struct ObjectIdLessThan { 28 struct ObjectIdLessThan {
25 bool operator()(const invalidation::ObjectId& lhs, 29 bool operator()(const invalidation::ObjectId& lhs,
26 const invalidation::ObjectId& rhs) const; 30 const invalidation::ObjectId& rhs) const;
27 }; 31 };
28 32
29 typedef std::set<invalidation::ObjectId, ObjectIdLessThan> ObjectIdSet; 33 typedef std::set<invalidation::ObjectId, ObjectIdLessThan> ObjectIdSet;
30 34
31 bool RealModelTypeToObjectId(ModelType model_type, 35 bool RealModelTypeToObjectId(ModelType model_type,
32 invalidation::ObjectId* object_id); 36 invalidation::ObjectId* object_id);
33 37
34 bool ObjectIdToRealModelType(const invalidation::ObjectId& object_id, 38 bool ObjectIdToRealModelType(const invalidation::ObjectId& object_id,
35 ModelType* model_type); 39 ModelType* model_type);
36 40
37 ObjectIdSet ModelTypeSetToObjectIdSet(const ModelTypeSet& models); 41 ObjectIdSet ModelTypeSetToObjectIdSet(const ModelTypeSet& models);
38 ModelTypeSet ObjectIdSetToModelTypeSet(const ObjectIdSet& ids); 42 ModelTypeSet ObjectIdSetToModelTypeSet(const ObjectIdSet& ids);
39 43
40 std::string ObjectIdToString(const invalidation::ObjectId& object_id); 44 std::string ObjectIdToString(const invalidation::ObjectId& object_id);
41 45
42 std::string InvalidationToString( 46 std::string InvalidationToString(
43 const invalidation::Invalidation& invalidation); 47 const invalidation::Invalidation& invalidation);
44 48
45 } // namespace syncer 49 } // namespace syncer
46 50
47 #endif // SYNC_NOTIFIER_INVALIDATION_UTIL_H_ 51 #endif // SYNC_NOTIFIER_INVALIDATION_UTIL_H_
OLDNEW
« no previous file with comments | « sync/notifier/invalidation_notifier_unittest.cc ('k') | sync/notifier/invalidation_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698