| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <cstddef> | 10 #include <cstddef> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "build/build_config.h" | 31 #include "build/build_config.h" |
| 32 #include "google_apis/gcm/base/fake_encryptor.h" | 32 #include "google_apis/gcm/base/fake_encryptor.h" |
| 33 #include "google_apis/gcm/base/mcs_message.h" | 33 #include "google_apis/gcm/base/mcs_message.h" |
| 34 #include "google_apis/gcm/base/mcs_util.h" | 34 #include "google_apis/gcm/base/mcs_util.h" |
| 35 #include "google_apis/gcm/engine/checkin_request.h" | 35 #include "google_apis/gcm/engine/checkin_request.h" |
| 36 #include "google_apis/gcm/engine/connection_factory_impl.h" | 36 #include "google_apis/gcm/engine/connection_factory_impl.h" |
| 37 #include "google_apis/gcm/engine/gcm_store_impl.h" | 37 #include "google_apis/gcm/engine/gcm_store_impl.h" |
| 38 #include "google_apis/gcm/engine/gservices_settings.h" | 38 #include "google_apis/gcm/engine/gservices_settings.h" |
| 39 #include "google_apis/gcm/engine/mcs_client.h" | 39 #include "google_apis/gcm/engine/mcs_client.h" |
| 40 #include "google_apis/gcm/monitoring/fake_gcm_stats_recorder.h" | 40 #include "google_apis/gcm/monitoring/fake_gcm_stats_recorder.h" |
| 41 #include "net/base/host_mapping_rules.h" | |
| 42 #include "net/cert/cert_verifier.h" | 41 #include "net/cert/cert_verifier.h" |
| 43 #include "net/cert/ct_policy_enforcer.h" | 42 #include "net/cert/ct_policy_enforcer.h" |
| 44 #include "net/cert/multi_log_ct_verifier.h" | 43 #include "net/cert/multi_log_ct_verifier.h" |
| 45 #include "net/dns/host_resolver.h" | 44 #include "net/dns/host_resolver.h" |
| 46 #include "net/http/http_auth_handler_factory.h" | 45 #include "net/http/http_auth_handler_factory.h" |
| 47 #include "net/http/http_auth_preferences.h" | 46 #include "net/http/http_auth_preferences.h" |
| 48 #include "net/http/http_auth_scheme.h" | 47 #include "net/http/http_auth_scheme.h" |
| 49 #include "net/http/http_network_session.h" | 48 #include "net/http/http_network_session.h" |
| 50 #include "net/http/http_server_properties_impl.h" | 49 #include "net/http/http_server_properties_impl.h" |
| 51 #include "net/http/transport_security_state.h" | 50 #include "net/http/transport_security_state.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 std::unique_ptr<net::WriteToFileNetLogObserver> logger_; | 249 std::unique_ptr<net::WriteToFileNetLogObserver> logger_; |
| 251 std::unique_ptr<net::HostResolver> host_resolver_; | 250 std::unique_ptr<net::HostResolver> host_resolver_; |
| 252 std::unique_ptr<net::CertVerifier> cert_verifier_; | 251 std::unique_ptr<net::CertVerifier> cert_verifier_; |
| 253 std::unique_ptr<net::ChannelIDService> system_channel_id_service_; | 252 std::unique_ptr<net::ChannelIDService> system_channel_id_service_; |
| 254 std::unique_ptr<net::TransportSecurityState> transport_security_state_; | 253 std::unique_ptr<net::TransportSecurityState> transport_security_state_; |
| 255 std::unique_ptr<net::CTVerifier> cert_transparency_verifier_; | 254 std::unique_ptr<net::CTVerifier> cert_transparency_verifier_; |
| 256 std::unique_ptr<net::CTPolicyEnforcer> ct_policy_enforcer_; | 255 std::unique_ptr<net::CTPolicyEnforcer> ct_policy_enforcer_; |
| 257 MCSProbeAuthPreferences http_auth_preferences_; | 256 MCSProbeAuthPreferences http_auth_preferences_; |
| 258 std::unique_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory_; | 257 std::unique_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory_; |
| 259 std::unique_ptr<net::HttpServerPropertiesImpl> http_server_properties_; | 258 std::unique_ptr<net::HttpServerPropertiesImpl> http_server_properties_; |
| 260 std::unique_ptr<net::HostMappingRules> host_mapping_rules_; | |
| 261 std::unique_ptr<net::HttpNetworkSession> network_session_; | 259 std::unique_ptr<net::HttpNetworkSession> network_session_; |
| 262 std::unique_ptr<net::ProxyService> proxy_service_; | 260 std::unique_ptr<net::ProxyService> proxy_service_; |
| 263 | 261 |
| 264 FakeGCMStatsRecorder recorder_; | 262 FakeGCMStatsRecorder recorder_; |
| 265 std::unique_ptr<GCMStore> gcm_store_; | 263 std::unique_ptr<GCMStore> gcm_store_; |
| 266 std::unique_ptr<MCSClient> mcs_client_; | 264 std::unique_ptr<MCSClient> mcs_client_; |
| 267 std::unique_ptr<CheckinRequest> checkin_request_; | 265 std::unique_ptr<CheckinRequest> checkin_request_; |
| 268 | 266 |
| 269 std::unique_ptr<ConnectionFactoryImpl> connection_factory_; | 267 std::unique_ptr<ConnectionFactoryImpl> connection_factory_; |
| 270 | 268 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 } | 397 } |
| 400 system_channel_id_service_.reset( | 398 system_channel_id_service_.reset( |
| 401 new net::ChannelIDService(new net::DefaultChannelIDStore(NULL))); | 399 new net::ChannelIDService(new net::DefaultChannelIDStore(NULL))); |
| 402 | 400 |
| 403 transport_security_state_.reset(new net::TransportSecurityState()); | 401 transport_security_state_.reset(new net::TransportSecurityState()); |
| 404 cert_transparency_verifier_.reset(new net::MultiLogCTVerifier()); | 402 cert_transparency_verifier_.reset(new net::MultiLogCTVerifier()); |
| 405 ct_policy_enforcer_.reset(new net::CTPolicyEnforcer()); | 403 ct_policy_enforcer_.reset(new net::CTPolicyEnforcer()); |
| 406 http_auth_handler_factory_ = net::HttpAuthHandlerRegistryFactory::Create( | 404 http_auth_handler_factory_ = net::HttpAuthHandlerRegistryFactory::Create( |
| 407 &http_auth_preferences_, host_resolver_.get()); | 405 &http_auth_preferences_, host_resolver_.get()); |
| 408 http_server_properties_.reset(new net::HttpServerPropertiesImpl()); | 406 http_server_properties_.reset(new net::HttpServerPropertiesImpl()); |
| 409 host_mapping_rules_.reset(new net::HostMappingRules()); | |
| 410 proxy_service_ = net::ProxyService::CreateDirectWithNetLog(&net_log_); | 407 proxy_service_ = net::ProxyService::CreateDirectWithNetLog(&net_log_); |
| 411 } | 408 } |
| 412 | 409 |
| 413 void MCSProbe::BuildNetworkSession() { | 410 void MCSProbe::BuildNetworkSession() { |
| 414 net::HttpNetworkSession::Params session_params; | 411 net::HttpNetworkSession::Params session_params; |
| 415 session_params.host_resolver = host_resolver_.get(); | 412 session_params.host_resolver = host_resolver_.get(); |
| 416 session_params.cert_verifier = cert_verifier_.get(); | 413 session_params.cert_verifier = cert_verifier_.get(); |
| 417 session_params.channel_id_service = system_channel_id_service_.get(); | 414 session_params.channel_id_service = system_channel_id_service_.get(); |
| 418 session_params.transport_security_state = transport_security_state_.get(); | 415 session_params.transport_security_state = transport_security_state_.get(); |
| 419 session_params.cert_transparency_verifier = cert_transparency_verifier_.get(); | 416 session_params.cert_transparency_verifier = cert_transparency_verifier_.get(); |
| 420 session_params.ct_policy_enforcer = ct_policy_enforcer_.get(); | 417 session_params.ct_policy_enforcer = ct_policy_enforcer_.get(); |
| 421 session_params.ssl_config_service = new net::SSLConfigServiceDefaults(); | 418 session_params.ssl_config_service = new net::SSLConfigServiceDefaults(); |
| 422 session_params.http_auth_handler_factory = http_auth_handler_factory_.get(); | 419 session_params.http_auth_handler_factory = http_auth_handler_factory_.get(); |
| 423 session_params.http_server_properties = http_server_properties_.get(); | 420 session_params.http_server_properties = http_server_properties_.get(); |
| 424 session_params.host_mapping_rules = host_mapping_rules_.get(); | |
| 425 session_params.ignore_certificate_errors = true; | 421 session_params.ignore_certificate_errors = true; |
| 426 session_params.testing_fixed_http_port = 0; | 422 session_params.testing_fixed_http_port = 0; |
| 427 session_params.testing_fixed_https_port = 0; | 423 session_params.testing_fixed_https_port = 0; |
| 428 session_params.net_log = &net_log_; | 424 session_params.net_log = &net_log_; |
| 429 session_params.proxy_service = proxy_service_.get(); | 425 session_params.proxy_service = proxy_service_.get(); |
| 430 | 426 |
| 431 network_session_.reset(new net::HttpNetworkSession(session_params)); | 427 network_session_.reset(new net::HttpNetworkSession(session_params)); |
| 432 } | 428 } |
| 433 | 429 |
| 434 void MCSProbe::ErrorCallback() { | 430 void MCSProbe::ErrorCallback() { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 | 512 |
| 517 return 0; | 513 return 0; |
| 518 } | 514 } |
| 519 | 515 |
| 520 } // namespace | 516 } // namespace |
| 521 } // namespace gcm | 517 } // namespace gcm |
| 522 | 518 |
| 523 int main(int argc, char* argv[]) { | 519 int main(int argc, char* argv[]) { |
| 524 return gcm::MCSProbeMain(argc, argv); | 520 return gcm::MCSProbeMain(argc, argv); |
| 525 } | 521 } |
| OLD | NEW |