[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:59 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 572e197a306bc5e4b987c386b359c6273c169d0e
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Oct 16 19:56:17 2003 +0000
WebBrowser:
Coalesce drawing of progress bar (like old behavior). This fixes a performance regression.
Always draw the progress at 100% for a short interval after loading a page (like the old behavior).
Reviewed by Hyatt.
* BrowserWebController.m:
(-[BrowserWebView initWithDocument:request:frameName:]):
(-[BrowserWebView progressStarted:]):
(-[BrowserWebView progressChanged:]):
(-[BrowserWebView progressFinished:]):
* BrowserWindowController.h:
* BrowserWindowController.m:
(-[BrowserWindowController _newUpdateProgressBar]):
(-[BrowserWindowController newUpdateProgressBar]):
(-[BrowserWindowController showCompleteProgressBar]):
(-[BrowserWindowController clearProgressBar]):
* TextFieldWithControls.m:
(-[TextFieldWithControls setProgressBarValue:]):
WebKit:
Tweaked the progress behavior and factored cleanup of progress
related ivars.
Reviewed by Hyatt.
* WebView.subproj/WebDataSource.m:
(-[WebDataSource _startLoading:]):
* WebView.subproj/WebFrame.m:
(-[WebFrame _isLoadComplete]):
* WebView.subproj/WebView.m:
(-[WebView _resetProgress]):
(-[WebView _progressStarted:]):
(-[WebView _finalProgressComplete]):
(-[WebView _progressCompleted:]):
(-[WebView _incrementProgressForConnection:data:]):
* WebView.subproj/WebViewPrivate.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 7e8eb09..22ef4fb 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,22 @@
+2003-10-16 Richard Williamson <rjw at apple.com>
+
+ Tweaked the progress behavior and factored cleanup of progress
+ related ivars.
+
+ Reviewed by Hyatt.
+
+ * WebView.subproj/WebDataSource.m:
+ (-[WebDataSource _startLoading:]):
+ * WebView.subproj/WebFrame.m:
+ (-[WebFrame _isLoadComplete]):
+ * WebView.subproj/WebView.m:
+ (-[WebView _resetProgress]):
+ (-[WebView _progressStarted:]):
+ (-[WebView _finalProgressComplete]):
+ (-[WebView _progressCompleted:]):
+ (-[WebView _incrementProgressForConnection:data:]):
+ * WebView.subproj/WebViewPrivate.h:
+
2003-10-14 Richard Williamson <rjw at apple.com>
Added logging for estimated progress.
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index c286e42..6a05344 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -179,7 +179,7 @@
[self _setLoading:YES];
- [_private->webView _progressStarted];
+ [_private->webView _progressStarted:[self webFrame]];
[_private->webView _didStartProvisionalLoadForFrame:[self webFrame]];
[[_private->webView _frameLoadDelegateForwarder] webView:_private->webView
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index ea853f6..f796a64 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -1008,7 +1008,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
}
}
- [[self webView] _progressCompleted];
+ [[self webView] _progressCompleted: self];
if ([ds _mainDocumentError]) {
[[self webView] _didFailLoadWithError:[ds _mainDocumentError] forFrame:self];
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index 730cd22..3da8035 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -713,35 +713,60 @@ NSString *_WebMainFrameURLKey = @"mainFrameURL";
// starts.
#define INITIAL_PROGRESS_VALUE 0.1
-- (void)_progressStarted
-{
+- (void)_resetProgress
+{
+ [_private->progressItems release];
+ _private->progressItems = nil;
+ _private->totalPageAndResourceBytesToLoad = 0;
+ _private->totalBytesReceived = 0;
+ _private->progressValue = INITIAL_PROGRESS_VALUE;
+ _private->lastNotifiedProgressValue = 0;
+ _private->lastNotifiedProgressTime = 0;
+ _private->finalProgressChangedSent = NO;
+ _private->numProgressTrackedFrames = 0;
+ [_private->orginatingProgressFrame release];
+ _private->orginatingProgressFrame = nil;
+}
+- (void)_progressStarted:(WebFrame *)frame
+{
+ LOG (Progress, "frame %p(%@), _private->numProgressTrackedFrames %d, _private->orginatingProgressFrame %p", frame, [frame name], _private->numProgressTrackedFrames, _private->orginatingProgressFrame);
[self _willChangeValueForKey: @"estimatedProgress"];
- if (_private->numProgressTrackedFrames == 0){
- _private->totalPageAndResourceBytesToLoad = 0;
- _private->totalBytesReceived = 0;
- _private->progressValue = INITIAL_PROGRESS_VALUE;
- _private->lastNotifiedProgressValue = 0;
- _private->lastNotifiedProgressTime = 0;
- LOG (Progress, "");
+ if (_private->numProgressTrackedFrames == 0 || _private->orginatingProgressFrame == frame){
+ [self _resetProgress];
+ _private->orginatingProgressFrame = [frame retain];
[[NSNotificationCenter defaultCenter] postNotificationName:WebViewProgressStartedNotification object:self];
}
_private->numProgressTrackedFrames++;
[self _didChangeValueForKey: @"estimatedProgress"];
}
-- (void)_progressCompleted
+- (void)_finalProgressComplete
+{
+ LOG (Progress, "");
+
+ // Before resetting progress value be sure to send client a least one notification
+ // with final progress value.
+ if (!_private->finalProgressChangedSent) {
+ _private->progressValue = 1;
+ [[NSNotificationCenter defaultCenter] postNotificationName:WebViewProgressEstimateChangedNotification object:self];
+ }
+
+ [self _resetProgress];
+
+ [[NSNotificationCenter defaultCenter] postNotificationName:WebViewProgressFinishedNotification object:self];
+}
+
+- (void)_progressCompleted:(WebFrame *)frame
{
ASSERT (_private->numProgressTrackedFrames > 0);
+ LOG (Progress, "frame %p(%@), _private->numProgressTrackedFrames %d, _private->orginatingProgressFrame %p", frame, [frame name], _private->numProgressTrackedFrames, _private->orginatingProgressFrame);
[self _willChangeValueForKey: @"estimatedProgress"];
_private->numProgressTrackedFrames--;
- if (_private->numProgressTrackedFrames == 0){
- [_private->progressItems release];
- _private->progressItems = nil;
- _private->progressValue = 1;
- LOG (Progress, "");
- [[NSNotificationCenter defaultCenter] postNotificationName:WebViewProgressFinishedNotification object:self];
+ if (_private->numProgressTrackedFrames == 0 ||
+ (frame == _private->orginatingProgressFrame && _private->numProgressTrackedFrames != 0)){
+ [self _finalProgressComplete];
}
[self _didChangeValueForKey: @"estimatedProgress"];
}
@@ -812,14 +837,17 @@ NSString *_WebMainFrameURLKey = @"mainFrameURL";
double notifiedProgressTimeDelta = CFAbsoluteTimeGetCurrent() - _private->lastNotifiedProgressTime;
_private->lastNotifiedProgressTime = now;
+ LOG (Progress, "_private->progressValue %g, _private->numProgressTrackedFrames %d", _private->progressValue, _private->numProgressTrackedFrames);
double notificationProgressDelta = _private->progressValue - _private->lastNotifiedProgressValue;
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;
+ notifiedProgressTimeDelta >= _private->progressNotificationTimeInterval) &&
+ _private->numProgressTrackedFrames > 0) {
+ if (!_private->finalProgressChangedSent) {
+ if (_private->progressValue == 1)
+ _private->finalProgressChangedSent = YES;
+ [[NSNotificationCenter defaultCenter] postNotificationName:WebViewProgressEstimateChangedNotification object:self];
+ _private->lastNotifiedProgressValue = _private->progressValue;
+ }
}
[self _didChangeValueForKey: @"estimatedProgress"];
diff --git a/WebKit/WebView.subproj/WebViewPrivate.h b/WebKit/WebView.subproj/WebViewPrivate.h
index 2636784..417ca8b 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.h
+++ b/WebKit/WebView.subproj/WebViewPrivate.h
@@ -83,6 +83,8 @@ extern NSString *_WebMainFrameURLKey;
double lastNotifiedProgressTime;
double progressNotificationInterval;
double progressNotificationTimeInterval;
+ BOOL finalProgressChangedSent;
+ WebFrame *orginatingProgressFrame;
int numProgressTrackedFrames;
NSMutableDictionary *progressItems;
@@ -235,8 +237,8 @@ Could be worth adding to the API.
- (BOOL)_isPerformingProgrammaticFocus;
// Methods dealing with the estimated progress completion.
-- (void)_progressStarted;
-- (void)_progressCompleted;
+- (void)_progressStarted:(WebFrame *)frame;
+- (void)_progressCompleted:(WebFrame *)frame;
- (void)_incrementProgressForConnection:(NSURLConnection *)con response:(NSURLResponse *)response;
- (void)_incrementProgressForConnection:(NSURLConnection *)con data:(NSData *)dataSource;
- (void)_completeProgressForConnection:(NSURLConnection *)con;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list