[webkit-changes] [WebKit/WebKit] 50f926: Set timeout for optimistically upgraded navigation...

Matthew Finkel noreply at github.com
Wed Sep 11 10:48:26 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 50f926d27862352367373c172fc56426b225789e
      https://github.com/WebKit/WebKit/commit/50f926d27862352367373c172fc56426b225789e
  Author: Matthew Finkel <sysrqb at apple.com>
  Date:   2024-09-11 (Wed, 11 Sep 2024)

  Changed paths:
    M Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp
    M Source/WebKit/NetworkProcess/NetworkSession.cpp
    M Source/WebKit/NetworkProcess/NetworkSession.h

  Log Message:
  -----------
  Set timeout for optimistically upgraded navigations based on current network conditions
https://bugs.webkit.org/show_bug.cgi?id=278504
rdar://134458774

Reviewed by Alex Christensen.

This change implements a mechanism for dynamically setting the connection
timeout for requests that were optimistically upgraded. Currently, the timeout
is hard-coded, but there won't be a single hard-coded value that will be
appropriate for all networks. Therefore, in this patch I added a mechanism for
tracking the last 25 requests that used newly established TLS connections and
computes the exponentially weighed moving average (EWMA).

This patch sets a minimum (and default) timeout of 3 seconds, and the EMWA
skews the average toward more recent entries.

* Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::startNetworkLoad):

Apply the appropriate timeout.

(WebKit::NetworkResourceLoader::didReceiveResponse):

Record this load, if appropriate.

* Source/WebKit/NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
(WebKit::connectionTimesMovingAverage):
(WebKit::NetworkSession::recordHTTPSConnectionTiming):

Implement EWMA and compute the current average.

* Source/WebKit/NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::currentHTTPSConnectionAverageTiming const):

Canonical link: https://commits.webkit.org/283494@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list