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

Side by Side Diff: components/data_reduction_proxy/browser/data_reduction_proxy_params.cc

Issue 388663002: Added data reduction proxy holdback experiment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" 5 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h " 9 #include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h "
10 #include "net/proxy/proxy_info.h" 10 #include "net/proxy/proxy_info.h"
(...skipping 27 matching lines...) Expand all
38 "DataCompressionProxyPromoVisibility") == kEnabled; 38 "DataCompressionProxyPromoVisibility") == kEnabled;
39 } 39 }
40 40
41 // static 41 // static
42 bool DataReductionProxyParams::IsIncludedInPreconnectHintingFieldTrial() { 42 bool DataReductionProxyParams::IsIncludedInPreconnectHintingFieldTrial() {
43 return IsIncludedInFieldTrial() && 43 return IsIncludedInFieldTrial() &&
44 FieldTrialList::FindFullName( 44 FieldTrialList::FindFullName(
45 "DataCompressionProxyPreconnectHints") == kEnabled; 45 "DataCompressionProxyPreconnectHints") == kEnabled;
46 } 46 }
47 47
48 // static
49 bool DataReductionProxyParams::IsIncludedInHoldbackFieldTrial() {
50 return FieldTrialList::FindFullName(
51 "DataCompressionProxyHoldback") == kEnabled;
52 }
53
48 DataReductionProxyParams::DataReductionProxyParams(int flags) 54 DataReductionProxyParams::DataReductionProxyParams(int flags)
49 : allowed_((flags & kAllowed) == kAllowed), 55 : allowed_((flags & kAllowed) == kAllowed),
50 fallback_allowed_((flags & kFallbackAllowed) == kFallbackAllowed), 56 fallback_allowed_((flags & kFallbackAllowed) == kFallbackAllowed),
51 alt_allowed_((flags & kAlternativeAllowed) == kAlternativeAllowed), 57 alt_allowed_((flags & kAlternativeAllowed) == kAlternativeAllowed),
52 promo_allowed_((flags & kPromoAllowed) == kPromoAllowed), 58 promo_allowed_((flags & kPromoAllowed) == kPromoAllowed),
59 holdback_((flags & kHoldback) == kHoldback),
53 configured_on_command_line_(false) { 60 configured_on_command_line_(false) {
54 bool result = Init(allowed_, fallback_allowed_, alt_allowed_); 61 bool result = Init(allowed_, fallback_allowed_, alt_allowed_);
55 DCHECK(result); 62 DCHECK(result);
56 } 63 }
57 64
58 DataReductionProxyParams::~DataReductionProxyParams() { 65 DataReductionProxyParams::~DataReductionProxyParams() {
59 } 66 }
60 67
61 DataReductionProxyParams::DataReductionProxyList 68 DataReductionProxyParams::DataReductionProxyList
62 DataReductionProxyParams::GetAllowedProxies() const { 69 DataReductionProxyParams::GetAllowedProxies() const {
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 } 372 }
366 373
367 std::string DataReductionProxyParams::GetDefaultWarmupURL() const { 374 std::string DataReductionProxyParams::GetDefaultWarmupURL() const {
368 #if defined(DATA_REDUCTION_PROXY_WARMUP_URL) 375 #if defined(DATA_REDUCTION_PROXY_WARMUP_URL)
369 return DATA_REDUCTION_PROXY_WARMUP_URL; 376 return DATA_REDUCTION_PROXY_WARMUP_URL;
370 #endif 377 #endif
371 return std::string(); 378 return std::string();
372 } 379 }
373 380
374 } // namespace data_reduction_proxy 381 } // namespace data_reduction_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698