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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 connection_factory_.reset( | 299 connection_factory_.reset( |
300 new ConnectionFactoryImpl(GURL("https://" + net::HostPortPair( | 300 new ConnectionFactoryImpl(GURL("https://" + net::HostPortPair( |
301 server_host_, server_port_).ToString()), | 301 server_host_, server_port_).ToString()), |
302 kDefaultBackoffPolicy, | 302 kDefaultBackoffPolicy, |
303 network_session_, | 303 network_session_, |
304 &net_log_)); | 304 &net_log_)); |
305 gcm_store_.reset( | 305 gcm_store_.reset( |
306 new GCMStoreImpl(true, | 306 new GCMStoreImpl(true, |
307 gcm_store_path_, | 307 gcm_store_path_, |
308 file_thread_.message_loop_proxy())); | 308 file_thread_.message_loop_proxy())); |
309 mcs_client_.reset(new MCSClient(&clock_, | 309 mcs_client_.reset(new MCSClient("probe", |
| 310 &clock_, |
310 connection_factory_.get(), | 311 connection_factory_.get(), |
311 gcm_store_.get())); | 312 gcm_store_.get())); |
312 run_loop_.reset(new base::RunLoop()); | 313 run_loop_.reset(new base::RunLoop()); |
313 gcm_store_->Load(base::Bind(&MCSProbe::LoadCallback, | 314 gcm_store_->Load(base::Bind(&MCSProbe::LoadCallback, |
314 base::Unretained(this))); | 315 base::Unretained(this))); |
315 run_loop_->Run(); | 316 run_loop_->Run(); |
316 } | 317 } |
317 | 318 |
318 void MCSProbe::LoadCallback(scoped_ptr<GCMStore::LoadResult> load_result) { | 319 void MCSProbe::LoadCallback(scoped_ptr<GCMStore::LoadResult> load_result) { |
319 DCHECK(load_result->success); | 320 DCHECK(load_result->success); |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 | 488 |
488 return 0; | 489 return 0; |
489 } | 490 } |
490 | 491 |
491 } // namespace | 492 } // namespace |
492 } // namespace gcm | 493 } // namespace gcm |
493 | 494 |
494 int main(int argc, char* argv[]) { | 495 int main(int argc, char* argv[]) { |
495 return gcm::MCSProbeMain(argc, argv); | 496 return gcm::MCSProbeMain(argc, argv); |
496 } | 497 } |
OLD | NEW |