| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // A standalone tool for testing MCS connections and the MCS client on their | 5 // A standalone tool for testing MCS connections and the MCS client on their |
| 6 // own. | 6 // own. |
| 7 | 7 |
| 8 #include <cstddef> | 8 #include <cstddef> |
| 9 #include <cstdio> | 9 #include <cstdio> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 server_port_).ToString())); | 292 server_port_).ToString())); |
| 293 connection_factory_.reset( | 293 connection_factory_.reset( |
| 294 new ConnectionFactoryImpl(endpoints, | 294 new ConnectionFactoryImpl(endpoints, |
| 295 kDefaultBackoffPolicy, | 295 kDefaultBackoffPolicy, |
| 296 network_session_, | 296 network_session_, |
| 297 NULL, | 297 NULL, |
| 298 &net_log_, | 298 &net_log_, |
| 299 &recorder_)); | 299 &recorder_)); |
| 300 gcm_store_.reset( | 300 gcm_store_.reset( |
| 301 new GCMStoreImpl(gcm_store_path_, | 301 new GCMStoreImpl(gcm_store_path_, |
| 302 file_thread_.message_loop_proxy(), | 302 file_thread_.task_runner(), |
| 303 make_scoped_ptr<Encryptor>(new FakeEncryptor))); | 303 make_scoped_ptr<Encryptor>(new FakeEncryptor))); |
| 304 mcs_client_.reset(new MCSClient("probe", | 304 mcs_client_.reset(new MCSClient("probe", |
| 305 &clock_, | 305 &clock_, |
| 306 connection_factory_.get(), | 306 connection_factory_.get(), |
| 307 gcm_store_.get(), | 307 gcm_store_.get(), |
| 308 &recorder_)); | 308 &recorder_)); |
| 309 run_loop_.reset(new base::RunLoop()); | 309 run_loop_.reset(new base::RunLoop()); |
| 310 gcm_store_->Load(GCMStore::CREATE_IF_MISSING, | 310 gcm_store_->Load(GCMStore::CREATE_IF_MISSING, |
| 311 base::Bind(&MCSProbe::LoadCallback, | 311 base::Bind(&MCSProbe::LoadCallback, |
| 312 base::Unretained(this))); | 312 base::Unretained(this))); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 base::CommandLine::Init(argc, argv); | 475 base::CommandLine::Init(argc, argv); |
| 476 logging::LoggingSettings settings; | 476 logging::LoggingSettings settings; |
| 477 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 477 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
| 478 logging::InitLogging(settings); | 478 logging::InitLogging(settings); |
| 479 | 479 |
| 480 base::MessageLoopForIO message_loop; | 480 base::MessageLoopForIO message_loop; |
| 481 | 481 |
| 482 // For check-in and creating registration ids. | 482 // For check-in and creating registration ids. |
| 483 const scoped_refptr<MyTestURLRequestContextGetter> context_getter = | 483 const scoped_refptr<MyTestURLRequestContextGetter> context_getter = |
| 484 new MyTestURLRequestContextGetter( | 484 new MyTestURLRequestContextGetter( |
| 485 base::MessageLoop::current()->message_loop_proxy()); | 485 base::MessageLoop::current()->task_runner()); |
| 486 | 486 |
| 487 const base::CommandLine& command_line = | 487 const base::CommandLine& command_line = |
| 488 *base::CommandLine::ForCurrentProcess(); | 488 *base::CommandLine::ForCurrentProcess(); |
| 489 | 489 |
| 490 MCSProbe mcs_probe(command_line, context_getter); | 490 MCSProbe mcs_probe(command_line, context_getter); |
| 491 mcs_probe.Start(); | 491 mcs_probe.Start(); |
| 492 | 492 |
| 493 base::RunLoop run_loop; | 493 base::RunLoop run_loop; |
| 494 run_loop.Run(); | 494 run_loop.Run(); |
| 495 | 495 |
| 496 return 0; | 496 return 0; |
| 497 } | 497 } |
| 498 | 498 |
| 499 } // namespace | 499 } // namespace |
| 500 } // namespace gcm | 500 } // namespace gcm |
| 501 | 501 |
| 502 int main(int argc, char* argv[]) { | 502 int main(int argc, char* argv[]) { |
| 503 return gcm::MCSProbeMain(argc, argv); | 503 return gcm::MCSProbeMain(argc, argv); |
| 504 } | 504 } |
| OLD | NEW |