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

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

Issue 303253003: QUIC - persist server config in stable and beta channels. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed chrome/common/chrome_version_info.h include 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 | « no previous file | no next file » | 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 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"
43 #include "chrome/common/pref_names.h" 42 #include "chrome/common/pref_names.h"
44 #include "components/data_reduction_proxy/browser/data_reduction_proxy_prefs.h" 43 #include "components/data_reduction_proxy/browser/data_reduction_proxy_prefs.h"
45 #include "components/data_reduction_proxy/browser/http_auth_handler_data_reducti on_proxy.h" 44 #include "components/data_reduction_proxy/browser/http_auth_handler_data_reducti on_proxy.h"
46 #include "components/policy/core/common/policy_service.h" 45 #include "components/policy/core/common/policy_service.h"
47 #include "content/public/browser/browser_thread.h" 46 #include "content/public/browser/browser_thread.h"
48 #include "content/public/browser/cookie_store_factory.h" 47 #include "content/public/browser/cookie_store_factory.h"
49 #include "net/base/host_mapping_rules.h" 48 #include "net/base/host_mapping_rules.h"
50 #include "net/base/net_util.h" 49 #include "net/base/net_util.h"
51 #include "net/base/sdch_manager.h" 50 #include "net/base/sdch_manager.h"
52 #include "net/cert/cert_verifier.h" 51 #include "net/cert/cert_verifier.h"
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 if (command_line.HasSwitch(switches::kEnableQuicTimeBasedLossDetection)) 1138 if (command_line.HasSwitch(switches::kEnableQuicTimeBasedLossDetection))
1140 return true; 1139 return true;
1141 1140
1142 if (command_line.HasSwitch(switches::kDisableQuicTimeBasedLossDetection)) 1141 if (command_line.HasSwitch(switches::kDisableQuicTimeBasedLossDetection))
1143 return false; 1142 return false;
1144 1143
1145 return quic_trial_group.ends_with( 1144 return quic_trial_group.ends_with(
1146 kQuicFieldTrialTimeBasedLossDetectionSuffix); 1145 kQuicFieldTrialTimeBasedLossDetectionSuffix);
1147 } 1146 }
1148 1147
1148 // TODO(rtenneti): Delete this method after the merge.
1149 bool IOThread::ShouldEnableQuicPersistServerInfo( 1149 bool IOThread::ShouldEnableQuicPersistServerInfo(
1150 const CommandLine& command_line) { 1150 const CommandLine& command_line) {
1151 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
1152 // Avoid persisting of Quic server config information to disk cache when we
1153 // have a beta or stable release. Allow in all other cases, including when we
1154 // do a developer build (CHANNEL_UNKNOWN).
1155 if (channel == chrome::VersionInfo::CHANNEL_STABLE ||
1156 channel == chrome::VersionInfo::CHANNEL_BETA) {
1157 return false;
1158 }
1159 return true; 1151 return true;
1160 } 1152 }
1161 1153
1162 size_t IOThread::GetQuicMaxPacketLength(const CommandLine& command_line, 1154 size_t IOThread::GetQuicMaxPacketLength(const CommandLine& command_line,
1163 base::StringPiece quic_trial_group) { 1155 base::StringPiece quic_trial_group) {
1164 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) { 1156 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) {
1165 unsigned value; 1157 unsigned value;
1166 if (!base::StringToUint( 1158 if (!base::StringToUint(
1167 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength), 1159 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength),
1168 &value)) { 1160 &value)) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 std::string version_flag = 1192 std::string version_flag =
1201 command_line.GetSwitchValueASCII(switches::kQuicVersion); 1193 command_line.GetSwitchValueASCII(switches::kQuicVersion);
1202 for (size_t i = 0; i < supported_versions.size(); ++i) { 1194 for (size_t i = 0; i < supported_versions.size(); ++i) {
1203 net::QuicVersion version = supported_versions[i]; 1195 net::QuicVersion version = supported_versions[i];
1204 if (net::QuicVersionToString(version) == version_flag) { 1196 if (net::QuicVersionToString(version) == version_flag) {
1205 return version; 1197 return version;
1206 } 1198 }
1207 } 1199 }
1208 return net::QUIC_VERSION_UNSUPPORTED; 1200 return net::QUIC_VERSION_UNSUPPORTED;
1209 } 1201 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698