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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 public: | 52 public: |
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, | 62 const ObjectIdInvalidationMap& invalidation_map) OVERRIDE { |
63 IncomingInvalidationSource source) OVERRIDE { | |
64 const ModelTypeInvalidationMap& type_invalidation_map = | 63 const ModelTypeInvalidationMap& type_invalidation_map = |
65 ObjectIdInvalidationMapToModelTypeInvalidationMap(invalidation_map); | 64 ObjectIdInvalidationMapToModelTypeInvalidationMap(invalidation_map); |
66 for (ModelTypeInvalidationMap::const_iterator it = | 65 for (ModelTypeInvalidationMap::const_iterator it = |
67 type_invalidation_map.begin(); it != type_invalidation_map.end(); | 66 type_invalidation_map.begin(); it != type_invalidation_map.end(); |
68 ++it) { | 67 ++it) { |
69 LOG(INFO) << (source == REMOTE_INVALIDATION ? "Remote" : "Local") | 68 LOG(INFO) << "Remote invalidation: type = " |
70 << " Invalidation: type = " | |
71 << ModelTypeToString(it->first) | 69 << ModelTypeToString(it->first) |
72 << ", payload = " << it->second.payload; | 70 << ", payload = " << it->second.payload; |
73 } | 71 } |
74 } | 72 } |
75 | 73 |
76 private: | 74 private: |
77 DISALLOW_COPY_AND_ASSIGN(NotificationPrinter); | 75 DISALLOW_COPY_AND_ASSIGN(NotificationPrinter); |
78 }; | 76 }; |
79 | 77 |
80 // Needed to use a real host resolver. | 78 // Needed to use a real host resolver. |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 io_thread.Stop(); | 216 io_thread.Stop(); |
219 return 0; | 217 return 0; |
220 } | 218 } |
221 | 219 |
222 } // namespace | 220 } // namespace |
223 } // namespace syncer | 221 } // namespace syncer |
224 | 222 |
225 int main(int argc, char* argv[]) { | 223 int main(int argc, char* argv[]) { |
226 return syncer::SyncListenNotificationsMain(argc, argv); | 224 return syncer::SyncListenNotificationsMain(argc, argv); |
227 } | 225 } |
OLD | NEW |