BRM054_Always-respect-async-dns-flag-regardless-of-SDK-version-do-not-read-experiment-value-for-cronet-async-DNS-configuration.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From: csagan5 <32685696+csagan5@users.noreply.github.com>
  2. Date: Tue, 5 Jun 2018 13:46:40 +0200
  3. Subject: Always respect async dns flag (regardless of SDK version), do not
  4. read experiment value for cronet async DNS configuration
  5. ---
  6. chrome/browser/io_thread.cc | 10 +---------
  7. components/cronet/url_request_context_config.cc | 3 ++-
  8. 2 files changed, 3 insertions(+), 10 deletions(-)
  9. diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
  10. --- a/chrome/browser/io_thread.cc
  11. +++ b/chrome/browser/io_thread.cc
  12. @@ -257,15 +257,7 @@ void UpdateMetricsUsagePrefsOnUIThread(const std::string& service_name,
  13. // Check the AsyncDns field trial and return true if it should be enabled. On
  14. // Android this includes checking the Android version in the field trial.
  15. bool ShouldEnableAsyncDns() {
  16. - bool feature_can_be_enabled = true;
  17. -#if defined(OS_ANDROID)
  18. - int min_sdk =
  19. - base::GetFieldTrialParamByFeatureAsInt(features::kAsyncDns, "min_sdk", 0);
  20. - if (base::android::BuildInfo::GetInstance()->sdk_int() < min_sdk)
  21. - feature_can_be_enabled = false;
  22. -#endif
  23. - return feature_can_be_enabled &&
  24. - base::FeatureList::IsEnabled(features::kAsyncDns);
  25. + return base::FeatureList::IsEnabled(features::kAsyncDns);
  26. }
  27. } // namespace
  28. diff --git a/components/cronet/url_request_context_config.cc b/components/cronet/url_request_context_config.cc
  29. --- a/components/cronet/url_request_context_config.cc
  30. +++ b/components/cronet/url_request_context_config.cc
  31. @@ -398,7 +398,8 @@ void URLRequestContextConfig::ParseAndSetExperimentalOptions(
  32. effective_experimental_options->Remove(it.key(), nullptr);
  33. continue;
  34. }
  35. - async_dns_args->GetBoolean(kAsyncDnsEnable, &async_dns_enable);
  36. + bool ignored;
  37. + async_dns_args->GetBoolean(kAsyncDnsEnable, &ignored);
  38. } else if (it.key() == kStaleDnsFieldTrialName) {
  39. const base::DictionaryValue* stale_dns_args = nullptr;
  40. if (!it.value().GetAsDictionary(&stale_dns_args)) {
  41. --
  42. 2.7.4