[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 00:51:03 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit a9c899d507238cbdc16dd682c750266a07018be4
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Dec 28 16:48:55 2009 +0000

    2009-12-28  Estêvão Samuel Procópio  <tevaum at gmail.com>
    
            Reviewed by Gustavo Noronha Silva.
    
            Bug 32940: [GTK] Changing the download throttle conditions.
            https://bugs.webkit.org/show_bug.cgi?id=32716
    
            The WebKitDownload progress notification was taking long to
            update. This fix makes notification happens each 0.7 secs
            or when the progress ups in 1%.
    
            * WebKit/gtk/webkit/webkitdownload.cpp:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52597 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/ChangeLog b/ChangeLog
index 3595508..8c10f03 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2009-12-28  Estêvão Samuel Procópio  <tevaum at gmail.com>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Bug 32940: [GTK] Changing the download throttle conditions.
+        https://bugs.webkit.org/show_bug.cgi?id=32716
+
+        The WebKitDownload progress notification was taking long to
+        update. This fix makes notification happens each 0.7 secs
+        or when the progress ups in 1%.
+
+        * WebKit/gtk/webkit/webkitdownload.cpp:
+
 2009-12-22  Simon Hausmann  <simon.hausmann at nokia.com>
 
         Rubber-stamped by Holger Freyther.
diff --git a/WebKit/gtk/webkit/webkitdownload.cpp b/WebKit/gtk/webkit/webkitdownload.cpp
index a1b64e0..1912a12 100644
--- a/WebKit/gtk/webkit/webkitdownload.cpp
+++ b/WebKit/gtk/webkit/webkitdownload.cpp
@@ -854,22 +854,24 @@ static void webkit_download_received_data(WebKitDownload* download, const gchar*
     if (priv->currentSize > webkit_download_get_total_size(download))
         g_object_notify(G_OBJECT(download), "total-size");
 
-    gdouble lastProgress = webkit_download_get_progress(download);
-
     // Throttle progress notification to not consume high amounts of
-    // CPU on fast links, except when the progress is >= 3%, or we
-    // reached the end.
+    // CPU on fast links, except when the last notification occured
+    // in more then 0.7 secs from now, or the last notified progress
+    // is passed in 1% or we reached the end.
+    static gdouble lastProgress = 0;
     static gdouble lastElapsed = 0;
     gdouble currentElapsed = g_timer_elapsed(priv->timer, NULL);
+    gdouble currentProgress = webkit_download_get_progress(download);
 
     if (lastElapsed
-        && (currentElapsed - lastElapsed) < 0.1
-        && (webkit_download_get_progress(download) - lastProgress) < 0.03
-        && webkit_download_get_progress(download) < 1.0) {
-        lastElapsed = currentElapsed;
+        && lastProgress
+        && (currentElapsed - lastElapsed) < 0.7
+        && (currentProgress - lastProgress) < 0.01
+        && currentProgress < 1.0) {
         return;
     }
     lastElapsed = currentElapsed;
+    lastProgress = currentProgress;
 
     g_object_notify(G_OBJECT(download), "progress");
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list