From a5dab48fa5e9ec0a4158ac10f84319bfd20fec08 Mon Sep 17 00:00:00 2001 From: Ali Beyad Date: Thu, 25 Apr 2024 22:18:20 +0000 Subject: [PATCH] mobile: Add a Cronvoy API to set the minimum DNS refresh Signed-off-by: Ali Beyad --- .../net/impl/NativeCronvoyEngineBuilderImpl.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mobile/library/java/org/chromium/net/impl/NativeCronvoyEngineBuilderImpl.java b/mobile/library/java/org/chromium/net/impl/NativeCronvoyEngineBuilderImpl.java index 2afc5b138d03..b91ca5baaf2a 100644 --- a/mobile/library/java/org/chromium/net/impl/NativeCronvoyEngineBuilderImpl.java +++ b/mobile/library/java/org/chromium/net/impl/NativeCronvoyEngineBuilderImpl.java @@ -96,6 +96,21 @@ public NativeCronvoyEngineBuilderImpl setDnsQueryTimeoutSeconds(int timeout) { return this; } + /** + * Set the DNS minimum refresh time, in seconds, which ensures that we wait to refresh a DNS + * entry for at least the minimum refresh time. For example, if the DNS record TTL is 60 seconds + * and setMinDnsRefreshSeconds(120) is invoked, then at least 120 seconds will transpire before + * the DNS entry for a host is refreshed. + * + * The default is 60s. + * + * @param minRefreshSeconds The DNS minimum refresh time, in seconds. + */ + public NativeCronvoyEngineBuilderImpl setMinDnsRefreshSeconds(int minRefreshSeconds) { + mDnsMinRefreshSeconds = minRefreshSeconds; + return this; + } + /** * Sets the boolean value for the reloadable runtime feature flag value. For example, to set the * Envoy runtime flag `envoy.reloadable_features.http_allow_partial_urls_in_referer` to true,