| 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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 cert_transparency_verifier_.reset(new net::MultiLogCTVerifier()); | 402 cert_transparency_verifier_.reset(new net::MultiLogCTVerifier()); |
| 403 ct_policy_enforcer_.reset(new net::CTPolicyEnforcer()); | 403 ct_policy_enforcer_.reset(new net::CTPolicyEnforcer()); |
| 404 http_auth_handler_factory_ = net::HttpAuthHandlerRegistryFactory::Create( | 404 http_auth_handler_factory_ = net::HttpAuthHandlerRegistryFactory::Create( |
| 405 &http_auth_preferences_, host_resolver_.get()); | 405 &http_auth_preferences_, host_resolver_.get()); |
| 406 http_server_properties_.reset(new net::HttpServerPropertiesImpl()); | 406 http_server_properties_.reset(new net::HttpServerPropertiesImpl()); |
| 407 proxy_service_ = net::ProxyService::CreateDirectWithNetLog(&net_log_); | 407 proxy_service_ = net::ProxyService::CreateDirectWithNetLog(&net_log_); |
| 408 } | 408 } |
| 409 | 409 |
| 410 void MCSProbe::BuildNetworkSession() { | 410 void MCSProbe::BuildNetworkSession() { |
| 411 net::HttpNetworkSession::Params session_params; | 411 net::HttpNetworkSession::Params session_params; |
| 412 session_params.host_resolver = host_resolver_.get(); | |
| 413 session_params.cert_verifier = cert_verifier_.get(); | |
| 414 session_params.channel_id_service = system_channel_id_service_.get(); | |
| 415 session_params.transport_security_state = transport_security_state_.get(); | |
| 416 session_params.cert_transparency_verifier = cert_transparency_verifier_.get(); | |
| 417 session_params.ct_policy_enforcer = ct_policy_enforcer_.get(); | |
| 418 session_params.ssl_config_service = new net::SSLConfigServiceDefaults(); | |
| 419 session_params.http_auth_handler_factory = http_auth_handler_factory_.get(); | |
| 420 session_params.http_server_properties = http_server_properties_.get(); | |
| 421 session_params.ignore_certificate_errors = true; | 412 session_params.ignore_certificate_errors = true; |
| 422 session_params.testing_fixed_http_port = 0; | 413 session_params.testing_fixed_http_port = 0; |
| 423 session_params.testing_fixed_https_port = 0; | 414 session_params.testing_fixed_https_port = 0; |
| 424 session_params.net_log = &net_log_; | |
| 425 session_params.proxy_service = proxy_service_.get(); | |
| 426 | 415 |
| 427 network_session_.reset(new net::HttpNetworkSession(session_params)); | 416 net::HttpNetworkSession::Context session_context; |
| 417 session_context.host_resolver = host_resolver_.get(); |
| 418 session_context.cert_verifier = cert_verifier_.get(); |
| 419 session_context.channel_id_service = system_channel_id_service_.get(); |
| 420 session_context.transport_security_state = transport_security_state_.get(); |
| 421 session_context.cert_transparency_verifier = |
| 422 cert_transparency_verifier_.get(); |
| 423 session_context.ct_policy_enforcer = ct_policy_enforcer_.get(); |
| 424 session_context.ssl_config_service = new net::SSLConfigServiceDefaults(); |
| 425 session_context.http_auth_handler_factory = http_auth_handler_factory_.get(); |
| 426 session_context.http_server_properties = http_server_properties_.get(); |
| 427 session_context.net_log = &net_log_; |
| 428 session_context.proxy_service = proxy_service_.get(); |
| 429 |
| 430 network_session_.reset( |
| 431 new net::HttpNetworkSession(session_params, session_context)); |
| 428 } | 432 } |
| 429 | 433 |
| 430 void MCSProbe::ErrorCallback() { | 434 void MCSProbe::ErrorCallback() { |
| 431 LOG(INFO) << "MCS error happened"; | 435 LOG(INFO) << "MCS error happened"; |
| 432 } | 436 } |
| 433 | 437 |
| 434 void MCSProbe::CheckIn() { | 438 void MCSProbe::CheckIn() { |
| 435 LOG(INFO) << "Check-in request initiated."; | 439 LOG(INFO) << "Check-in request initiated."; |
| 436 checkin_proto::ChromeBuildProto chrome_build_proto; | 440 checkin_proto::ChromeBuildProto chrome_build_proto; |
| 437 chrome_build_proto.set_platform( | 441 chrome_build_proto.set_platform( |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 | 516 |
| 513 return 0; | 517 return 0; |
| 514 } | 518 } |
| 515 | 519 |
| 516 } // namespace | 520 } // namespace |
| 517 } // namespace gcm | 521 } // namespace gcm |
| 518 | 522 |
| 519 int main(int argc, char* argv[]) { | 523 int main(int argc, char* argv[]) { |
| 520 return gcm::MCSProbeMain(argc, argv); | 524 return gcm::MCSProbeMain(argc, argv); |
| 521 } | 525 } |
| OLD | NEW |