OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/io_thread.h" | 5 #include "chrome/browser/io_thread.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 SystemRequestContextLeakChecker::~SystemRequestContextLeakChecker() { | 434 SystemRequestContextLeakChecker::~SystemRequestContextLeakChecker() { |
435 if (globals_->system_request_context.get()) | 435 if (globals_->system_request_context.get()) |
436 globals_->system_request_context->AssertNoURLRequests(); | 436 globals_->system_request_context->AssertNoURLRequests(); |
437 } | 437 } |
438 | 438 |
439 IOThread::Globals::Globals() | 439 IOThread::Globals::Globals() |
440 : system_request_context_leak_checker(this), | 440 : system_request_context_leak_checker(this), |
441 ignore_certificate_errors(false), | 441 ignore_certificate_errors(false), |
442 testing_fixed_http_port(0), | 442 testing_fixed_http_port(0), |
443 testing_fixed_https_port(0), | 443 testing_fixed_https_port(0), |
444 enable_user_alternate_protocol_ports(false) { | 444 enable_user_alternate_protocol_ports(false), |
445 } | 445 enable_token_binding(false) {} |
446 | 446 |
447 IOThread::Globals::~Globals() {} | 447 IOThread::Globals::~Globals() {} |
448 | 448 |
449 // |local_state| is passed in explicitly in order to (1) reduce implicit | 449 // |local_state| is passed in explicitly in order to (1) reduce implicit |
450 // dependencies and (2) make IOThread more flexible for testing. | 450 // dependencies and (2) make IOThread more flexible for testing. |
451 IOThread::IOThread( | 451 IOThread::IOThread( |
452 PrefService* local_state, | 452 PrefService* local_state, |
453 policy::PolicyService* policy_service, | 453 policy::PolicyService* policy_service, |
454 net_log::ChromeNetLog* net_log, | 454 net_log::ChromeNetLog* net_log, |
455 extensions::EventRouterForwarder* extension_event_router_forwarder) | 455 extensions::EventRouterForwarder* extension_event_router_forwarder) |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 | 795 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 |
796 // is fixed. | 796 // is fixed. |
797 tracked_objects::ScopedTracker tracking_profile12_5( | 797 tracked_objects::ScopedTracker tracking_profile12_5( |
798 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 798 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
799 "466432 IOThread::InitAsync::QuicConfiguration")); | 799 "466432 IOThread::InitAsync::QuicConfiguration")); |
800 ConfigureQuic(command_line); | 800 ConfigureQuic(command_line); |
801 if (command_line.HasSwitch( | 801 if (command_line.HasSwitch( |
802 switches::kEnableUserAlternateProtocolPorts)) { | 802 switches::kEnableUserAlternateProtocolPorts)) { |
803 globals_->enable_user_alternate_protocol_ports = true; | 803 globals_->enable_user_alternate_protocol_ports = true; |
804 } | 804 } |
| 805 if (command_line.HasSwitch(switches::kEnableTokenBinding)) { |
| 806 globals_->enable_token_binding = true; |
| 807 } |
805 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 | 808 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 |
806 // is fixed. | 809 // is fixed. |
807 tracked_objects::ScopedTracker tracking_profile13( | 810 tracked_objects::ScopedTracker tracking_profile13( |
808 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 811 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
809 "466432 IOThread::InitAsync::InitializeNetworkOptions")); | 812 "466432 IOThread::InitAsync::InitializeNetworkOptions")); |
810 InitializeNetworkOptions(command_line); | 813 InitializeNetworkOptions(command_line); |
811 | 814 |
812 TRACE_EVENT_BEGIN0("startup", | 815 TRACE_EVENT_BEGIN0("startup", |
813 "IOThread::Init:ProxyScriptFetcherRequestContext"); | 816 "IOThread::Init:ProxyScriptFetcherRequestContext"); |
814 globals_->proxy_script_fetcher_context.reset( | 817 globals_->proxy_script_fetcher_context.reset( |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 globals.quic_supported_versions.CopyToIfSet( | 1108 globals.quic_supported_versions.CopyToIfSet( |
1106 ¶ms->quic_supported_versions); | 1109 ¶ms->quic_supported_versions); |
1107 params->quic_connection_options = globals.quic_connection_options; | 1110 params->quic_connection_options = globals.quic_connection_options; |
1108 globals.quic_close_sessions_on_ip_change.CopyToIfSet( | 1111 globals.quic_close_sessions_on_ip_change.CopyToIfSet( |
1109 ¶ms->quic_close_sessions_on_ip_change); | 1112 ¶ms->quic_close_sessions_on_ip_change); |
1110 | 1113 |
1111 globals.origin_to_force_quic_on.CopyToIfSet( | 1114 globals.origin_to_force_quic_on.CopyToIfSet( |
1112 ¶ms->origin_to_force_quic_on); | 1115 ¶ms->origin_to_force_quic_on); |
1113 params->enable_user_alternate_protocol_ports = | 1116 params->enable_user_alternate_protocol_ports = |
1114 globals.enable_user_alternate_protocol_ports; | 1117 globals.enable_user_alternate_protocol_ports; |
| 1118 params->enable_token_binding = globals.enable_token_binding; |
1115 } | 1119 } |
1116 | 1120 |
1117 base::TimeTicks IOThread::creation_time() const { | 1121 base::TimeTicks IOThread::creation_time() const { |
1118 return creation_time_; | 1122 return creation_time_; |
1119 } | 1123 } |
1120 | 1124 |
1121 data_usage::DataUseAggregator* IOThread::data_use_aggregator() const { | 1125 data_usage::DataUseAggregator* IOThread::data_use_aggregator() const { |
1122 return data_use_aggregator_.get(); | 1126 return data_use_aggregator_.get(); |
1123 } | 1127 } |
1124 | 1128 |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1654 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); | 1658 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); |
1655 | 1659 |
1656 context->set_job_factory( | 1660 context->set_job_factory( |
1657 globals->proxy_script_fetcher_url_request_job_factory.get()); | 1661 globals->proxy_script_fetcher_url_request_job_factory.get()); |
1658 | 1662 |
1659 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1663 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
1660 // system URLRequestContext too. There's no reason this should be tied to a | 1664 // system URLRequestContext too. There's no reason this should be tied to a |
1661 // profile. | 1665 // profile. |
1662 return context; | 1666 return context; |
1663 } | 1667 } |
OLD | NEW |