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 22 matching lines...) Expand all Loading... |
33 #include "google_apis/gcm/engine/gservices_settings.h" | 33 #include "google_apis/gcm/engine/gservices_settings.h" |
34 #include "google_apis/gcm/engine/mcs_client.h" | 34 #include "google_apis/gcm/engine/mcs_client.h" |
35 #include "google_apis/gcm/monitoring/fake_gcm_stats_recorder.h" | 35 #include "google_apis/gcm/monitoring/fake_gcm_stats_recorder.h" |
36 #include "net/base/host_mapping_rules.h" | 36 #include "net/base/host_mapping_rules.h" |
37 #include "net/cert/cert_verifier.h" | 37 #include "net/cert/cert_verifier.h" |
38 #include "net/dns/host_resolver.h" | 38 #include "net/dns/host_resolver.h" |
39 #include "net/http/http_auth_handler_factory.h" | 39 #include "net/http/http_auth_handler_factory.h" |
40 #include "net/http/http_network_session.h" | 40 #include "net/http/http_network_session.h" |
41 #include "net/http/http_server_properties_impl.h" | 41 #include "net/http/http_server_properties_impl.h" |
42 #include "net/http/transport_security_state.h" | 42 #include "net/http/transport_security_state.h" |
43 #include "net/log/net_log_logger.h" | 43 #include "net/log/write_to_file_net_log_observer.h" |
44 #include "net/socket/client_socket_factory.h" | 44 #include "net/socket/client_socket_factory.h" |
45 #include "net/socket/ssl_client_socket.h" | 45 #include "net/socket/ssl_client_socket.h" |
46 #include "net/ssl/channel_id_service.h" | 46 #include "net/ssl/channel_id_service.h" |
47 #include "net/ssl/default_channel_id_store.h" | 47 #include "net/ssl/default_channel_id_store.h" |
48 #include "net/url_request/url_request_test_util.h" | 48 #include "net/url_request/url_request_test_util.h" |
49 | 49 |
50 #if defined(OS_MACOSX) | 50 #if defined(OS_MACOSX) |
51 #include "base/mac/scoped_nsautorelease_pool.h" | 51 #include "base/mac/scoped_nsautorelease_pool.h" |
52 #endif | 52 #endif |
53 | 53 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 215 |
216 base::FilePath gcm_store_path_; | 216 base::FilePath gcm_store_path_; |
217 uint64 android_id_; | 217 uint64 android_id_; |
218 uint64 secret_; | 218 uint64 secret_; |
219 std::string server_host_; | 219 std::string server_host_; |
220 int server_port_; | 220 int server_port_; |
221 | 221 |
222 // Network state. | 222 // Network state. |
223 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; | 223 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; |
224 net::NetLog net_log_; | 224 net::NetLog net_log_; |
225 scoped_ptr<net::NetLogLogger> logger_; | 225 scoped_ptr<net::WriteToFileNetLogObserver> logger_; |
226 scoped_ptr<net::HostResolver> host_resolver_; | 226 scoped_ptr<net::HostResolver> host_resolver_; |
227 scoped_ptr<net::CertVerifier> cert_verifier_; | 227 scoped_ptr<net::CertVerifier> cert_verifier_; |
228 scoped_ptr<net::ChannelIDService> system_channel_id_service_; | 228 scoped_ptr<net::ChannelIDService> system_channel_id_service_; |
229 scoped_ptr<net::TransportSecurityState> transport_security_state_; | 229 scoped_ptr<net::TransportSecurityState> transport_security_state_; |
230 scoped_ptr<net::URLSecurityManager> url_security_manager_; | 230 scoped_ptr<net::URLSecurityManager> url_security_manager_; |
231 scoped_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory_; | 231 scoped_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory_; |
232 scoped_ptr<net::HttpServerPropertiesImpl> http_server_properties_; | 232 scoped_ptr<net::HttpServerPropertiesImpl> http_server_properties_; |
233 scoped_ptr<net::HostMappingRules> host_mapping_rules_; | 233 scoped_ptr<net::HostMappingRules> host_mapping_rules_; |
234 scoped_refptr<net::HttpNetworkSession> network_session_; | 234 scoped_refptr<net::HttpNetworkSession> network_session_; |
235 scoped_ptr<net::ProxyService> proxy_service_; | 235 scoped_ptr<net::ProxyService> proxy_service_; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 base::ScopedFILE log_file; | 351 base::ScopedFILE log_file; |
352 if (command_line_.HasSwitch(kLogFileSwitch)) { | 352 if (command_line_.HasSwitch(kLogFileSwitch)) { |
353 base::FilePath log_path = command_line_.GetSwitchValuePath(kLogFileSwitch); | 353 base::FilePath log_path = command_line_.GetSwitchValuePath(kLogFileSwitch); |
354 #if defined(OS_WIN) | 354 #if defined(OS_WIN) |
355 log_file.reset(_wfopen(log_path.value().c_str(), L"w")); | 355 log_file.reset(_wfopen(log_path.value().c_str(), L"w")); |
356 #elif defined(OS_POSIX) | 356 #elif defined(OS_POSIX) |
357 log_file.reset(fopen(log_path.value().c_str(), "w")); | 357 log_file.reset(fopen(log_path.value().c_str(), "w")); |
358 #endif | 358 #endif |
359 } | 359 } |
360 if (log_file.get()) { | 360 if (log_file.get()) { |
361 logger_.reset(new net::NetLogLogger()); | 361 logger_.reset(new net::WriteToFileNetLogObserver()); |
362 logger_->set_log_level(net::NetLog::LOG_ALL_BUT_BYTES); | 362 logger_->set_log_level(net::NetLog::LOG_ALL_BUT_BYTES); |
363 logger_->StartObserving(&net_log_, log_file.Pass(), nullptr, nullptr); | 363 logger_->StartObserving(&net_log_, log_file.Pass(), nullptr, nullptr); |
364 } | 364 } |
365 | 365 |
366 host_resolver_ = net::HostResolver::CreateDefaultResolver(&net_log_); | 366 host_resolver_ = net::HostResolver::CreateDefaultResolver(&net_log_); |
367 | 367 |
368 if (command_line_.HasSwitch(kIgnoreCertSwitch)) { | 368 if (command_line_.HasSwitch(kIgnoreCertSwitch)) { |
369 cert_verifier_.reset(new MyTestCertVerifier()); | 369 cert_verifier_.reset(new MyTestCertVerifier()); |
370 } else { | 370 } else { |
371 cert_verifier_.reset(net::CertVerifier::CreateDefault()); | 371 cert_verifier_.reset(net::CertVerifier::CreateDefault()); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 | 495 |
496 return 0; | 496 return 0; |
497 } | 497 } |
498 | 498 |
499 } // namespace | 499 } // namespace |
500 } // namespace gcm | 500 } // namespace gcm |
501 | 501 |
502 int main(int argc, char* argv[]) { | 502 int main(int argc, char* argv[]) { |
503 return gcm::MCSProbeMain(argc, argv); | 503 return gcm::MCSProbeMain(argc, argv); |
504 } | 504 } |
OLD | NEW |