Bug 26175

Summary: [GTK] Download progress notification should be throttled, for the benefit of download managers
Product: WebKit Reporter: Gustavo Noronha (kov) <gustavo>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: xan.lopez
Priority: P2 Keywords: Gtk
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Attachments:
Description Flags
Throttle download speed. xan.lopez: review+

Gustavo Noronha (kov)
Reported 2009-06-03 15:32:11 PDT
This means less notifications for changes on the "progress" property. Someone who really wants to get all notifications can still connect to the "current-size" property.
Attachments
Throttle download speed. (2.73 KB, patch)
2009-06-03 17:04 PDT, Gustavo Noronha (kov)
xan.lopez: review+
Gustavo Noronha (kov)
Comment 1 2009-06-03 17:04:26 PDT
Created attachment 30932 [details] Throttle download speed. WebKit/gtk/ChangeLog | 16 ++++++++++++++++ WebKit/gtk/webkit/webkitdownload.cpp | 26 ++++++++++++++++++++++---- 2 files changed, 38 insertions(+), 4 deletions(-)
Xan Lopez
Comment 2 2009-06-06 01:51:10 PDT
Comment on attachment 30932 [details] Throttle download speed. Looks good to me. I wonder if current-size should be throttled too, in case it reports changes more often than needed (and uses too much CPU in doing so).
Gustavo Noronha (kov)
Comment 3 2009-06-06 18:43:15 PDT
Landed as r44485. About throttling current-size, my original patch did that, but the high CPU usage we experienced was not caused by the signal emissions (notice we already have signal emissions, and many function calls on that code path), but by the download manager updating the UI based on the emissions. I decided to not propose throttling the emissions of current-size and total-size, because then those properties will work for whoever wants to follow the progress more closely, while download managers can keep using the convenience property without having to do throttling themselves. Thoughts on that?
Note You need to log in before you can comment on or make changes to this bug.