| 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 a16e7149ce804e8184f8270707607fae49c78b41..7392f2364e7f820916f52c89fc5cf71b3db7b455 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
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
|
|
|
| +#include <map>
|
| #include <string>
|
| #include <vector>
|
|
|
| @@ -60,6 +61,18 @@ bool IsIncludedInFieldTrial(const std::string& name) {
|
| base::CompareCase::SENSITIVE);
|
| }
|
|
|
| +// Returns the variation value for |parameter_name|. If the value is
|
| +// unavailable, |default_value| is returned.
|
| +std::string GetStringValueForVariationParamWithDefaultValue(
|
| + const std::map<std::string, std::string>& variation_params,
|
| + const std::string& parameter_name,
|
| + const std::string& default_value) {
|
| + const auto it = variation_params.find(parameter_name);
|
| + if (it == variation_params.end())
|
| + return default_value;
|
| + return it->second;
|
| +}
|
| +
|
| } // namespace
|
|
|
| namespace data_reduction_proxy {
|
| @@ -185,6 +198,15 @@ const char* GetQuicFieldTrialName() {
|
| return kQuicFieldTrial;
|
| }
|
|
|
| +bool IsZeroRttQuicEnabled() {
|
| + if (!IsIncludedInQuicFieldTrial())
|
| + return false;
|
| + std::map<std::string, std::string> params;
|
| + variations::GetVariationParams(GetQuicFieldTrialName(), ¶ms);
|
| + return GetStringValueForVariationParamWithDefaultValue(
|
| + params, "enable_zero_rtt", "false") == "true";
|
| +}
|
| +
|
| bool IsConfigClientEnabled() {
|
| // Config client is enabled by default. It can be disabled only if Chromium
|
| // belongs to a field trial group whose name starts with "Disabled".
|
|
|