[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:01:31 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 721eba3eae0a6c7f4b6a77bf41e555a587742e69
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 15 01:32:11 2003 +0000

    WebBrowser:
    	Use WebKit estimated progress scheme.  I've left the old
    	scheme in place.  You can get the old behavior by turning off the
    	"Use Alternate Progress" item in the debug menu.  The new code is
    	much simpler than the old code.  Once we decide to move ahead with the
    	new scheme we can do a serious root canal.
    
            Reviewed by Chris.
    
            * BrowserWebController.m:
            (-[BrowserWebView initWithDocument:request:frameName:]):
            (-[BrowserWebView dealloc]):
            (-[BrowserWebView isLoading]):
            (-[BrowserWebView progressStarted:]):
            (-[BrowserWebView progressChanged:]):
            (-[BrowserWebView progressFinished:]):
            * BrowserWindowController.h:
            * BrowserWindowController.m:
            (-[BrowserWindowController updateProgressBar]):
            (-[BrowserWindowController newUpdateProgressBar]):
            (-[BrowserWindowController clearProgressBar]):
            * Debug/DebugUtilities.h:
            * Debug/DebugUtilities.m:
            (-[DebugUtilities init]):
            (-[DebugUtilities useAlternateProgress]):
            (-[DebugUtilities setUseAlternateProgress:]):
            (-[DebugUtilities createDebugMenu]):
            (-[BrowserDocument toggleBackForwardEnabled:]):
            (-[BrowserDocument toggleAlternateProgress:]):
            * TextFieldWithControls.m:
            (-[TextFieldWithControls setProgressBarValue:]):
    
    WebKit:
            Added logging for estimated progress.
    
            Added a time delta to the throttler, so we now send notifications
            if a delta amount has been exceeded OR a delta between notifications
            has been exceeded.
    
            Reviewed by Chris.
    
            * Misc.subproj/WebKitLogging.h:
            * Misc.subproj/WebKitLogging.m:
            * WebView.subproj/WebView.m:
            (-[WebViewPrivate init]):
            (-[WebView _progressStarted]):
            (-[WebView _progressCompleted]):
            (-[WebView _incrementProgressForConnection:data:]):
            * WebView.subproj/WebViewPrivate.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5184 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 31e6c70..7e8eb09 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,22 @@
+2003-10-14  Richard Williamson   <rjw at apple.com>
+
+        Added logging for estimated progress.
+        
+        Added a time delta to the throttler, so we now send notifications
+        if a delta amount has been exceeded OR a delta between notifications
+        has been exceeded.
+
+        Reviewed by Chris.
+
+        * Misc.subproj/WebKitLogging.h:
+        * Misc.subproj/WebKitLogging.m:
+        * WebView.subproj/WebView.m:
+        (-[WebViewPrivate init]):
+        (-[WebView _progressStarted]):
+        (-[WebView _progressCompleted]):
+        (-[WebView _incrementProgressForConnection:data:]):
+        * WebView.subproj/WebViewPrivate.h:
+
 2003-10-14  Ken Kocienda  <kocienda at apple.com>
 
         Reviewed by Darin
diff --git a/WebKit/Misc.subproj/WebKitLogging.h b/WebKit/Misc.subproj/WebKitLogging.h
index 8439cb4..752b0fe 100644
--- a/WebKit/Misc.subproj/WebKitLogging.h
+++ b/WebKit/Misc.subproj/WebKitLogging.h
@@ -32,3 +32,4 @@ extern WebLogChannel WebKitLogBindings;
 extern WebLogChannel WebKitLogEncoding;
 extern WebLogChannel WebKitLogLiveConnect;
 extern WebLogChannel WebKitLogBackForward;
+extern WebLogChannel WebKitLogProgress;
diff --git a/WebKit/Misc.subproj/WebKitLogging.m b/WebKit/Misc.subproj/WebKitLogging.m
index 8d6f935..2a8bc59 100644
--- a/WebKit/Misc.subproj/WebKitLogging.m
+++ b/WebKit/Misc.subproj/WebKitLogging.m
@@ -28,4 +28,5 @@ WebLogChannel WebKitLogFontSelection =	        { 0x02000000, "WebKitLogLevel", W
 WebLogChannel WebKitLogEncoding =               { 0x04000000, "WebKitLogLevel", WebLogChannelUninitialized };
 WebLogChannel WebKitLogLiveConnect =            { 0x08000000, "WebKitLogLevel", WebLogChannelUninitialized };
 WebLogChannel WebKitLogBackForward =            { 0x10000000, "WebKitLogLevel", WebLogChannelUninitialized };
+WebLogChannel WebKitLogProgress =               { 0x20000000, "WebKitLogLevel", WebLogChannelUninitialized };
 
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index 7e4bd2b..730cd22 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -104,6 +104,7 @@ NSString *_WebMainFrameURLKey = @"mainFrameURL";
     backForwardList = [[WebBackForwardList alloc] init];
     textSizeMultiplier = 1;
     progressNotificationInterval = 0.02;
+    progressNotificationTimeInterval = 0.1;
     settings = [[WebCoreSettings alloc] init];
 
     return self;
@@ -707,6 +708,10 @@ NSString *_WebMainFrameURLKey = @"mainFrameURL";
     [self willChangeValueForKey: key];
 }
 
+// Always start progress at INITIAL_PROGRESS_VALUE so it appears progress indicators
+// will immediately show some progress.  This helps provide feedback as soon as a load
+// starts.
+#define INITIAL_PROGRESS_VALUE 0.1
 
 - (void)_progressStarted
 {
@@ -714,8 +719,10 @@ NSString *_WebMainFrameURLKey = @"mainFrameURL";
     if (_private->numProgressTrackedFrames == 0){
         _private->totalPageAndResourceBytesToLoad = 0;
         _private->totalBytesReceived = 0;
-        _private->progressValue = 0;
+        _private->progressValue = INITIAL_PROGRESS_VALUE;
         _private->lastNotifiedProgressValue = 0;
+        _private->lastNotifiedProgressTime = 0;
+        LOG (Progress, "");
         [[NSNotificationCenter defaultCenter] postNotificationName:WebViewProgressStartedNotification object:self];
     }
     _private->numProgressTrackedFrames++;
@@ -724,14 +731,16 @@ NSString *_WebMainFrameURLKey = @"mainFrameURL";
 
 - (void)_progressCompleted
 {
+    ASSERT (_private->numProgressTrackedFrames > 0);
+    
     [self _willChangeValueForKey: @"estimatedProgress"];
-    if (![[[self mainFrame] dataSource] isLoading])
-        _private->numProgressTrackedFrames = 0;
-        
+
+    _private->numProgressTrackedFrames--;
     if (_private->numProgressTrackedFrames == 0){
         [_private->progressItems release];
         _private->progressItems = nil;
         _private->progressValue = 1;
+        LOG (Progress, "");
         [[NSNotificationCenter defaultCenter] postNotificationName:WebViewProgressFinishedNotification object:self];
     }
     [self _didChangeValueForKey: @"estimatedProgress"];
@@ -799,8 +808,16 @@ NSString *_WebMainFrameURLKey = @"mainFrameURL";
     if (_private->progressValue > 1.0)
         _private->progressValue = 1.0;
 
+    double now = CFAbsoluteTimeGetCurrent();
+    double notifiedProgressTimeDelta = CFAbsoluteTimeGetCurrent() - _private->lastNotifiedProgressTime;
+    _private->lastNotifiedProgressTime = now;
+    
     double notificationProgressDelta = _private->progressValue - _private->lastNotifiedProgressValue;
-    if (notificationProgressDelta >= _private->progressNotificationInterval){
+    if ((notificationProgressDelta >= _private->progressNotificationInterval ||
+        notifiedProgressTimeDelta >= _private->progressNotificationTimeInterval) &&
+        _private->numProgressTrackedFrames > 0){
+
+        LOG (Progress, "_private->progressValue %g", _private->progressValue);
         [[NSNotificationCenter defaultCenter] postNotificationName:WebViewProgressEstimateChangedNotification object:self];
         _private->lastNotifiedProgressValue = _private->progressValue;
     }
diff --git a/WebKit/WebView.subproj/WebViewPrivate.h b/WebKit/WebView.subproj/WebViewPrivate.h
index 0a33864..2636784 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.h
+++ b/WebKit/WebView.subproj/WebViewPrivate.h
@@ -80,7 +80,9 @@ extern NSString *_WebMainFrameURLKey;
     long long totalBytesReceived;
     double progressValue;
     double lastNotifiedProgressValue;
+    double lastNotifiedProgressTime;
     double progressNotificationInterval;
+    double progressNotificationTimeInterval;
     
     int numProgressTrackedFrames;
     NSMutableDictionary *progressItems;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list