Changeset 246615 in webkit
- Timestamp:
- Jun 19, 2019, 4:36:35 PM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
NetworkProcess/Downloads/DownloadMonitor.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r246608 r246615 1 2019-06-19 Alex Christensen <achristensen@webkit.org> 2 3 DownloadMonitor::measuredThroughputRate should approach zero with no throughput 4 https://bugs.webkit.org/show_bug.cgi?id=198981 5 <rdar://problem/51456914> 6 7 Reviewed by Geoffrey Garen. 8 9 When the timer fires to approximate the download rate, add a new timestamp with 0 bytes received since the last time we received bytes. 10 Then, if there's only one timestamp, assume the throughput rate is 0 instead of infinite. 11 This will prevent false positives estimating large download rates based on old data when the throughput drops to 0. 12 13 * NetworkProcess/Downloads/DownloadMonitor.cpp: 14 (WebKit::DownloadMonitor::measuredThroughputRate const): 15 (WebKit::DownloadMonitor::timerFired): 16 1 17 2019-06-19 Sihui Liu <sihui_liu@apple.com> 2 18 -
trunk/Source/WebKit/NetworkProcess/Downloads/DownloadMonitor.cpp
r243110 r246615 79 79 double seconds = timeDifference.seconds(); 80 80 if (!seconds) 81 return std::numeric_limits<double>::max();81 return 0; 82 82 return bytes / seconds; 83 83 } … … 114 114 void DownloadMonitor::timerFired() 115 115 { 116 downloadReceivedBytes(0); 117 116 118 RELEASE_ASSERT(m_interval < WTF_ARRAY_LENGTH(throughputIntervals)); 117 119 if (measuredThroughputRate() < throughputIntervals[m_interval].bytesPerSecond) {
Note:
See TracChangeset
for help on using the changeset viewer.