| 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 #include <utility> |
| 8 | 9 |
| 9 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| 10 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 12 #include "base/debug/stack_trace.h" | 13 #include "base/debug/stack_trace.h" |
| 13 #include "base/files/scoped_temp_dir.h" | 14 #include "base/files/scoped_temp_dir.h" |
| 14 #include "base/json/json_writer.h" | 15 #include "base/json/json_writer.h" |
| 15 #include "base/logging.h" | 16 #include "base/logging.h" |
| 16 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 17 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 << syncer::ObjectIdToString(*ids_it); | 232 << syncer::ObjectIdToString(*ids_it); |
| 232 } else { | 233 } else { |
| 233 syncer::SingleObjectInvalidationSet invalidation_set = | 234 syncer::SingleObjectInvalidationSet invalidation_set = |
| 234 invalidation_map.ForObject(*ids_it); | 235 invalidation_map.ForObject(*ids_it); |
| 235 for (syncer::SingleObjectInvalidationSet::const_iterator inv_it = | 236 for (syncer::SingleObjectInvalidationSet::const_iterator inv_it = |
| 236 invalidation_set.begin(); | 237 invalidation_set.begin(); |
| 237 inv_it != invalidation_set.end(); | 238 inv_it != invalidation_set.end(); |
| 238 ++inv_it) { | 239 ++inv_it) { |
| 239 scoped_ptr<syncer::InvalidationInterface> inv_adapter( | 240 scoped_ptr<syncer::InvalidationInterface> inv_adapter( |
| 240 new InvalidationAdapter(*inv_it)); | 241 new InvalidationAdapter(*inv_it)); |
| 241 sync_manager_->OnIncomingInvalidation(type, inv_adapter.Pass()); | 242 sync_manager_->OnIncomingInvalidation(type, std::move(inv_adapter)); |
| 242 } | 243 } |
| 243 } | 244 } |
| 244 } | 245 } |
| 245 } | 246 } |
| 246 | 247 |
| 247 std::string GetOwnerName() const override { return "InvalidatorShim"; } | 248 std::string GetOwnerName() const override { return "InvalidatorShim"; } |
| 248 | 249 |
| 249 private: | 250 private: |
| 250 SyncManager* sync_manager_; | 251 SyncManager* sync_manager_; |
| 251 }; | 252 }; |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 InternalComponentsFactoryImpl::Switches factory_switches = { | 418 InternalComponentsFactoryImpl::Switches factory_switches = { |
| 418 InternalComponentsFactory::ENCRYPTION_KEYSTORE, | 419 InternalComponentsFactory::ENCRYPTION_KEYSTORE, |
| 419 InternalComponentsFactory::BACKOFF_NORMAL | 420 InternalComponentsFactory::BACKOFF_NORMAL |
| 420 }; | 421 }; |
| 421 CancelationSignal scm_cancelation_signal; | 422 CancelationSignal scm_cancelation_signal; |
| 422 | 423 |
| 423 SyncManager::InitArgs args; | 424 SyncManager::InitArgs args; |
| 424 args.database_location = database_dir.path(); | 425 args.database_location = database_dir.path(); |
| 425 args.event_handler = WeakHandle<JsEventHandler>(js_event_handler.AsWeakPtr()); | 426 args.event_handler = WeakHandle<JsEventHandler>(js_event_handler.AsWeakPtr()); |
| 426 args.service_url = GURL(kSyncServiceURL); | 427 args.service_url = GURL(kSyncServiceURL); |
| 427 args.post_factory = post_factory.Pass(); | 428 args.post_factory = std::move(post_factory); |
| 428 args.workers = workers; | 429 args.workers = workers; |
| 429 args.extensions_activity = extensions_activity; | 430 args.extensions_activity = extensions_activity; |
| 430 args.change_delegate = &change_delegate; | 431 args.change_delegate = &change_delegate; |
| 431 args.credentials = credentials; | 432 args.credentials = credentials; |
| 432 args.invalidator_client_id = invalidator_id; | 433 args.invalidator_client_id = invalidator_id; |
| 433 args.restored_key_for_bootstrapping = kRestoredKeyForBootstrapping; | 434 args.restored_key_for_bootstrapping = kRestoredKeyForBootstrapping; |
| 434 args.restored_keystore_key_for_bootstrapping = | 435 args.restored_keystore_key_for_bootstrapping = |
| 435 kRestoredKeystoreKeyForBootstrapping; | 436 kRestoredKeystoreKeyForBootstrapping; |
| 436 args.internal_components_factory.reset( | 437 args.internal_components_factory.reset( |
| 437 new InternalComponentsFactoryImpl(factory_switches)); | 438 new InternalComponentsFactoryImpl(factory_switches)); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 455 io_thread.Stop(); | 456 io_thread.Stop(); |
| 456 return 0; | 457 return 0; |
| 457 } | 458 } |
| 458 | 459 |
| 459 } // namespace | 460 } // namespace |
| 460 } // namespace syncer | 461 } // namespace syncer |
| 461 | 462 |
| 462 int main(int argc, char* argv[]) { | 463 int main(int argc, char* argv[]) { |
| 463 return syncer::SyncClientMain(argc, argv); | 464 return syncer::SyncClientMain(argc, argv); |
| 464 } | 465 } |
| OLD | NEW |