OLD | NEW |
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 <cstddef> | 5 #include <cstddef> |
6 #include <cstdio> | 6 #include <cstdio> |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 NotificationPrinter() {} | 53 NotificationPrinter() {} |
54 virtual ~NotificationPrinter() {} | 54 virtual ~NotificationPrinter() {} |
55 | 55 |
56 virtual void OnInvalidatorStateChange(InvalidatorState state) OVERRIDE { | 56 virtual void OnInvalidatorStateChange(InvalidatorState state) OVERRIDE { |
57 LOG(INFO) << "Invalidator state changed to " | 57 LOG(INFO) << "Invalidator state changed to " |
58 << InvalidatorStateToString(state); | 58 << InvalidatorStateToString(state); |
59 } | 59 } |
60 | 60 |
61 virtual void OnIncomingInvalidation( | 61 virtual void OnIncomingInvalidation( |
62 const ObjectIdInvalidationMap& invalidation_map) OVERRIDE { | 62 const ObjectIdInvalidationMap& invalidation_map) OVERRIDE { |
63 for (ObjectIdInvalidationMap::const_iterator it = invalidation_map.begin(); | 63 ObjectIdSet ids = invalidation_map.GetObjectIds(); |
64 it != invalidation_map.end(); ++it) { | 64 for (ObjectIdSet::const_iterator it = ids.begin(); it != ids.end(); ++it) { |
65 LOG(INFO) << "Remote invalidation: id = " | 65 LOG(INFO) << "Remote invalidation: " |
66 << ObjectIdToString(it->first) | 66 << invalidation_map.ToString(); |
67 << ", version = " << it->second.version | |
68 << ", payload = " << it->second.payload; | |
69 } | 67 } |
70 } | 68 } |
71 | 69 |
72 private: | 70 private: |
73 DISALLOW_COPY_AND_ASSIGN(NotificationPrinter); | 71 DISALLOW_COPY_AND_ASSIGN(NotificationPrinter); |
74 }; | 72 }; |
75 | 73 |
76 // Needed to use a real host resolver. | 74 // Needed to use a real host resolver. |
77 class MyTestURLRequestContext : public net::TestURLRequestContext { | 75 class MyTestURLRequestContext : public net::TestURLRequestContext { |
78 public: | 76 public: |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 io_thread.Stop(); | 204 io_thread.Stop(); |
207 return 0; | 205 return 0; |
208 } | 206 } |
209 | 207 |
210 } // namespace | 208 } // namespace |
211 } // namespace syncer | 209 } // namespace syncer |
212 | 210 |
213 int main(int argc, char* argv[]) { | 211 int main(int argc, char* argv[]) { |
214 return syncer::SyncListenNotificationsMain(argc, argv); | 212 return syncer::SyncListenNotificationsMain(argc, argv); |
215 } | 213 } |
OLD | NEW |