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

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

Issue 10795018: [Sync] Remove unneeded 'using syncer::' lines and 'syncer::' scopings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fiix indent 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
« no previous file with comments | « sync/notifier/invalidation_util.h ('k') | sync/notifier/mock_sync_notifier_observer.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/invalidation_util.h" 5 #include "sync/notifier/invalidation_util.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "google/cacheinvalidation/include/types.h" 9 #include "google/cacheinvalidation/include/types.h"
10 #include "google/cacheinvalidation/v2/types.pb.h" 10 #include "google/cacheinvalidation/v2/types.pb.h"
11 11
12 namespace syncer { 12 namespace syncer {
13 13
14 bool ObjectIdLessThan::operator()(const invalidation::ObjectId& lhs, 14 bool ObjectIdLessThan::operator()(const invalidation::ObjectId& lhs,
15 const invalidation::ObjectId& rhs) const { 15 const invalidation::ObjectId& rhs) const {
16 return (lhs.source() < rhs.source()) || 16 return (lhs.source() < rhs.source()) ||
17 (lhs.source() == rhs.source() && lhs.name() < rhs.name()); 17 (lhs.source() == rhs.source() && lhs.name() < rhs.name());
18 } 18 }
19 19
20 bool RealModelTypeToObjectId(syncer::ModelType model_type, 20 bool RealModelTypeToObjectId(ModelType model_type,
21 invalidation::ObjectId* object_id) { 21 invalidation::ObjectId* object_id) {
22 std::string notification_type; 22 std::string notification_type;
23 if (!syncer::RealModelTypeToNotificationType( 23 if (!RealModelTypeToNotificationType(model_type, &notification_type)) {
24 model_type, &notification_type)) {
25 return false; 24 return false;
26 } 25 }
27 object_id->Init(ipc::invalidation::ObjectSource::CHROME_SYNC, 26 object_id->Init(ipc::invalidation::ObjectSource::CHROME_SYNC,
28 notification_type); 27 notification_type);
29 return true; 28 return true;
30 } 29 }
31 30
32 bool ObjectIdToRealModelType(const invalidation::ObjectId& object_id, 31 bool ObjectIdToRealModelType(const invalidation::ObjectId& object_id,
33 syncer::ModelType* model_type) { 32 ModelType* model_type) {
34 return 33 return NotificationTypeToRealModelType(object_id.name(), model_type);
35 syncer::NotificationTypeToRealModelType(
36 object_id.name(), model_type);
37 } 34 }
38 35
39 std::string ObjectIdToString( 36 std::string ObjectIdToString(
40 const invalidation::ObjectId& object_id) { 37 const invalidation::ObjectId& object_id) {
41 std::stringstream ss; 38 std::stringstream ss;
42 ss << "{ "; 39 ss << "{ ";
43 ss << "name: " << object_id.name() << ", "; 40 ss << "name: " << object_id.name() << ", ";
44 ss << "source: " << object_id.source(); 41 ss << "source: " << object_id.source();
45 ss << " }"; 42 ss << " }";
46 return ss.str(); 43 return ss.str();
47 } 44 }
48 45
49 std::string InvalidationToString( 46 std::string InvalidationToString(
50 const invalidation::Invalidation& invalidation) { 47 const invalidation::Invalidation& invalidation) {
51 std::stringstream ss; 48 std::stringstream ss;
52 ss << "{ "; 49 ss << "{ ";
53 ss << "object_id: " << ObjectIdToString(invalidation.object_id()) << ", "; 50 ss << "object_id: " << ObjectIdToString(invalidation.object_id()) << ", ";
54 ss << "version: " << invalidation.version(); 51 ss << "version: " << invalidation.version();
55 ss << " }"; 52 ss << " }";
56 return ss.str(); 53 return ss.str();
57 } 54 }
58 55
59 } // namespace syncer 56 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/notifier/invalidation_util.h ('k') | sync/notifier/mock_sync_notifier_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698