Chromium Code Reviews| Index: components/cronet/url_request_context_config.cc |
| diff --git a/components/cronet/url_request_context_config.cc b/components/cronet/url_request_context_config.cc |
| index e4b4a77376f2a3eb9641456d0839af42befffda9..4f4d1e91d3925a6a3d6f773915d3496580332b0a 100644 |
| --- a/components/cronet/url_request_context_config.cc |
| +++ b/components/cronet/url_request_context_config.cc |
| @@ -73,6 +73,11 @@ const char kStaleDnsMaxStaleUses[] = "max_stale_uses"; |
| // Name of boolean to allow stale DNS results from other networks to be used on |
| // the current network. |
| const char kStaleDnsAllowOtherNetwork[] = "allow_other_network"; |
| +// Name of boolean to enable persisting the DNS cache to disk. |
| +const char kStaleDnsPersist[] = "persist_to_disk"; |
| +// Name of integer minimum time in milliseconds between writes to disk for DNS |
| +// cache persistence. |
|
pauljensen
2017/06/26 16:37:17
Can we mention that it defaults to one minute?
pauljensen
2017/06/26 16:37:17
Can we mention that it only has an effect if kStal
mgersh
2017/06/26 23:21:45
Done.
mgersh
2017/06/26 23:21:45
Done.
|
| +const char kStaleDnsPersistTimer[] = "persist_timer_ms"; |
|
pauljensen
2017/06/26 16:37:17
similar to url_request_context_config.h:175, can w
mgersh
2017/06/26 23:21:45
Done.
|
| // Rules to override DNS resolution. Intended for testing. |
| // See explanation of format in net/dns/mapped_host_resolver.h. |
| @@ -292,6 +297,12 @@ void URLRequestContextConfig::ParseAndSetExperimentalOptions( |
| &allow_other_network)) { |
| stale_dns_options.allow_other_network = allow_other_network; |
| } |
| + bool persist; |
| + if (stale_dns_args->GetBoolean(kStaleDnsPersist, &persist)) |
| + enable_host_cache_persistence = persist; |
| + int persist_timer; |
| + if (stale_dns_args->GetInteger(kStaleDnsPersistTimer, &persist_timer)) |
| + host_cache_persistence_timer = persist_timer; |
| } |
| } else if (it.key() == kHostResolverRulesFieldTrialName) { |
| const base::DictionaryValue* host_resolver_rules_args = nullptr; |