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

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

Issue 295383007: Get rid of websocket_over_spdy_enabled global. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with fixed linebreaks Created 6 years, 6 months 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') | net/http/http_network_session.h » ('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/base64.h" 9 #include "base/base64.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 #include "net/spdy/spdy_session.h" 70 #include "net/spdy/spdy_session.h"
71 #include "net/ssl/default_server_bound_cert_store.h" 71 #include "net/ssl/default_server_bound_cert_store.h"
72 #include "net/ssl/server_bound_cert_service.h" 72 #include "net/ssl/server_bound_cert_service.h"
73 #include "net/url_request/data_protocol_handler.h" 73 #include "net/url_request/data_protocol_handler.h"
74 #include "net/url_request/file_protocol_handler.h" 74 #include "net/url_request/file_protocol_handler.h"
75 #include "net/url_request/ftp_protocol_handler.h" 75 #include "net/url_request/ftp_protocol_handler.h"
76 #include "net/url_request/static_http_user_agent_settings.h" 76 #include "net/url_request/static_http_user_agent_settings.h"
77 #include "net/url_request/url_fetcher.h" 77 #include "net/url_request/url_fetcher.h"
78 #include "net/url_request/url_request_job_factory_impl.h" 78 #include "net/url_request/url_request_job_factory_impl.h"
79 #include "net/url_request/url_request_throttler_manager.h" 79 #include "net/url_request/url_request_throttler_manager.h"
80 #include "net/websockets/websocket_job.h"
81 #include "url/url_constants.h" 80 #include "url/url_constants.h"
82 81
83 #if defined(ENABLE_CONFIGURATION_POLICY) 82 #if defined(ENABLE_CONFIGURATION_POLICY)
84 #include "policy/policy_constants.h" 83 #include "policy/policy_constants.h"
85 #endif 84 #endif
86 85
87 #if !defined(USE_OPENSSL) 86 #if !defined(USE_OPENSSL)
88 #include "net/cert/ct_log_verifier.h" 87 #include "net/cert/ct_log_verifier.h"
89 #include "net/cert/multi_log_ct_verifier.h" 88 #include "net/cert/multi_log_ct_verifier.h"
90 #endif 89 #endif
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 // Only handle use-spdy command line flags if "spdy.disabled" preference is 748 // Only handle use-spdy command line flags if "spdy.disabled" preference is
750 // not disabled via policy. 749 // not disabled via policy.
751 if (is_spdy_disabled_by_policy_) { 750 if (is_spdy_disabled_by_policy_) {
752 base::FieldTrial* trial = base::FieldTrialList::Find(kSpdyFieldTrialName); 751 base::FieldTrial* trial = base::FieldTrialList::Find(kSpdyFieldTrialName);
753 if (trial) 752 if (trial)
754 trial->Disable(); 753 trial->Disable();
755 } else { 754 } else {
756 std::string spdy_trial_group = 755 std::string spdy_trial_group =
757 base::FieldTrialList::FindFullName(kSpdyFieldTrialName); 756 base::FieldTrialList::FindFullName(kSpdyFieldTrialName);
758 757
759 if (command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) {
760 // Enable WebSocket over SPDY.
761 net::WebSocketJob::set_websocket_over_spdy_enabled(true);
762 }
763
764 if (command_line.HasSwitch(switches::kTrustedSpdyProxy)) { 758 if (command_line.HasSwitch(switches::kTrustedSpdyProxy)) {
765 globals_->trusted_spdy_proxy.set( 759 globals_->trusted_spdy_proxy.set(
766 command_line.GetSwitchValueASCII(switches::kTrustedSpdyProxy)); 760 command_line.GetSwitchValueASCII(switches::kTrustedSpdyProxy));
767 } 761 }
768 if (command_line.HasSwitch(switches::kIgnoreUrlFetcherCertRequests)) 762 if (command_line.HasSwitch(switches::kIgnoreUrlFetcherCertRequests))
769 net::URLFetcher::SetIgnoreCertificateRequests(true); 763 net::URLFetcher::SetIgnoreCertificateRequests(true);
770 764
771 if (command_line.HasSwitch(switches::kUseSpdy)) { 765 if (command_line.HasSwitch(switches::kUseSpdy)) {
772 std::string spdy_mode = 766 std::string spdy_mode =
773 command_line.GetSwitchValueASCII(switches::kUseSpdy); 767 command_line.GetSwitchValueASCII(switches::kUseSpdy);
(...skipping 10 matching lines...) Expand all
784 } else { 778 } else {
785 if (spdy_trial_group == kSpdyFieldTrialDisabledGroupName && 779 if (spdy_trial_group == kSpdyFieldTrialDisabledGroupName &&
786 !command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { 780 !command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) {
787 net::HttpStreamFactory::set_spdy_enabled(false); 781 net::HttpStreamFactory::set_spdy_enabled(false);
788 } else { 782 } else {
789 // Use SPDY/3.1 by default. 783 // Use SPDY/3.1 by default.
790 globals_->next_protos = net::NextProtosSpdy31(); 784 globals_->next_protos = net::NextProtosSpdy31();
791 globals_->use_alternate_protocols.set(true); 785 globals_->use_alternate_protocols.set(true);
792 } 786 }
793 } 787 }
788
789 if (command_line.HasSwitch(switches::kEnableWebSocketOverSpdy))
790 globals_->enable_websocket_over_spdy.set(true);
794 } 791 }
795 792
796 // TODO(rch): Make the client socket factory a per-network session 793 // TODO(rch): Make the client socket factory a per-network session
797 // instance, constructed from a NetworkSession::Params, to allow us 794 // instance, constructed from a NetworkSession::Params, to allow us
798 // to move this option to IOThread::Globals & 795 // to move this option to IOThread::Globals &
799 // HttpNetworkSession::Params. 796 // HttpNetworkSession::Params.
800 if (command_line.HasSwitch(switches::kEnableTcpFastOpen)) 797 if (command_line.HasSwitch(switches::kEnableTcpFastOpen))
801 net::SetTCPFastOpenEnabled(true); 798 net::SetTCPFastOpenEnabled(true);
802 } 799 }
803 800
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 &params->enable_spdy_ping_based_connection_checking); 955 &params->enable_spdy_ping_based_connection_checking);
959 globals_->spdy_default_protocol.CopyToIfSet( 956 globals_->spdy_default_protocol.CopyToIfSet(
960 &params->spdy_default_protocol); 957 &params->spdy_default_protocol);
961 params->next_protos = globals_->next_protos; 958 params->next_protos = globals_->next_protos;
962 globals_->trusted_spdy_proxy.CopyToIfSet(&params->trusted_spdy_proxy); 959 globals_->trusted_spdy_proxy.CopyToIfSet(&params->trusted_spdy_proxy);
963 globals_->force_spdy_over_ssl.CopyToIfSet(&params->force_spdy_over_ssl); 960 globals_->force_spdy_over_ssl.CopyToIfSet(&params->force_spdy_over_ssl);
964 globals_->force_spdy_always.CopyToIfSet(&params->force_spdy_always); 961 globals_->force_spdy_always.CopyToIfSet(&params->force_spdy_always);
965 globals_->forced_spdy_exclusions = params->forced_spdy_exclusions; 962 globals_->forced_spdy_exclusions = params->forced_spdy_exclusions;
966 globals_->use_alternate_protocols.CopyToIfSet( 963 globals_->use_alternate_protocols.CopyToIfSet(
967 &params->use_alternate_protocols); 964 &params->use_alternate_protocols);
965 globals_->enable_websocket_over_spdy.CopyToIfSet(
966 &params->enable_websocket_over_spdy);
968 967
969 globals_->enable_quic.CopyToIfSet(&params->enable_quic); 968 globals_->enable_quic.CopyToIfSet(&params->enable_quic);
970 globals_->enable_quic_https.CopyToIfSet(&params->enable_quic_https); 969 globals_->enable_quic_https.CopyToIfSet(&params->enable_quic_https);
971 globals_->enable_quic_pacing.CopyToIfSet( 970 globals_->enable_quic_pacing.CopyToIfSet(
972 &params->enable_quic_pacing); 971 &params->enable_quic_pacing);
973 globals_->enable_quic_time_based_loss_detection.CopyToIfSet( 972 globals_->enable_quic_time_based_loss_detection.CopyToIfSet(
974 &params->enable_quic_time_based_loss_detection); 973 &params->enable_quic_time_based_loss_detection);
975 globals_->enable_quic_persist_server_info.CopyToIfSet( 974 globals_->enable_quic_persist_server_info.CopyToIfSet(
976 &params->enable_quic_persist_server_info); 975 &params->enable_quic_persist_server_info);
977 globals_->enable_quic_port_selection.CopyToIfSet( 976 globals_->enable_quic_port_selection.CopyToIfSet(
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 std::string version_flag = 1204 std::string version_flag =
1206 command_line.GetSwitchValueASCII(switches::kQuicVersion); 1205 command_line.GetSwitchValueASCII(switches::kQuicVersion);
1207 for (size_t i = 0; i < supported_versions.size(); ++i) { 1206 for (size_t i = 0; i < supported_versions.size(); ++i) {
1208 net::QuicVersion version = supported_versions[i]; 1207 net::QuicVersion version = supported_versions[i];
1209 if (net::QuicVersionToString(version) == version_flag) { 1208 if (net::QuicVersionToString(version) == version_flag) {
1210 return version; 1209 return version;
1211 } 1210 }
1212 } 1211 }
1213 return net::QUIC_VERSION_UNSUPPORTED; 1212 return net::QUIC_VERSION_UNSUPPORTED;
1214 } 1213 }
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.h ('k') | net/http/http_network_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698