WebKit Bugzilla
Attachment 372405 Details for
Bug 198981
: DownloadMonitor::measuredThroughputRate should approach zero with no throughput
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198981-20190618164200.patch (text/plain), 2.37 KB, created by
Alex Christensen
on 2019-06-18 16:42:01 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2019-06-18 16:42:01 PDT
Size:
2.37 KB
patch
obsolete
>Subversion Revision: 246563 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 3371ccfc311e6d83adb40c0804628c8b82ce54fd..ac906bb3298d59afa10f132a729f4e770c50f7e7 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,19 @@ >+2019-06-18 Alex Christensen <achristensen@webkit.org> >+ >+ DownloadMonitor::measuredThroughputRate should approach zero with no throughput >+ https://bugs.webkit.org/show_bug.cgi?id=198981 >+ <rdar://problem/51456914> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When the timer fires to approximate the download rate, add a new timestamp with 0 bytes received since the last time we received bytes. >+ Then, if there's only one timestamp, assume the throughput rate is 0 instead of infinite. >+ This will prevent false positives estimating large download rates based on old data when the throughput drops to 0. >+ >+ * NetworkProcess/Downloads/DownloadMonitor.cpp: >+ (WebKit::DownloadMonitor::measuredThroughputRate const): >+ (WebKit::DownloadMonitor::timerFired): >+ > 2019-06-18 John Wilander <wilander@apple.com> > > Change log channel name from ResourceLoadStatisticsDebug to ITPDebug and remove unnecessary #if !RELEASE_LOG_DISABLED >diff --git a/Source/WebKit/NetworkProcess/Downloads/DownloadMonitor.cpp b/Source/WebKit/NetworkProcess/Downloads/DownloadMonitor.cpp >index 5f50475c15f4fe84c97f6b515ac5d8d46067bdda..36da1459ee50d262e68e97e71453cb2c2c7913dc 100644 >--- a/Source/WebKit/NetworkProcess/Downloads/DownloadMonitor.cpp >+++ b/Source/WebKit/NetworkProcess/Downloads/DownloadMonitor.cpp >@@ -78,7 +78,7 @@ double DownloadMonitor::measuredThroughputRate() const > Seconds timeDifference = m_timestamps.last().time.secondsSinceEpoch() - m_timestamps.first().time.secondsSinceEpoch(); > double seconds = timeDifference.seconds(); > if (!seconds) >- return std::numeric_limits<double>::max(); >+ return 0; > return bytes / seconds; > } > >@@ -113,6 +113,8 @@ uint32_t DownloadMonitor::speedMultiplier() const > > void DownloadMonitor::timerFired() > { >+ downloadReceivedBytes(0); >+ > RELEASE_ASSERT(m_interval < WTF_ARRAY_LENGTH(throughputIntervals)); > if (measuredThroughputRate() < throughputIntervals[m_interval].bytesPerSecond) { > RELEASE_LOG_IF_ALLOWED("timerFired: cancelling download (id = %" PRIu64 ")", m_download.downloadID().downloadID());
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198981
: 372405