Bug 26175 - [GTK] Download progress notification should be throttled, for the benefit of download managers
Summary: [GTK] Download progress notification should be throttled, for the benefit of ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2009-06-03 15:32 PDT by Gustavo Noronha (kov)
Modified: 2009-06-06 18:43 PDT (History)
1 user (show)

See Also:


Attachments
Throttle download speed. (2.73 KB, patch)
2009-06-03 17:04 PDT, Gustavo Noronha (kov)
xan.lopez: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo Noronha (kov) 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.
Comment 1 Gustavo Noronha (kov) 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(-)
Comment 2 Xan Lopez 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).
Comment 3 Gustavo Noronha (kov) 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?