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

Side by Side Diff: sync/notifier/object_id_payload_map.cc

Issue 10828158: [Sync] Address msw's comments for r149747 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nits Created 8 years, 4 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/object_id_payload_map.h ('k') | sync/notifier/sync_notifier.h » ('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 #include "sync/notifier/object_id_payload_map.h" 5 #include "sync/notifier/object_id_payload_map.h"
6 6
7 namespace syncer { 7 namespace syncer {
8 8
9 ObjectIdSet ObjectIdPayloadMapToSet( 9 ObjectIdSet ObjectIdPayloadMapToSet(
10 const ObjectIdPayloadMap& id_payloads) { 10 const ObjectIdPayloadMap& id_payloads) {
11 ObjectIdSet ids; 11 ObjectIdSet ids;
12 for (ObjectIdPayloadMap::const_iterator it = id_payloads.begin(); 12 for (ObjectIdPayloadMap::const_iterator it = id_payloads.begin();
13 it != id_payloads.end(); ++it) { 13 it != id_payloads.end(); ++it) {
14 ids.insert(it->first); 14 ids.insert(it->first);
15 } 15 }
16 return ids; 16 return ids;
17 } 17 }
18 18
19 ObjectIdPayloadMap ObjectIdSetToPayloadMap( 19 ObjectIdPayloadMap ObjectIdSetToPayloadMap(ObjectIdSet ids,
20 ObjectIdSet ids, const std::string& payload) { 20 const std::string& payload) {
21 ObjectIdPayloadMap id_payloads; 21 ObjectIdPayloadMap id_payloads;
22 for (ObjectIdSet::const_iterator it = ids.begin(); it != ids.end(); ++it) { 22 for (ObjectIdSet::const_iterator it = ids.begin(); it != ids.end(); ++it) {
23 id_payloads[*it] = payload; 23 id_payloads[*it] = payload;
24 } 24 }
25 return id_payloads; 25 return id_payloads;
26 } 26 }
27 27
28 ModelTypePayloadMap ObjectIdPayloadMapToModelTypePayloadMap( 28 ModelTypePayloadMap ObjectIdPayloadMapToModelTypePayloadMap(
29 const ObjectIdPayloadMap& id_payloads) { 29 const ObjectIdPayloadMap& id_payloads) {
30 ModelTypePayloadMap types_with_payloads; 30 ModelTypePayloadMap types_with_payloads;
(...skipping 19 matching lines...) Expand all
50 if (!RealModelTypeToObjectId(it->first, &id)) { 50 if (!RealModelTypeToObjectId(it->first, &id)) {
51 DLOG(WARNING) << "Invalid model type " << it->first; 51 DLOG(WARNING) << "Invalid model type " << it->first;
52 continue; 52 continue;
53 } 53 }
54 id_payloads[id] = it->second; 54 id_payloads[id] = it->second;
55 } 55 }
56 return id_payloads; 56 return id_payloads;
57 } 57 }
58 58
59 } // namespace syncer 59 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/notifier/object_id_payload_map.h ('k') | sync/notifier/sync_notifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698