| 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 } | 283 } |
| 284 | 284 |
| 285 MCSProbe::~MCSProbe() { | 285 MCSProbe::~MCSProbe() { |
| 286 file_thread_.Stop(); | 286 file_thread_.Stop(); |
| 287 } | 287 } |
| 288 | 288 |
| 289 void MCSProbe::Start() { | 289 void MCSProbe::Start() { |
| 290 file_thread_.Start(); | 290 file_thread_.Start(); |
| 291 InitializeNetworkState(); | 291 InitializeNetworkState(); |
| 292 BuildNetworkSession(); | 292 BuildNetworkSession(); |
| 293 std::vector<GURL> endpoints(1, |
| 294 GURL("https://" + |
| 295 net::HostPortPair(server_host_, |
| 296 server_port_).ToString())); |
| 293 connection_factory_.reset( | 297 connection_factory_.reset( |
| 294 new ConnectionFactoryImpl(GURL("https://" + net::HostPortPair( | 298 new ConnectionFactoryImpl(endpoints, |
| 295 server_host_, server_port_).ToString()), | |
| 296 kDefaultBackoffPolicy, | 299 kDefaultBackoffPolicy, |
| 297 network_session_, | 300 network_session_, |
| 298 &net_log_)); | 301 &net_log_)); |
| 299 gcm_store_.reset( | 302 gcm_store_.reset( |
| 300 new GCMStoreImpl(true, | 303 new GCMStoreImpl(true, |
| 301 gcm_store_path_, | 304 gcm_store_path_, |
| 302 file_thread_.message_loop_proxy())); | 305 file_thread_.message_loop_proxy())); |
| 303 mcs_client_.reset(new MCSClient("probe", | 306 mcs_client_.reset(new MCSClient("probe", |
| 304 &clock_, | 307 &clock_, |
| 305 connection_factory_.get(), | 308 connection_factory_.get(), |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 | 482 |
| 480 return 0; | 483 return 0; |
| 481 } | 484 } |
| 482 | 485 |
| 483 } // namespace | 486 } // namespace |
| 484 } // namespace gcm | 487 } // namespace gcm |
| 485 | 488 |
| 486 int main(int argc, char* argv[]) { | 489 int main(int argc, char* argv[]) { |
| 487 return gcm::MCSProbeMain(argc, argv); | 490 return gcm::MCSProbeMain(argc, argv); |
| 488 } | 491 } |
| OLD | NEW |