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 20 matching lines...) Expand all Loading... |
31 #include "google_apis/gcm/engine/checkin_request.h" | 31 #include "google_apis/gcm/engine/checkin_request.h" |
32 #include "google_apis/gcm/engine/connection_factory_impl.h" | 32 #include "google_apis/gcm/engine/connection_factory_impl.h" |
33 #include "google_apis/gcm/engine/gcm_store_impl.h" | 33 #include "google_apis/gcm/engine/gcm_store_impl.h" |
34 #include "google_apis/gcm/engine/gservices_settings.h" | 34 #include "google_apis/gcm/engine/gservices_settings.h" |
35 #include "google_apis/gcm/engine/mcs_client.h" | 35 #include "google_apis/gcm/engine/mcs_client.h" |
36 #include "google_apis/gcm/monitoring/fake_gcm_stats_recorder.h" | 36 #include "google_apis/gcm/monitoring/fake_gcm_stats_recorder.h" |
37 #include "net/base/host_mapping_rules.h" | 37 #include "net/base/host_mapping_rules.h" |
38 #include "net/cert/cert_verifier.h" | 38 #include "net/cert/cert_verifier.h" |
39 #include "net/dns/host_resolver.h" | 39 #include "net/dns/host_resolver.h" |
40 #include "net/http/http_auth_handler_factory.h" | 40 #include "net/http/http_auth_handler_factory.h" |
| 41 #include "net/http/http_auth_scheme.h" |
41 #include "net/http/http_network_session.h" | 42 #include "net/http/http_network_session.h" |
42 #include "net/http/http_server_properties_impl.h" | 43 #include "net/http/http_server_properties_impl.h" |
43 #include "net/http/transport_security_state.h" | 44 #include "net/http/transport_security_state.h" |
44 #include "net/log/write_to_file_net_log_observer.h" | 45 #include "net/log/write_to_file_net_log_observer.h" |
45 #include "net/socket/client_socket_factory.h" | 46 #include "net/socket/client_socket_factory.h" |
46 #include "net/socket/ssl_client_socket.h" | 47 #include "net/socket/ssl_client_socket.h" |
47 #include "net/ssl/channel_id_service.h" | 48 #include "net/ssl/channel_id_service.h" |
48 #include "net/ssl/default_channel_id_store.h" | 49 #include "net/ssl/default_channel_id_store.h" |
49 #include "net/url_request/url_request_test_util.h" | 50 #include "net/url_request/url_request_test_util.h" |
50 | 51 |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 cert_verifier_.reset(new MyTestCertVerifier()); | 370 cert_verifier_.reset(new MyTestCertVerifier()); |
370 } else { | 371 } else { |
371 cert_verifier_ = net::CertVerifier::CreateDefault(); | 372 cert_verifier_ = net::CertVerifier::CreateDefault(); |
372 } | 373 } |
373 system_channel_id_service_.reset( | 374 system_channel_id_service_.reset( |
374 new net::ChannelIDService( | 375 new net::ChannelIDService( |
375 new net::DefaultChannelIDStore(NULL), | 376 new net::DefaultChannelIDStore(NULL), |
376 base::WorkerPool::GetTaskRunner(true))); | 377 base::WorkerPool::GetTaskRunner(true))); |
377 | 378 |
378 transport_security_state_.reset(new net::TransportSecurityState()); | 379 transport_security_state_.reset(new net::TransportSecurityState()); |
379 url_security_manager_.reset(net::URLSecurityManager::Create(NULL, NULL)); | 380 url_security_manager_.reset(net::URLSecurityManager::Create()); |
380 http_auth_handler_factory_.reset(net::HttpAuthHandlerRegistryFactory::Create( | 381 http_auth_handler_factory_.reset(net::HttpAuthHandlerRegistryFactory::Create( |
381 std::vector<std::string>(1, "basic"), url_security_manager_.get(), | 382 std::vector<std::string>(1, net::kBasicAuthScheme), |
382 host_resolver_.get(), std::string(), std::string(), false, false)); | 383 url_security_manager_.get(), host_resolver_.get(), std::string())); |
383 http_server_properties_.reset(new net::HttpServerPropertiesImpl()); | 384 http_server_properties_.reset(new net::HttpServerPropertiesImpl()); |
384 host_mapping_rules_.reset(new net::HostMappingRules()); | 385 host_mapping_rules_.reset(new net::HostMappingRules()); |
385 proxy_service_ = net::ProxyService::CreateDirectWithNetLog(&net_log_); | 386 proxy_service_ = net::ProxyService::CreateDirectWithNetLog(&net_log_); |
386 } | 387 } |
387 | 388 |
388 void MCSProbe::BuildNetworkSession() { | 389 void MCSProbe::BuildNetworkSession() { |
389 net::HttpNetworkSession::Params session_params; | 390 net::HttpNetworkSession::Params session_params; |
390 session_params.host_resolver = host_resolver_.get(); | 391 session_params.host_resolver = host_resolver_.get(); |
391 session_params.cert_verifier = cert_verifier_.get(); | 392 session_params.cert_verifier = cert_verifier_.get(); |
392 session_params.channel_id_service = system_channel_id_service_.get(); | 393 session_params.channel_id_service = system_channel_id_service_.get(); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 | 491 |
491 return 0; | 492 return 0; |
492 } | 493 } |
493 | 494 |
494 } // namespace | 495 } // namespace |
495 } // namespace gcm | 496 } // namespace gcm |
496 | 497 |
497 int main(int argc, char* argv[]) { | 498 int main(int argc, char* argv[]) { |
498 return gcm::MCSProbeMain(argc, argv); | 499 return gcm::MCSProbeMain(argc, argv); |
499 } | 500 } |
OLD | NEW |