OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/net/spdyproxy/data_reduction_proxy_settings.h" | 5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_settings.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 void* iter = NULL; | 222 void* iter = NULL; |
223 std::string value; | 223 std::string value; |
224 while (headers->EnumerateHeader(&iter, "via", &value)) | 224 while (headers->EnumerateHeader(&iter, "via", &value)) |
225 if (value == kChromeProxyViaValue) return true; | 225 if (value == kChromeProxyViaValue) return true; |
226 return false; | 226 return false; |
227 } | 227 } |
228 | 228 |
229 // static | 229 // static |
230 std::string DataReductionProxySettings::GetDataReductionProxyOrigin() { | 230 std::string DataReductionProxySettings::GetDataReductionProxyOrigin() { |
231 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 231 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 232 if (command_line.HasSwitch(switches::kSpdyProxyDevAuthOrigin)) |
| 233 return command_line.GetSwitchValueASCII(switches::kSpdyProxyDevAuthOrigin); |
232 if (command_line.HasSwitch(switches::kSpdyProxyAuthOrigin)) | 234 if (command_line.HasSwitch(switches::kSpdyProxyAuthOrigin)) |
233 return command_line.GetSwitchValueASCII(switches::kSpdyProxyAuthOrigin); | 235 return command_line.GetSwitchValueASCII(switches::kSpdyProxyAuthOrigin); |
| 236 #if defined(DATA_REDUCTION_DEV_HOST) |
| 237 if (FieldTrialList::FindFullName("DataCompressionProxyDevRollout") == |
| 238 kEnabled) { |
| 239 return DATA_REDUCTION_DEV_HOST; |
| 240 } |
| 241 #endif |
234 #if defined(SPDY_PROXY_AUTH_ORIGIN) | 242 #if defined(SPDY_PROXY_AUTH_ORIGIN) |
235 return SPDY_PROXY_AUTH_ORIGIN; | 243 return SPDY_PROXY_AUTH_ORIGIN; |
236 #else | 244 #else |
237 return std::string(); | 245 return std::string(); |
238 #endif | 246 #endif |
239 } | 247 } |
240 | 248 |
241 // static | 249 // static |
242 std::string DataReductionProxySettings::GetDataReductionProxyFallback() { | 250 std::string DataReductionProxySettings::GetDataReductionProxyFallback() { |
243 // Regardless of what else is defined, only return a value if the main proxy | 251 // Regardless of what else is defined, only return a value if the main proxy |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 } | 672 } |
665 | 673 |
666 void | 674 void |
667 DataReductionProxySettings::ProbeWhetherDataReductionProxyIsAvailable() { | 675 DataReductionProxySettings::ProbeWhetherDataReductionProxyIsAvailable() { |
668 net::URLFetcher* fetcher = GetURLFetcher(); | 676 net::URLFetcher* fetcher = GetURLFetcher(); |
669 if (!fetcher) | 677 if (!fetcher) |
670 return; | 678 return; |
671 fetcher_.reset(fetcher); | 679 fetcher_.reset(fetcher); |
672 fetcher_->Start(); | 680 fetcher_->Start(); |
673 } | 681 } |
OLD | NEW |