diff --git a/mobile/library/java/org/chromium/net/impl/NativeCronvoyEngineBuilderImpl.java b/mobile/library/java/org/chromium/net/impl/NativeCronvoyEngineBuilderImpl.java index b72441e6be8d..243c64df08d2 100644 --- a/mobile/library/java/org/chromium/net/impl/NativeCronvoyEngineBuilderImpl.java +++ b/mobile/library/java/org/chromium/net/impl/NativeCronvoyEngineBuilderImpl.java @@ -53,7 +53,7 @@ public class NativeCronvoyEngineBuilderImpl extends CronvoyEngineBuilderImpl { private final int mH2ConnectionKeepaliveIdleIntervalMilliseconds = 1; private final int mH2ConnectionKeepaliveTimeoutSeconds = 10; private final int mMaxConnectionsPerHost = 7; - private final int mStreamIdleTimeoutSeconds = 15; + private int mStreamIdleTimeoutSeconds = 15; private final int mPerTryIdleTimeoutSeconds = 15; private final String mAppVersion = "unspecified"; private final String mAppId = "unspecified"; @@ -111,6 +111,19 @@ public NativeCronvoyEngineBuilderImpl setMinDnsRefreshSeconds(int minRefreshSeco return this; } + /** + * Set the stream idle timeout, in seconds, which is defined as the period in which there are no + * active requests. When the idle timeout is reached, the connection is closed. + * + * The default is 15s. + * + * @param timeout The stream idle timeout, in seconds. + */ + public NativeCronvoyEngineBuilderImpl setStreamIdleTimeoutSeconds(int timeout) { + mStreamIdleTimeoutSeconds = timeout; + 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,