Chromium Code Reviews| Index: components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc |
| diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc b/components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc |
| index eb7dc11d5d69c55f1dad0fa19f40807b98bab816..73c86afd0aa0bf1fd5b2fc560ace6c235ac2f11c 100644 |
| --- a/components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc |
| +++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc |
| @@ -48,20 +48,27 @@ const char kClientConfigURL[] = |
| "https://datasaver.googleapis.com/v1/clientConfigs"; |
| // Default URL for sending pageload metrics. |
| const char kPingbackURL[] = |
| "https://datasaver.googleapis.com/v1/metrics:recordPageloadMetrics"; |
| // The name of the server side experiment field trial. |
| const char kServerExperimentsFieldTrial[] = |
| "DataReductionProxyServerExperiments"; |
| +// The group of client side experiments. |
| +const char kClientSideExperimentsFieldTrial[] = |
| + "DataReductionProxyClientSideExperimentsFieldTrial"; |
| + |
| +// Allow offline pages to show for prohibitively slow networks. |
| +const char kOfflinePagesSlowNetwork[] = "OfflinePages"; |
| + |
| bool IsIncludedInFieldTrial(const std::string& name) { |
| return base::StartsWith(FieldTrialList::FindFullName(name), kEnabled, |
| base::CompareCase::SENSITIVE); |
| } |
| } // namespace |
| namespace data_reduction_proxy { |
| namespace params { |
| @@ -111,20 +118,27 @@ bool IsIncludedInLoFiPreviewFieldTrial() { |
| kPreview, base::CompareCase::SENSITIVE); |
| } |
| bool IsIncludedInServerExperimentsFieldTrial() { |
| return !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| data_reduction_proxy::switches:: |
| kDataReductionProxyServerExperimentsDisabled) && |
| FieldTrialList::FindFullName(kServerExperimentsFieldTrial) |
| .find(kDisabled) != 0; |
| } |
| + |
| +bool IsIncludedInOfflinePagesSlowConnectionFieldTrial() { |
| + return IsIncludedInFieldTrial(kClientSideExperimentsFieldTrial) && |
| + FieldTrialList::FindFullName(kClientSideExperimentsFieldTrial) |
|
tbansal1
2016/07/25 21:35:26
Instead of checking the group name, I think you sh
RyanSturm
2016/07/26 19:48:11
Done.
|
| + .find(kOfflinePagesSlowNetwork) != std::string::npos; |
| +} |
| + |
| bool IsIncludedInTamperDetectionExperiment() { |
| return IsIncludedInServerExperimentsFieldTrial() && |
| base::StartsWith( |
| FieldTrialList::FindFullName(kServerExperimentsFieldTrial), |
| "TamperDetection_Enabled", base::CompareCase::SENSITIVE); |
| } |
| bool IsLoFiOnViaFlags() { |
| return IsLoFiAlwaysOnViaFlags() || IsLoFiCellularOnlyViaFlags() || |
| IsLoFiSlowConnectionsOnlyViaFlags(); |