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

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

Issue 312193005: Pass chrome version and channel in CHLO message to server. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use kUACV as the Tag and changed client_description to client_version 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
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 21 matching lines...) Expand all
32 #include "chrome/browser/net/chrome_net_log.h" 32 #include "chrome/browser/net/chrome_net_log.h"
33 #include "chrome/browser/net/chrome_network_delegate.h" 33 #include "chrome/browser/net/chrome_network_delegate.h"
34 #include "chrome/browser/net/chrome_url_request_context.h" 34 #include "chrome/browser/net/chrome_url_request_context.h"
35 #include "chrome/browser/net/connect_interceptor.h" 35 #include "chrome/browser/net/connect_interceptor.h"
36 #include "chrome/browser/net/dns_probe_service.h" 36 #include "chrome/browser/net/dns_probe_service.h"
37 #include "chrome/browser/net/pref_proxy_config_tracker.h" 37 #include "chrome/browser/net/pref_proxy_config_tracker.h"
38 #include "chrome/browser/net/proxy_service_factory.h" 38 #include "chrome/browser/net/proxy_service_factory.h"
39 #include "chrome/browser/net/sdch_dictionary_fetcher.h" 39 #include "chrome/browser/net/sdch_dictionary_fetcher.h"
40 #include "chrome/common/chrome_content_client.h" 40 #include "chrome/common/chrome_content_client.h"
41 #include "chrome/common/chrome_switches.h" 41 #include "chrome/common/chrome_switches.h"
42 #include "chrome/common/chrome_version_info.h"
42 #include "chrome/common/pref_names.h" 43 #include "chrome/common/pref_names.h"
43 #include "components/data_reduction_proxy/browser/data_reduction_proxy_prefs.h" 44 #include "components/data_reduction_proxy/browser/data_reduction_proxy_prefs.h"
44 #include "components/data_reduction_proxy/browser/http_auth_handler_data_reducti on_proxy.h" 45 #include "components/data_reduction_proxy/browser/http_auth_handler_data_reducti on_proxy.h"
45 #include "components/policy/core/common/policy_service.h" 46 #include "components/policy/core/common/policy_service.h"
46 #include "content/public/browser/browser_thread.h" 47 #include "content/public/browser/browser_thread.h"
47 #include "content/public/browser/cookie_store_factory.h" 48 #include "content/public/browser/cookie_store_factory.h"
48 #include "net/base/host_mapping_rules.h" 49 #include "net/base/host_mapping_rules.h"
49 #include "net/base/net_util.h" 50 #include "net/base/net_util.h"
50 #include "net/base/sdch_manager.h" 51 #include "net/base/sdch_manager.h"
51 #include "net/cert/cert_verifier.h" 52 #include "net/cert/cert_verifier.h"
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 globals_->enable_quic_https.CopyToIfSet(&params->enable_quic_https); 970 globals_->enable_quic_https.CopyToIfSet(&params->enable_quic_https);
970 globals_->enable_quic_pacing.CopyToIfSet( 971 globals_->enable_quic_pacing.CopyToIfSet(
971 &params->enable_quic_pacing); 972 &params->enable_quic_pacing);
972 globals_->enable_quic_time_based_loss_detection.CopyToIfSet( 973 globals_->enable_quic_time_based_loss_detection.CopyToIfSet(
973 &params->enable_quic_time_based_loss_detection); 974 &params->enable_quic_time_based_loss_detection);
974 globals_->enable_quic_persist_server_info.CopyToIfSet( 975 globals_->enable_quic_persist_server_info.CopyToIfSet(
975 &params->enable_quic_persist_server_info); 976 &params->enable_quic_persist_server_info);
976 globals_->enable_quic_port_selection.CopyToIfSet( 977 globals_->enable_quic_port_selection.CopyToIfSet(
977 &params->enable_quic_port_selection); 978 &params->enable_quic_port_selection);
978 globals_->quic_max_packet_length.CopyToIfSet(&params->quic_max_packet_length); 979 globals_->quic_max_packet_length.CopyToIfSet(&params->quic_max_packet_length);
980 globals_->client_version.CopyToIfSet(&params->client_version);
979 globals_->quic_supported_versions.CopyToIfSet( 981 globals_->quic_supported_versions.CopyToIfSet(
980 &params->quic_supported_versions); 982 &params->quic_supported_versions);
981 globals_->origin_to_force_quic_on.CopyToIfSet( 983 globals_->origin_to_force_quic_on.CopyToIfSet(
982 &params->origin_to_force_quic_on); 984 &params->origin_to_force_quic_on);
983 params->enable_user_alternate_protocol_ports = 985 params->enable_user_alternate_protocol_ports =
984 globals_->enable_user_alternate_protocol_ports; 986 globals_->enable_user_alternate_protocol_ports;
985 } 987 }
986 988
987 base::TimeTicks IOThread::creation_time() const { 989 base::TimeTicks IOThread::creation_time() const {
988 return creation_time_; 990 return creation_time_;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 globals_->enable_quic_port_selection.set( 1077 globals_->enable_quic_port_selection.set(
1076 ShouldEnableQuicPortSelection(command_line)); 1078 ShouldEnableQuicPortSelection(command_line));
1077 } 1079 }
1078 1080
1079 size_t max_packet_length = GetQuicMaxPacketLength(command_line, 1081 size_t max_packet_length = GetQuicMaxPacketLength(command_line,
1080 quic_trial_group); 1082 quic_trial_group);
1081 if (max_packet_length != 0) { 1083 if (max_packet_length != 0) {
1082 globals_->quic_max_packet_length.set(max_packet_length); 1084 globals_->quic_max_packet_length.set(max_packet_length);
1083 } 1085 }
1084 1086
1087 std::string client_version =
1088 chrome::VersionInfo::GetVersionStringModifier();
1089 chrome::VersionInfo version_info;
Lei Zhang 2014/06/05 07:30:47 nit: swap with the next line to put |version_info|
ramant (doing other things) 2014/06/05 17:07:49 Done.
1090 client_version.append(" ");
Lei Zhang 2014/06/05 07:30:47 nit: append(" ") -> push_back(' ')
ramant (doing other things) 2014/06/05 17:07:49 Done.
1091 client_version.append(version_info.ProductNameAndVersionForUserAgent());
1092 globals_->client_version.set(client_version);
1093
1085 net::QuicVersion version = GetQuicVersion(command_line); 1094 net::QuicVersion version = GetQuicVersion(command_line);
1086 if (version != net::QUIC_VERSION_UNSUPPORTED) { 1095 if (version != net::QUIC_VERSION_UNSUPPORTED) {
1087 net::QuicVersionVector supported_versions; 1096 net::QuicVersionVector supported_versions;
1088 supported_versions.push_back(version); 1097 supported_versions.push_back(version);
1089 globals_->quic_supported_versions.set(supported_versions); 1098 globals_->quic_supported_versions.set(supported_versions);
1090 } 1099 }
1091 1100
1092 if (command_line.HasSwitch(switches::kOriginToForceQuicOn)) { 1101 if (command_line.HasSwitch(switches::kOriginToForceQuicOn)) {
1093 net::HostPortPair quic_origin = 1102 net::HostPortPair quic_origin =
1094 net::HostPortPair::FromString( 1103 net::HostPortPair::FromString(
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 std::string version_flag = 1213 std::string version_flag =
1205 command_line.GetSwitchValueASCII(switches::kQuicVersion); 1214 command_line.GetSwitchValueASCII(switches::kQuicVersion);
1206 for (size_t i = 0; i < supported_versions.size(); ++i) { 1215 for (size_t i = 0; i < supported_versions.size(); ++i) {
1207 net::QuicVersion version = supported_versions[i]; 1216 net::QuicVersion version = supported_versions[i];
1208 if (net::QuicVersionToString(version) == version_flag) { 1217 if (net::QuicVersionToString(version) == version_flag) {
1209 return version; 1218 return version;
1210 } 1219 }
1211 } 1220 }
1212 return net::QUIC_VERSION_UNSUPPORTED; 1221 return net::QUIC_VERSION_UNSUPPORTED;
1213 } 1222 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698