[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 07:51:40 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit b807085a134b17ca3314861b532e40e5213c260a
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Aug 13 23:25:29 2003 +0000

    	Fixed 3376077.  Override automaticallyNotifiesObserversForKey: to
    	prevent unnecessary additional notifications from being sent.  Also
    	added development-only logging (bulk of the change).
    
            Reviewed by Chris.
    
            * Misc.subproj/WebKitLogging.h:
            * Misc.subproj/WebKitLogging.m:
            * WebView.subproj/WebDataSourcePrivate.m:
            (-[WebDataSource _setTitle:]):
            (-[WebDataSource _updateIconDatabaseWithURL:]):
            * WebView.subproj/WebViewPrivate.h:
            * WebView.subproj/WebViewPrivate.m:
            (-[WebView _didChangeValueForKey:]):
            (-[WebView _willChangeValueForKey:]):
            (-[WebView _progressStarted]):
            (-[WebView _progressCompleted]):
            (-[WebView _incrementProgressForConnection:data:]):
            (+[WebView automaticallyNotifiesObserversForKey:]):
            (-[WebView _willChangeBackForwardKeys]):
            (-[WebView _didChangeBackForwardKeys]):
            (-[WebView _didStartProvisionalLoadForFrame:]):
            (-[WebView _didCommitLoadForFrame:]):
            (-[WebView _didFinishLoadForFrame:]):
            (-[WebView _didFailLoadWithError:forFrame:]):
            (-[WebView _didFailProvisionalLoadWithError:forFrame:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4818 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index a463059..3d3eeaa 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,32 @@
+2003-08-13  Richard Williamson   <rjw at apple.com>
+
+	Fixed 3376077.  Override automaticallyNotifiesObserversForKey: to
+	prevent unnecessary additional notifications from being sent.  Also
+	added development-only logging (bulk of the change).
+
+        Reviewed by Chris.
+
+        * Misc.subproj/WebKitLogging.h:
+        * Misc.subproj/WebKitLogging.m:
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource _setTitle:]):
+        (-[WebDataSource _updateIconDatabaseWithURL:]):
+        * WebView.subproj/WebViewPrivate.h:
+        * WebView.subproj/WebViewPrivate.m:
+        (-[WebView _didChangeValueForKey:]):
+        (-[WebView _willChangeValueForKey:]):
+        (-[WebView _progressStarted]):
+        (-[WebView _progressCompleted]):
+        (-[WebView _incrementProgressForConnection:data:]):
+        (+[WebView automaticallyNotifiesObserversForKey:]):
+        (-[WebView _willChangeBackForwardKeys]):
+        (-[WebView _didChangeBackForwardKeys]):
+        (-[WebView _didStartProvisionalLoadForFrame:]):
+        (-[WebView _didCommitLoadForFrame:]):
+        (-[WebView _didFinishLoadForFrame:]):
+        (-[WebView _didFailLoadWithError:forFrame:]):
+        (-[WebView _didFailProvisionalLoadWithError:forFrame:]):
+
 2003-08-13  Chris Blumenberg  <cblu at apple.com>
 
 	Fixed: <rdar://problem/3347134>: After first successful POST in Flash, Safari does not repeat POST and gives cached reply
diff --git a/WebKit/Misc.subproj/WebKitLogging.h b/WebKit/Misc.subproj/WebKitLogging.h
index 8b10aea..a6e2ef5 100644
--- a/WebKit/Misc.subproj/WebKitLogging.h
+++ b/WebKit/Misc.subproj/WebKitLogging.h
@@ -33,3 +33,5 @@ extern WebLogChannel WebKitLogFormDelegate;
 extern WebLogChannel WebKitLogFileDatabaseActivity;
 
 extern WebLogChannel WebKitLogHistory;
+
+extern WebLogChannel WebKitLogBindings;
diff --git a/WebKit/Misc.subproj/WebKitLogging.m b/WebKit/Misc.subproj/WebKitLogging.m
index e08b2b6..3f9e1d1 100644
--- a/WebKit/Misc.subproj/WebKitLogging.m
+++ b/WebKit/Misc.subproj/WebKitLogging.m
@@ -29,3 +29,5 @@ WebLogChannel WebKitLogFormDelegate = 	        { 0x00200000, "WebKitLogLevel", W
 WebLogChannel WebKitLogFileDatabaseActivity =   { 0x00400000, "WebKitLogLevel", WebLogChannelUninitialized };
 
 WebLogChannel WebKitLogHistory =                { 0x00800000, "WebKitLogLevel", WebLogChannelUninitialized };
+
+WebLogChannel WebKitLogBindings =                { 0x01000000, "WebKitLogLevel", WebLogChannelUninitialized };
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 6b7a6b5..3cc4561 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -301,10 +301,10 @@
     if (!trimmed || [trimmed length] == 0)
         return;
         
-    [_private->webView willChangeValueForKey: _WebMainFrameTitleKey];
+    [_private->webView _willChangeValueForKey: _WebMainFrameTitleKey];
     [_private->pageTitle release];
     _private->pageTitle = [trimmed copy];
-    [_private->webView didChangeValueForKey: _WebMainFrameTitleKey];
+    [_private->webView _didChangeValueForKey: _WebMainFrameTitleKey];
     
     // The title doesn't get communicated to the WebView until we are committed.
     if (_private->committed) {
@@ -610,7 +610,7 @@
 
     
     if ([self webFrame] == [_private->webView mainFrame])
-        [_private->webView willChangeValueForKey:_WebMainFrameIconKey];
+        [_private->webView _willChangeValueForKey:_WebMainFrameIconKey];
     
     NSImage *icon = [iconDB iconForURL:[[self _URL] absoluteString] withSize:WebIconSmallSize];
     [[_private->webView _frameLoadDelegateForwarder] webView:_private->webView
@@ -618,7 +618,7 @@
                                                             forFrame:[self webFrame]];
     
     if ([self webFrame] == [_private->webView mainFrame])
-        [_private->webView didChangeValueForKey:_WebMainFrameIconKey];
+        [_private->webView _didChangeValueForKey:_WebMainFrameIconKey];
 }
 
 - (void)_iconLoaderReceivedPageIcon:(WebIconLoader *)iconLoader
diff --git a/WebKit/WebView.subproj/WebViewPrivate.h b/WebKit/WebView.subproj/WebViewPrivate.h
index 5bc7c49..cb6be3f 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.h
+++ b/WebKit/WebView.subproj/WebViewPrivate.h
@@ -243,6 +243,8 @@ Could be worth adding to the API.
 - (void)_didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
 - (void)_didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
 
+-  (void)_willChangeValueForKey:(NSString *)key;
+-  (void)_didChangeValueForKey:(NSString *)key;
 @end
 
 @interface _WebSafeForwarder : NSObject
diff --git a/WebKit/WebView.subproj/WebViewPrivate.m b/WebKit/WebView.subproj/WebViewPrivate.m
index 06b6157..04a4d91 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.m
+++ b/WebKit/WebView.subproj/WebViewPrivate.m
@@ -19,6 +19,7 @@
 #import <WebKit/WebFramePrivate.h>
 #import <WebKit/WebFrameViewPrivate.h>
 #import <WebKit/WebHistoryItemPrivate.h>
+#import <WebKit/WebKitLogging.h>
 #import <WebKit/WebNSPasteboardExtras.h>
 #import <WebKit/WebPreferencesPrivate.h>
 #import <WebKit/WebResourceLoadDelegate.h>
@@ -649,9 +650,22 @@ NSString *_WebMainFrameURLKey = @"mainFrameURL";
 #define UnknownTotalBytes -1
 #define WebProgressItemDefaultEstimatedLength 1024*16
 
+- (void)_didChangeValueForKey: (NSString *)key
+{
+    LOG (Bindings, "calling didChangeValueForKey: %@", key);
+    [self didChangeValueForKey: key];
+}
+
+- (void)_willChangeValueForKey: (NSString *)key
+{
+    LOG (Bindings, "calling willChangeValueForKey: %@", key);
+    [self willChangeValueForKey: key];
+}
+
+
 - (void)_progressStarted
 {
-    [self willChangeValueForKey: @"estimatedProgress"];
+    [self _willChangeValueForKey: @"estimatedProgress"];
     if (_private->numProgressTrackedFrames == 0){
         _private->totalPageAndResourceBytesToLoad = 0;
         _private->totalBytesReceived = 0;
@@ -660,12 +674,12 @@ NSString *_WebMainFrameURLKey = @"mainFrameURL";
         [[NSNotificationCenter defaultCenter] postNotificationName:WebViewProgressStartedNotification object:self];
     }
     _private->numProgressTrackedFrames++;
-    [self didChangeValueForKey: @"estimatedProgress"];
+    [self _didChangeValueForKey: @"estimatedProgress"];
 }
 
 - (void)_progressCompleted
 {
-    [self willChangeValueForKey: @"estimatedProgress"];
+    [self _willChangeValueForKey: @"estimatedProgress"];
     if (![[[self mainFrame] dataSource] isLoading])
         _private->numProgressTrackedFrames = 0;
         
@@ -675,7 +689,7 @@ NSString *_WebMainFrameURLKey = @"mainFrameURL";
         _private->progressValue = 1;
         [[NSNotificationCenter defaultCenter] postNotificationName:WebViewProgressFinishedNotification object:self];
     }
-    [self didChangeValueForKey: @"estimatedProgress"];
+    [self _didChangeValueForKey: @"estimatedProgress"];
 }
 
 - (void)_incrementProgressForConnection:(NSURLConnection *)con response:(NSURLResponse *)response;
@@ -712,7 +726,7 @@ NSString *_WebMainFrameURLKey = @"mainFrameURL";
     if (!item)
         return;
 
-    [self willChangeValueForKey: @"estimatedProgress"];
+    [self _willChangeValueForKey: @"estimatedProgress"];
 
     unsigned bytesReceived = [data length];
     double increment = 0, percentOfRemainingBytes;
@@ -746,7 +760,7 @@ NSString *_WebMainFrameURLKey = @"mainFrameURL";
         _private->lastNotifiedProgressValue = _private->progressValue;
     }
 
-    [self didChangeValueForKey: @"estimatedProgress"];
+    [self _didChangeValueForKey: @"estimatedProgress"];
 }
 
 - (void)_completeProgressForConnection:(NSURLConnection *)con
@@ -762,6 +776,11 @@ NSString *_WebMainFrameURLKey = @"mainFrameURL";
     item->estimatedLength = item->bytesReceived;
 }
 
+// Required to prevent automatic observer notifications.
++ (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key {
+    return NO;
+}
+
 - (NSArray *)_declaredKeys {
     static NSArray *declaredKeys = nil;
     
@@ -784,51 +803,51 @@ NSString *_WebMainFrameURLKey = @"mainFrameURL";
 
 - (void)_willChangeBackForwardKeys
 {
-    [self willChangeValueForKey: _WebCanGoBackKey];
-    [self willChangeValueForKey: _WebCanGoForwardKey];
+    [self _willChangeValueForKey: _WebCanGoBackKey];
+    [self _willChangeValueForKey: _WebCanGoForwardKey];
 }
 
 - (void)_didChangeBackForwardKeys
 {
-    [self didChangeValueForKey: _WebCanGoBackKey];
-    [self didChangeValueForKey: _WebCanGoForwardKey];
+    [self _didChangeValueForKey: _WebCanGoBackKey];
+    [self _didChangeValueForKey: _WebCanGoForwardKey];
 }
 
 - (void)_didStartProvisionalLoadForFrame:(WebFrame *)frame
 {
     [self _willChangeBackForwardKeys];
     if (frame == [self mainFrame]){
-        [self willChangeValueForKey: _WebIsLoadingKey];
-        [self willChangeValueForKey: _WebMainFrameURLKey];
+        [self _willChangeValueForKey: _WebIsLoadingKey];
+        [self _willChangeValueForKey: _WebMainFrameURLKey];
     }
 }
 
 - (void)_didCommitLoadForFrame:(WebFrame *)frame
 {
     if (frame == [self mainFrame])
-        [self didChangeValueForKey: _WebMainFrameURLKey];
+        [self _didChangeValueForKey: _WebMainFrameURLKey];
 }
 
 - (void)_didFinishLoadForFrame:(WebFrame *)frame
 {
     [self _didChangeBackForwardKeys];
     if (frame == [self mainFrame])
-        [self didChangeValueForKey: _WebIsLoadingKey];
+        [self _didChangeValueForKey: _WebIsLoadingKey];
 }
 
 - (void)_didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame
 {
     [self _didChangeBackForwardKeys];
     if (frame == [self mainFrame])
-        [self didChangeValueForKey: _WebIsLoadingKey];
+        [self _didChangeValueForKey: _WebIsLoadingKey];
 }
 
 - (void)_didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame
 {
     [self _didChangeBackForwardKeys];
     if (frame == [self mainFrame]){
-        [self didChangeValueForKey: _WebIsLoadingKey];
-        [self didChangeValueForKey: _WebMainFrameURLKey];
+        [self _didChangeValueForKey: _WebIsLoadingKey];
+        [self _didChangeValueForKey: _WebMainFrameURLKey];
     }
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list