Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Side by Side Diff: chrome/browser/io_thread.cc

Issue 11415219: Move a number of static variables SPDY to HttpNetworkSession::Params. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix flip_in_mem_edsm_server Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/io_thread.h ('k') | chrome/browser/profiles/profile_io_data.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "net/base/host_resolver.h" 46 #include "net/base/host_resolver.h"
47 #include "net/base/mapped_host_resolver.h" 47 #include "net/base/mapped_host_resolver.h"
48 #include "net/base/net_util.h" 48 #include "net/base/net_util.h"
49 #include "net/base/sdch_manager.h" 49 #include "net/base/sdch_manager.h"
50 #include "net/base/server_bound_cert_service.h" 50 #include "net/base/server_bound_cert_service.h"
51 #include "net/cookies/cookie_monster.h" 51 #include "net/cookies/cookie_monster.h"
52 #include "net/ftp/ftp_network_layer.h" 52 #include "net/ftp/ftp_network_layer.h"
53 #include "net/http/http_auth_filter.h" 53 #include "net/http/http_auth_filter.h"
54 #include "net/http/http_auth_handler_factory.h" 54 #include "net/http/http_auth_handler_factory.h"
55 #include "net/http/http_network_layer.h" 55 #include "net/http/http_network_layer.h"
56 #include "net/http/http_network_session.h"
57 #include "net/http/http_server_properties_impl.h" 56 #include "net/http/http_server_properties_impl.h"
58 #include "net/proxy/proxy_config_service.h" 57 #include "net/proxy/proxy_config_service.h"
59 #include "net/proxy/proxy_script_fetcher_impl.h" 58 #include "net/proxy/proxy_script_fetcher_impl.h"
60 #include "net/proxy/proxy_service.h" 59 #include "net/proxy/proxy_service.h"
61 #include "net/spdy/spdy_session.h" 60 #include "net/spdy/spdy_session.h"
62 #include "net/url_request/url_fetcher.h" 61 #include "net/url_request/url_fetcher.h"
63 #include "net/url_request/url_request_throttler_manager.h" 62 #include "net/url_request/url_request_throttler_manager.h"
64 #include "net/websockets/websocket_job.h" 63 #include "net/websockets/websocket_job.h"
65 64
66 #if defined(ENABLE_CONFIGURATION_POLICY) 65 #if defined(ENABLE_CONFIGURATION_POLICY)
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 context->set_cookie_store(globals->system_cookie_store.get()); 214 context->set_cookie_store(globals->system_cookie_store.get());
216 context->set_server_bound_cert_service( 215 context->set_server_bound_cert_service(
217 globals->system_server_bound_cert_service.get()); 216 globals->system_server_bound_cert_service.get());
218 context->set_throttler_manager(globals->throttler_manager.get()); 217 context->set_throttler_manager(globals->throttler_manager.get());
219 context->set_network_delegate(globals->system_network_delegate.get()); 218 context->set_network_delegate(globals->system_network_delegate.get());
220 context->set_http_user_agent_settings( 219 context->set_http_user_agent_settings(
221 globals->http_user_agent_settings.get()); 220 globals->http_user_agent_settings.get());
222 return context; 221 return context;
223 } 222 }
224 223
225 void InitializeNetworkSessionParams( 224 int GetSwitchValueAsInt(const CommandLine& command_line,
226 const IOThread::Globals& globals, 225 const std::string& switch_name) {
227 net::HttpNetworkSession::Params* params) { 226 int value;
228 params->host_resolver = globals.host_resolver.get(); 227 if (!base::StringToInt(command_line.GetSwitchValueASCII(switch_name),
229 params->cert_verifier = globals.cert_verifier.get(); 228 &value)) {
230 params->server_bound_cert_service = 229 return 0;
231 globals.system_server_bound_cert_service.get(); 230 }
232 params->transport_security_state = globals.transport_security_state.get(); 231 return value;
233 params->ssl_config_service = globals.ssl_config_service.get();
234 params->http_auth_handler_factory = globals.http_auth_handler_factory.get();
235 params->http_server_properties = globals.http_server_properties.get();
236 params->network_delegate = globals.system_network_delegate.get();
237 params->host_mapping_rules = globals.host_mapping_rules.get();
238 params->ignore_certificate_errors = globals.ignore_certificate_errors;
239 params->http_pipelining_enabled = globals.http_pipelining_enabled;
240 params->testing_fixed_http_port = globals.testing_fixed_http_port;
241 params->testing_fixed_https_port = globals.testing_fixed_https_port;
242 } 232 }
243 233
244 } // namespace 234 } // namespace
245 235
246 class IOThread::LoggingNetworkChangeObserver 236 class IOThread::LoggingNetworkChangeObserver
247 : public net::NetworkChangeNotifier::IPAddressObserver, 237 : public net::NetworkChangeNotifier::IPAddressObserver,
248 public net::NetworkChangeNotifier::ConnectionTypeObserver { 238 public net::NetworkChangeNotifier::ConnectionTypeObserver {
249 public: 239 public:
250 // |net_log| must remain valid throughout our lifetime. 240 // |net_log| must remain valid throughout our lifetime.
251 explicit LoggingNetworkChangeObserver(net::NetLog* net_log) 241 explicit LoggingNetworkChangeObserver(net::NetLog* net_log)
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 new BasicHttpUserAgentSettings(EmptyString(), EmptyString())); 481 new BasicHttpUserAgentSettings(EmptyString(), EmptyString()));
492 if (command_line.HasSwitch(switches::kHostRules)) { 482 if (command_line.HasSwitch(switches::kHostRules)) {
493 globals_->host_mapping_rules->SetRulesFromString( 483 globals_->host_mapping_rules->SetRulesFromString(
494 command_line.GetSwitchValueASCII(switches::kHostRules)); 484 command_line.GetSwitchValueASCII(switches::kHostRules));
495 } 485 }
496 if (command_line.HasSwitch(switches::kIgnoreCertificateErrors)) 486 if (command_line.HasSwitch(switches::kIgnoreCertificateErrors))
497 globals_->ignore_certificate_errors = true; 487 globals_->ignore_certificate_errors = true;
498 if (command_line.HasSwitch(switches::kEnableHttpPipelining)) 488 if (command_line.HasSwitch(switches::kEnableHttpPipelining))
499 globals_->http_pipelining_enabled = true; 489 globals_->http_pipelining_enabled = true;
500 if (command_line.HasSwitch(switches::kTestingFixedHttpPort)) { 490 if (command_line.HasSwitch(switches::kTestingFixedHttpPort)) {
501 int value; 491 globals_->testing_fixed_http_port =
502 base::StringToInt( 492 GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpPort);
503 command_line.GetSwitchValueASCII(
504 switches::kTestingFixedHttpPort),
505 &value);
506 globals_->testing_fixed_http_port = value;
507 } 493 }
508 if (command_line.HasSwitch(switches::kTestingFixedHttpsPort)) { 494 if (command_line.HasSwitch(switches::kTestingFixedHttpsPort)) {
509 int value; 495 globals_->testing_fixed_https_port =
510 base::StringToInt( 496 GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpsPort);
511 command_line.GetSwitchValueASCII(
512 switches::kTestingFixedHttpsPort),
513 &value);
514 globals_->testing_fixed_https_port = value;
515 } 497 }
516 498
499 InitializeNetworkOptions(command_line);
500
517 net::HttpNetworkSession::Params session_params; 501 net::HttpNetworkSession::Params session_params;
518 InitializeNetworkSessionParams(*globals_, &session_params); 502 InitializeNetworkSessionParams(&session_params);
519 session_params.net_log = net_log_; 503 session_params.net_log = net_log_;
520 session_params.proxy_service = 504 session_params.proxy_service =
521 globals_->proxy_script_fetcher_proxy_service.get(); 505 globals_->proxy_script_fetcher_proxy_service.get();
522 506
523 InitializeNetworkOptions(command_line);
524
525 scoped_refptr<net::HttpNetworkSession> network_session( 507 scoped_refptr<net::HttpNetworkSession> network_session(
526 new net::HttpNetworkSession(session_params)); 508 new net::HttpNetworkSession(session_params));
527 globals_->proxy_script_fetcher_http_transaction_factory.reset( 509 globals_->proxy_script_fetcher_http_transaction_factory.reset(
528 new net::HttpNetworkLayer(network_session)); 510 new net::HttpNetworkLayer(network_session));
529 globals_->proxy_script_fetcher_ftp_transaction_factory.reset( 511 globals_->proxy_script_fetcher_ftp_transaction_factory.reset(
530 new net::FtpNetworkLayer(globals_->host_resolver.get())); 512 new net::FtpNetworkLayer(globals_->host_resolver.get()));
531 513
532 globals_->throttler_manager.reset(new net::URLRequestThrottlerManager()); 514 globals_->throttler_manager.reset(new net::URLRequestThrottlerManager());
533 globals_->throttler_manager->set_net_log(net_log_); 515 globals_->throttler_manager->set_net_log(net_log_);
534 // Always done in production, disabled only for unit tests. 516 // Always done in production, disabled only for unit tests.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 network_change_observer_.reset(); 569 network_change_observer_.reset();
588 570
589 system_proxy_config_service_.reset(); 571 system_proxy_config_service_.reset();
590 572
591 delete globals_; 573 delete globals_;
592 globals_ = NULL; 574 globals_ = NULL;
593 575
594 base::debug::LeakTracker<SystemURLRequestContextGetter>::CheckForLeaks(); 576 base::debug::LeakTracker<SystemURLRequestContextGetter>::CheckForLeaks();
595 } 577 }
596 578
597 void IOThread::InitializeNetworkOptions( 579 void IOThread::InitializeNetworkOptions(const CommandLine& command_line) {
598 const CommandLine& parsed_command_line) { 580 if (command_line.HasSwitch(switches::kEnableFileCookies)) {
599 if (parsed_command_line.HasSwitch(switches::kEnableFileCookies)) {
600 // Enable cookie storage for file:// URLs. Must do this before the first 581 // Enable cookie storage for file:// URLs. Must do this before the first
601 // Profile (and therefore the first CookieMonster) is created. 582 // Profile (and therefore the first CookieMonster) is created.
602 net::CookieMonster::EnableFileScheme(); 583 net::CookieMonster::EnableFileScheme();
603 } 584 }
604 585
605 // If "spdy.disabled" preference is controlled via policy, then skip use-spdy 586 // If "spdy.disabled" preference is controlled via policy, then skip use-spdy
606 // command line flags. 587 // command line flags.
607 if (is_spdy_disabled_by_policy_) 588 if (is_spdy_disabled_by_policy_)
608 return; 589 return;
609 590
610 if (parsed_command_line.HasSwitch(switches::kEnableIPPooling)) 591 if (command_line.HasSwitch(switches::kEnableIPPooling))
611 net::SpdySessionPool::enable_ip_pooling(true); 592 globals_->enable_spdy_ip_pooling.set(true);
612 593
613 if (parsed_command_line.HasSwitch(switches::kDisableIPPooling)) 594 if (command_line.HasSwitch(switches::kDisableIPPooling))
614 net::SpdySessionPool::enable_ip_pooling(false); 595 globals_->enable_spdy_ip_pooling.set(false);
615 596
616 if (parsed_command_line.HasSwitch(switches::kEnableSpdyCredentialFrames)) 597 if (command_line.HasSwitch(switches::kEnableSpdyCredentialFrames))
617 net::SpdySession::set_enable_credential_frames(true); 598 globals_->enable_spdy_credential_frames.set(true);
618 if (parsed_command_line.HasSwitch(switches::kMaxSpdySessionsPerDomain)) {
619 int value;
620 base::StringToInt(
621 parsed_command_line.GetSwitchValueASCII(
622 switches::kMaxSpdySessionsPerDomain),
623 &value);
624 net::SpdySessionPool::set_max_sessions_per_domain(value);
625 }
626 599
627 if (parsed_command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { 600 if (command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) {
628 // Enable WebSocket over SPDY. 601 // Enable WebSocket over SPDY.
629 net::WebSocketJob::set_websocket_over_spdy_enabled(true); 602 net::WebSocketJob::set_websocket_over_spdy_enabled(true);
630 } 603 }
604 if (command_line.HasSwitch(switches::kMaxSpdySessionsPerDomain)) {
605 globals_->max_spdy_sessions_per_domain.set(
606 GetSwitchValueAsInt(command_line, switches::kMaxSpdySessionsPerDomain));
607 }
608 if (command_line.HasSwitch(switches::kMaxSpdyConcurrentStreams)) {
609 globals_->max_spdy_concurrent_streams_limit.set(
610 GetSwitchValueAsInt(command_line, switches::kMaxSpdyConcurrentStreams));
611 }
631 612
632 bool used_spdy_switch = false; 613 bool used_spdy_switch = false;
633 if (parsed_command_line.HasSwitch(switches::kUseSpdy)) { 614 if (command_line.HasSwitch(switches::kUseSpdy)) {
634 std::string spdy_mode = 615 std::string spdy_mode =
635 parsed_command_line.GetSwitchValueASCII(switches::kUseSpdy); 616 command_line.GetSwitchValueASCII(switches::kUseSpdy);
636 EnableSpdy(spdy_mode); 617 EnableSpdy(spdy_mode);
637 used_spdy_switch = true; 618 used_spdy_switch = true;
638 } 619 }
639 if (parsed_command_line.HasSwitch(switches::kEnableSpdy3)) { 620 if (command_line.HasSwitch(switches::kEnableSpdy3)) {
640 net::HttpStreamFactory::EnableNpnSpdy3(); 621 net::HttpStreamFactory::EnableNpnSpdy3();
641 used_spdy_switch = true; 622 used_spdy_switch = true;
642 } else if (parsed_command_line.HasSwitch(switches::kEnableNpn)) { 623 } else if (command_line.HasSwitch(switches::kEnableNpn)) {
643 net::HttpStreamFactory::EnableNpnSpdy(); 624 net::HttpStreamFactory::EnableNpnSpdy();
644 used_spdy_switch = true; 625 used_spdy_switch = true;
645 } else if (parsed_command_line.HasSwitch(switches::kEnableNpnHttpOnly)) { 626 } else if (command_line.HasSwitch(switches::kEnableNpnHttpOnly)) {
646 net::HttpStreamFactory::EnableNpnHttpOnly(); 627 net::HttpStreamFactory::EnableNpnHttpOnly();
647 used_spdy_switch = true; 628 used_spdy_switch = true;
648 } 629 }
649 if (!used_spdy_switch) { 630 if (!used_spdy_switch) {
650 net::HttpStreamFactory::EnableNpnSpdy3(); 631 net::HttpStreamFactory::EnableNpnSpdy3();
651 } 632 }
652 } 633 }
653 634
654 void IOThread::EnableSpdy(const std::string& mode) { 635 void IOThread::EnableSpdy(const std::string& mode) {
655 static const char kOff[] = "off"; 636 static const char kOff[] = "off";
(...skipping 15 matching lines...) Expand all
671 it != spdy_options.end(); ++it) { 652 it != spdy_options.end(); ++it) {
672 const std::string& element = *it; 653 const std::string& element = *it;
673 std::vector<std::string> name_value; 654 std::vector<std::string> name_value;
674 base::SplitString(element, '=', &name_value); 655 base::SplitString(element, '=', &name_value);
675 const std::string& option = name_value.size() > 0 ? name_value[0] : ""; 656 const std::string& option = name_value.size() > 0 ? name_value[0] : "";
676 const std::string value = name_value.size() > 1 ? name_value[1] : ""; 657 const std::string value = name_value.size() > 1 ? name_value[1] : "";
677 658
678 if (option == kOff) { 659 if (option == kOff) {
679 net::HttpStreamFactory::set_spdy_enabled(false); 660 net::HttpStreamFactory::set_spdy_enabled(false);
680 } else if (option == kDisableSSL) { 661 } else if (option == kDisableSSL) {
681 net::SpdySession::set_default_protocol(net::kProtoSPDY2); 662 globals_->spdy_default_protocol.set(net::kProtoSPDY2);
682 net::HttpStreamFactory::set_force_spdy_over_ssl(false); 663 net::HttpStreamFactory::set_force_spdy_over_ssl(false);
683 net::HttpStreamFactory::set_force_spdy_always(true); 664 net::HttpStreamFactory::set_force_spdy_always(true);
684 } else if (option == kSSL) { 665 } else if (option == kSSL) {
685 net::SpdySession::set_default_protocol(net::kProtoSPDY2); 666 globals_->spdy_default_protocol.set(net::kProtoSPDY2);
686 net::HttpStreamFactory::set_force_spdy_over_ssl(true); 667 net::HttpStreamFactory::set_force_spdy_over_ssl(true);
687 net::HttpStreamFactory::set_force_spdy_always(true); 668 net::HttpStreamFactory::set_force_spdy_always(true);
688 } else if (option == kDisablePing) { 669 } else if (option == kDisablePing) {
689 net::SpdySession::set_enable_ping_based_connection_checking(false); 670 globals_->enable_spdy_ping_based_connection_checking.set(false);
690 } else if (option == kExclude) { 671 } else if (option == kExclude) {
691 net::HttpStreamFactory::add_forced_spdy_exclusion(value); 672 net::HttpStreamFactory::add_forced_spdy_exclusion(value);
692 } else if (option == kDisableCompression) { 673 } else if (option == kDisableCompression) {
693 net::BufferedSpdyFramer::set_enable_compression_default(false); 674 globals_->enable_spdy_compression.set(false);
694 } else if (option == kDisableAltProtocols) { 675 } else if (option == kDisableAltProtocols) {
695 net::HttpStreamFactory::set_use_alternate_protocols(false); 676 net::HttpStreamFactory::set_use_alternate_protocols(false);
696 } else if (option == kForceAltProtocols) { 677 } else if (option == kForceAltProtocols) {
697 net::PortAlternateProtocolPair pair; 678 net::PortAlternateProtocolPair pair;
698 pair.port = 443; 679 pair.port = 443;
699 pair.protocol = net::NPN_SPDY_2; 680 pair.protocol = net::NPN_SPDY_2;
700 net::HttpServerPropertiesImpl::ForceAlternateProtocol(pair); 681 net::HttpServerPropertiesImpl::ForceAlternateProtocol(pair);
701 } else if (option == kSingleDomain) { 682 } else if (option == kSingleDomain) {
702 DLOG(INFO) << "FORCING SINGLE DOMAIN"; 683 DLOG(INFO) << "FORCING SINGLE DOMAIN";
703 net::SpdySessionPool::ForceSingleDomain(); 684 globals_->force_spdy_single_domain.set(true);
704 } else if (option == kInitialMaxConcurrentStreams) { 685 } else if (option == kInitialMaxConcurrentStreams) {
705 int streams; 686 int streams;
706 if (base::StringToInt(value, &streams) && streams > 0) 687 if (base::StringToInt(value, &streams))
707 net::SpdySession::set_init_max_concurrent_streams(streams); 688 globals_->initial_max_spdy_concurrent_streams.set(streams);
708 } else if (option.empty() && it == spdy_options.begin()) { 689 } else if (option.empty() && it == spdy_options.begin()) {
709 continue; 690 continue;
710 } else { 691 } else {
711 LOG(DFATAL) << "Unrecognized spdy option: " << option; 692 LOG(DFATAL) << "Unrecognized spdy option: " << option;
712 } 693 }
713 } 694 }
714 } 695 }
715 696
716 // static 697 // static
717 void IOThread::RegisterPrefs(PrefService* local_state) { 698 void IOThread::RegisterPrefs(PrefService* local_state) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 } 755 }
775 756
776 void IOThread::ClearHostCache() { 757 void IOThread::ClearHostCache() {
777 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 758 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
778 759
779 net::HostCache* host_cache = globals_->host_resolver->GetHostCache(); 760 net::HostCache* host_cache = globals_->host_resolver->GetHostCache();
780 if (host_cache) 761 if (host_cache)
781 host_cache->clear(); 762 host_cache->clear();
782 } 763 }
783 764
765 void IOThread::InitializeNetworkSessionParams(
766 net::HttpNetworkSession::Params* params) {
767 params->host_resolver = globals_->host_resolver.get();
768 params->cert_verifier = globals_->cert_verifier.get();
769 params->server_bound_cert_service =
770 globals_->system_server_bound_cert_service.get();
771 params->transport_security_state = globals_->transport_security_state.get();
772 params->ssl_config_service = globals_->ssl_config_service.get();
773 params->http_auth_handler_factory = globals_->http_auth_handler_factory.get();
774 params->http_server_properties = globals_->http_server_properties.get();
775 params->network_delegate = globals_->system_network_delegate.get();
776 params->host_mapping_rules = globals_->host_mapping_rules.get();
777 params->ignore_certificate_errors = globals_->ignore_certificate_errors;
778 params->http_pipelining_enabled = globals_->http_pipelining_enabled;
779 params->testing_fixed_http_port = globals_->testing_fixed_http_port;
780 params->testing_fixed_https_port = globals_->testing_fixed_https_port;
781
782 globals_->max_spdy_sessions_per_domain.CopyToIfSet(
783 &params->max_spdy_sessions_per_domain);
784 globals_->initial_max_spdy_concurrent_streams.CopyToIfSet(
785 &params->spdy_initial_max_concurrent_streams);
786 globals_->max_spdy_concurrent_streams_limit.CopyToIfSet(
787 &params->spdy_max_concurrent_streams_limit);
788 globals_->force_spdy_single_domain.CopyToIfSet(
789 &params->force_spdy_single_domain);
790 globals_->enable_spdy_ip_pooling.CopyToIfSet(
791 &params->enable_spdy_ip_pooling);
792 globals_->enable_spdy_credential_frames.CopyToIfSet(
793 &params->enable_spdy_credential_frames);
794 globals_->enable_spdy_compression.CopyToIfSet(
795 &params->enable_spdy_compression);
796 globals_->enable_spdy_ping_based_connection_checking.CopyToIfSet(
797 &params->enable_spdy_ping_based_connection_checking);
798 globals_->spdy_default_protocol.CopyToIfSet(
799 &params->spdy_default_protocol);
800 }
801
784 net::SSLConfigService* IOThread::GetSSLConfigService() { 802 net::SSLConfigService* IOThread::GetSSLConfigService() {
785 return ssl_config_service_manager_->Get(); 803 return ssl_config_service_manager_->Get();
786 } 804 }
787 805
788 void IOThread::ChangedToOnTheRecordOnIOThread() { 806 void IOThread::ChangedToOnTheRecordOnIOThread() {
789 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 807 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
790 808
791 // Clear the host cache to avoid showing entries from the OTR session 809 // Clear the host cache to avoid showing entries from the OTR session
792 // in about:net-internals. 810 // in about:net-internals.
793 ClearHostCache(); 811 ClearHostCache();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 843
826 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 844 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
827 globals_->system_proxy_service.reset( 845 globals_->system_proxy_service.reset(
828 ProxyServiceFactory::CreateProxyService( 846 ProxyServiceFactory::CreateProxyService(
829 net_log_, 847 net_log_,
830 globals_->proxy_script_fetcher_context.get(), 848 globals_->proxy_script_fetcher_context.get(),
831 system_proxy_config_service_.release(), 849 system_proxy_config_service_.release(),
832 command_line)); 850 command_line));
833 851
834 net::HttpNetworkSession::Params system_params; 852 net::HttpNetworkSession::Params system_params;
835 InitializeNetworkSessionParams(*globals_, &system_params); 853 InitializeNetworkSessionParams(&system_params);
836 system_params.net_log = net_log_; 854 system_params.net_log = net_log_;
837 system_params.proxy_service = globals_->system_proxy_service.get(); 855 system_params.proxy_service = globals_->system_proxy_service.get();
838 856
839 globals_->system_http_transaction_factory.reset( 857 globals_->system_http_transaction_factory.reset(
840 new net::HttpNetworkLayer( 858 new net::HttpNetworkLayer(
841 new net::HttpNetworkSession(system_params))); 859 new net::HttpNetworkSession(system_params)));
842 globals_->system_ftp_transaction_factory.reset( 860 globals_->system_ftp_transaction_factory.reset(
843 new net::FtpNetworkLayer(globals_->host_resolver.get())); 861 new net::FtpNetworkLayer(globals_->host_resolver.get()));
844 globals_->system_request_context.reset( 862 globals_->system_request_context.reset(
845 ConstructSystemRequestContext(globals_, net_log_)); 863 ConstructSystemRequestContext(globals_, net_log_));
846 864
847 sdch_manager_->set_sdch_fetcher( 865 sdch_manager_->set_sdch_fetcher(
848 new SdchDictionaryFetcher(system_url_request_context_getter_.get())); 866 new SdchDictionaryFetcher(system_url_request_context_getter_.get()));
849 } 867 }
850 868
851 void IOThread::UpdateDnsClientEnabled() { 869 void IOThread::UpdateDnsClientEnabled() {
852 globals()->host_resolver->SetDnsClientEnabled(*dns_client_enabled_); 870 globals()->host_resolver->SetDnsClientEnabled(*dns_client_enabled_);
853 } 871 }
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.h ('k') | chrome/browser/profiles/profile_io_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698