| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <cstdio> | 8 #include <cstdio> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 const char kXmppTrySslTcpFirstSwitch[] = "xmpp-try-ssltcp-first"; | 72 const char kXmppTrySslTcpFirstSwitch[] = "xmpp-try-ssltcp-first"; |
| 73 const char kXmppAllowInsecureConnectionSwitch[] = | 73 const char kXmppAllowInsecureConnectionSwitch[] = |
| 74 "xmpp-allow-insecure-connection"; | 74 "xmpp-allow-insecure-connection"; |
| 75 const char kSyncServiceURL[] = "https://clients4.google.com/chrome-sync/dev"; | 75 const char kSyncServiceURL[] = "https://clients4.google.com/chrome-sync/dev"; |
| 76 | 76 |
| 77 // Needed to use a real host resolver. | 77 // Needed to use a real host resolver. |
| 78 class MyTestURLRequestContext : public net::TestURLRequestContext { | 78 class MyTestURLRequestContext : public net::TestURLRequestContext { |
| 79 public: | 79 public: |
| 80 MyTestURLRequestContext() : TestURLRequestContext(true) { | 80 MyTestURLRequestContext() : TestURLRequestContext(true) { |
| 81 context_storage_.set_host_resolver( | 81 context_storage_.set_host_resolver( |
| 82 net::HostResolver::CreateDefaultResolver(NULL)); | 82 net::HostResolver::CreateDefaultResolver(nullptr)); |
| 83 context_storage_.set_transport_security_state( | 83 context_storage_.set_transport_security_state( |
| 84 base::MakeUnique<net::TransportSecurityState>()); | 84 base::MakeUnique<net::TransportSecurityState>()); |
| 85 Init(); | 85 Init(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 ~MyTestURLRequestContext() override {} | 88 ~MyTestURLRequestContext() override {} |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 class MyTestURLRequestContextGetter : public net::TestURLRequestContextGetter { | 91 class MyTestURLRequestContextGetter : public net::TestURLRequestContextGetter { |
| 92 public: | 92 public: |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 scoped_refptr<PassiveModelWorker> passive_model_safe_worker = | 385 scoped_refptr<PassiveModelWorker> passive_model_safe_worker = |
| 386 new PassiveModelWorker(nullptr); | 386 new PassiveModelWorker(nullptr); |
| 387 std::vector<scoped_refptr<ModelSafeWorker>> workers; | 387 std::vector<scoped_refptr<ModelSafeWorker>> workers; |
| 388 workers.push_back(passive_model_safe_worker); | 388 workers.push_back(passive_model_safe_worker); |
| 389 | 389 |
| 390 // Set up sync manager. | 390 // Set up sync manager. |
| 391 SyncManagerFactory sync_manager_factory; | 391 SyncManagerFactory sync_manager_factory; |
| 392 std::unique_ptr<SyncManager> sync_manager = | 392 std::unique_ptr<SyncManager> sync_manager = |
| 393 sync_manager_factory.CreateSyncManager("sync_client manager"); | 393 sync_manager_factory.CreateSyncManager("sync_client manager"); |
| 394 LoggingJsEventHandler js_event_handler; | 394 LoggingJsEventHandler js_event_handler; |
| 395 // Used only by InitialProcessMetadata(), so it's okay to leave this as NULL. | 395 // Used only by InitialProcessMetadata(), so it's okay to leave this as null. |
| 396 const scoped_refptr<base::TaskRunner> blocking_task_runner = NULL; | 396 const scoped_refptr<base::TaskRunner> blocking_task_runner = nullptr; |
| 397 const char kUserAgent[] = "sync_client"; | 397 const char kUserAgent[] = "sync_client"; |
| 398 // TODO(akalin): Replace this with just the context getter once | 398 // TODO(akalin): Replace this with just the context getter once |
| 399 // HttpPostProviderFactory is removed. | 399 // HttpPostProviderFactory is removed. |
| 400 CancelationSignal factory_cancelation_signal; | 400 CancelationSignal factory_cancelation_signal; |
| 401 std::unique_ptr<HttpPostProviderFactory> post_factory(new HttpBridgeFactory( | 401 std::unique_ptr<HttpPostProviderFactory> post_factory(new HttpBridgeFactory( |
| 402 context_getter.get(), base::Bind(&StubNetworkTimeUpdateCallback), | 402 context_getter.get(), base::Bind(&StubNetworkTimeUpdateCallback), |
| 403 &factory_cancelation_signal)); | 403 &factory_cancelation_signal)); |
| 404 post_factory->Init(kUserAgent, BindToTrackerCallback()); | 404 post_factory->Init(kUserAgent, BindToTrackerCallback()); |
| 405 // Used only when committing bookmarks, so it's okay to leave this | 405 // Used only when committing bookmarks, so it's okay to leave this as null. |
| 406 // as NULL. | 406 ExtensionsActivity* extensions_activity = nullptr; |
| 407 ExtensionsActivity* extensions_activity = NULL; | |
| 408 LoggingChangeDelegate change_delegate; | 407 LoggingChangeDelegate change_delegate; |
| 409 const char kRestoredKeyForBootstrapping[] = ""; | 408 const char kRestoredKeyForBootstrapping[] = ""; |
| 410 const char kRestoredKeystoreKeyForBootstrapping[] = ""; | 409 const char kRestoredKeystoreKeyForBootstrapping[] = ""; |
| 411 NullEncryptor null_encryptor; | 410 NullEncryptor null_encryptor; |
| 412 EngineComponentsFactoryImpl::Switches factory_switches = { | 411 EngineComponentsFactoryImpl::Switches factory_switches = { |
| 413 EngineComponentsFactory::ENCRYPTION_KEYSTORE, | 412 EngineComponentsFactory::ENCRYPTION_KEYSTORE, |
| 414 EngineComponentsFactory::BACKOFF_NORMAL}; | 413 EngineComponentsFactory::BACKOFF_NORMAL}; |
| 415 CancelationSignal scm_cancelation_signal; | 414 CancelationSignal scm_cancelation_signal; |
| 416 | 415 |
| 417 SyncManager::InitArgs args; | 416 SyncManager::InitArgs args; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 io_thread.Stop(); | 449 io_thread.Stop(); |
| 451 return 0; | 450 return 0; |
| 452 } | 451 } |
| 453 | 452 |
| 454 } // namespace | 453 } // namespace |
| 455 } // namespace syncer | 454 } // namespace syncer |
| 456 | 455 |
| 457 int main(int argc, char* argv[]) { | 456 int main(int argc, char* argv[]) { |
| 458 return syncer::SyncClientMain(argc, argv); | 457 return syncer::SyncClientMain(argc, argv); |
| 459 } | 458 } |
| OLD | NEW |