| 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 private: | 214 private: |
| 215 syncer::Invalidation invalidation_; | 215 syncer::Invalidation invalidation_; |
| 216 }; | 216 }; |
| 217 | 217 |
| 218 class InvalidatorShim : public InvalidationHandler { | 218 class InvalidatorShim : public InvalidationHandler { |
| 219 public: | 219 public: |
| 220 explicit InvalidatorShim(SyncManager* sync_manager) | 220 explicit InvalidatorShim(SyncManager* sync_manager) |
| 221 : sync_manager_(sync_manager) {} | 221 : sync_manager_(sync_manager) {} |
| 222 | 222 |
| 223 virtual void OnInvalidatorStateChange(InvalidatorState state) OVERRIDE { | 223 virtual void OnInvalidatorStateChange(InvalidatorState state) OVERRIDE { |
| 224 sync_manager_->OnInvalidatorStateChange(state); | 224 sync_manager_->SetInvalidatorEnabled(state == INVALIDATIONS_ENABLED); |
| 225 } | 225 } |
| 226 | 226 |
| 227 virtual void OnIncomingInvalidation( | 227 virtual void OnIncomingInvalidation( |
| 228 const ObjectIdInvalidationMap& invalidation_map) OVERRIDE { | 228 const ObjectIdInvalidationMap& invalidation_map) OVERRIDE { |
| 229 syncer::ObjectIdSet ids = invalidation_map.GetObjectIds(); | 229 syncer::ObjectIdSet ids = invalidation_map.GetObjectIds(); |
| 230 for (syncer::ObjectIdSet::const_iterator ids_it = ids.begin(); | 230 for (syncer::ObjectIdSet::const_iterator ids_it = ids.begin(); |
| 231 ids_it != ids.end(); | 231 ids_it != ids.end(); |
| 232 ++ids_it) { | 232 ++ids_it) { |
| 233 syncer::ModelType type; | 233 syncer::ModelType type; |
| 234 if (!NotificationTypeToRealModelType(ids_it->name(), &type)) { | 234 if (!NotificationTypeToRealModelType(ids_it->name(), &type)) { |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 io_thread.Stop(); | 464 io_thread.Stop(); |
| 465 return 0; | 465 return 0; |
| 466 } | 466 } |
| 467 | 467 |
| 468 } // namespace | 468 } // namespace |
| 469 } // namespace syncer | 469 } // namespace syncer |
| 470 | 470 |
| 471 int main(int argc, char* argv[]) { | 471 int main(int argc, char* argv[]) { |
| 472 return syncer::SyncClientMain(argc, argv); | 472 return syncer::SyncClientMain(argc, argv); |
| 473 } | 473 } |
| OLD | NEW |