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