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

sullivan sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:27:49 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 58f9bf7b7777acaeed41e09dfa26098aec1d126a
Author: sullivan <sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Feb 27 22:50:55 2004 +0000

    WebKit:
    
            - WebKit changes to allow performance improvements to bookmarks
    
            Reviewed by Darin.
    
            * History.subproj/WebHistoryItemPrivate.h:
            added notificationsSuppressed/setNotificationsSuppressed, and setURLString
            * History.subproj/WebHistoryItem.m:
            (-[WebHistoryItem setNotificationsSuppressed:]):
            setter for new flag. When this flag is set, making changes to the WebHistoryItem
            will not cause WebHistoryChanged notifications to be sent. This is a big speedup
            for reading bookmarks from disk, since currently each WebBookmarkLeaf object
            keeps around a WebHistoryItem object that isn't really part of history and thus
            doesn't need to send notifications about history changing.
            (-[WebHistoryItem notificationsSuppressed]):
            getter for new flag
            (-[WebHistoryItem setURLString:]):
            new method, extracted from guts of setURL:; this allows callers (though
            currently only callers at Apple) that have a URL string in hand to set
            it directly on the WebHistoryItem rather than converting to a URL and
            back, both relatively slow operations. Also, doesn't sent a notification
            if notifications are suppressed.
            (-[WebHistoryItem setURL:]):
            now calls extracted method
            (-[WebHistoryItem setAlternateTitle:]):
            doesn't send notification if notifications are suppressed
            (-[WebHistoryItem setOriginalURLString:]):
            ditto
            (-[WebHistoryItem setTitle:]):
            ditto
            (-[WebHistoryItem _setLastVisitedTimeInterval:]):
            ditto
    
    WebBrowser:
    
            - A number of performance improvements to importing bookmarks. Some but not all of
            them also apply to reading our native bookmarks from disk. When I started this,
            importing bookmarks from Netscape's HTML format was actually slower than importing
            bookmarks from our property list format, hard though that might be to imagine. Now
            importing the HTML format takes about half the time it used to, and now it's about
            40% faster than importing the property list format, at least with my 33,000 bookmark
            sample file (and importing our property list format also sped up).
    
            Reviewed by Darin.
    
            * BookmarksController.m:
            (-[BookmarksController mergeBuiltInBookmarksIfNecessary]):
            added count to timing log message
            (-[BookmarksController exportBookmarks:]):
            added timing log message
            (-[BookmarksController importFavoritesFrom:intoBookmarksFolder:settingPrefKey:]):
            added count to timing log message, and commented-out calls to start & stop sampling
            for the next time someone works on this. Also, in the case where we're importing
            from a user-chosen file instead of automatically, bypass the merging code because
            the merging code is unnecessarily complicated for the "just shlurp this pile o'
            bookmarks into a new folder" case.
    
            * BookmarksViewController.m:
            (-[BookmarksViewController changeAddressForBookmark:to:]):
            Use bestURLStringForUserTypedString here (when user manually edits a URL in the
            outline view) so that we don't have to use it in the general case of setting
            a bookmark's URL string, since it's slow. When programmatically setting a bookmark's
            URL string we can often just use an existing string as-is.
    
            * FormCompletionController.m:
            (+[FormCompletionController _saveCompletionDB:]):
            Fix the way an #ifdef was declared so it compiles in a deployment build that
            has LOG_DISABLED set to 0.
    
            * WebBookmarkGroupPrivate.h:
            * WebBookmarkGroup.m:
            (-[WebBookmarkGroup _bookmarkChild:wasAddedToParent:]):
            added this private-ish helper method to avoid creating an array in the case
            where we aren't even going to use it because notifications are suppressed
            (-[WebBookmarkGroup _bookmarkChild:wasRemovedFromParent:]):
            ditto
    
            * WebBookmarkImporter.m:
            (-[WebBookmarkImporter unescapeHTML:]):
            bail out early if there's no ampersand at all in the string (the normal case), to avoid
            creating a mutable string
    
            * WebBookmarkLeaf.m:
            (-[WebBookmarkLeaf init]):
            suppress notifications on our private WebHistoryItem
            (-[WebBookmarkLeaf setURLString:]):
            call the new setURLString: method on our private WebHistoryItem instead of converting
            to a URL and then calling setURL: (which then converts back to a string)
    
            * WebBookmarkList.m:
            (-[WebBookmarkList removeChild:]):
            call new -[WebBookmarkGroup _bookmarkChild:wasRemovedFromParent:] so we don't have to
            create an NSArray here
            (-[WebBookmarkList insertChild:atIndex:]):
            call new -[WebBookmarkGroup _bookmarkChild:wasAddedToParent:] so we don't have to
            create an NSArray here
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6128 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 77a6848..8a71688 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,37 @@
+2004-02-27  John Sullivan  <sullivan at apple.com>
+
+        - WebKit changes to allow performance improvements to bookmarks 
+
+        Reviewed by Darin.
+
+        * History.subproj/WebHistoryItemPrivate.h:
+        added notificationsSuppressed/setNotificationsSuppressed, and setURLString
+        * History.subproj/WebHistoryItem.m:
+        (-[WebHistoryItem setNotificationsSuppressed:]):
+        setter for new flag. When this flag is set, making changes to the WebHistoryItem
+        will not cause WebHistoryChanged notifications to be sent. This is a big speedup
+        for reading bookmarks from disk, since currently each WebBookmarkLeaf object
+        keeps around a WebHistoryItem object that isn't really part of history and thus
+        doesn't need to send notifications about history changing.
+        (-[WebHistoryItem notificationsSuppressed]):
+        getter for new flag
+        (-[WebHistoryItem setURLString:]):
+        new method, extracted from guts of setURL:; this allows callers (though
+        currently only callers at Apple) that have a URL string in hand to set
+        it directly on the WebHistoryItem rather than converting to a URL and
+        back, both relatively slow operations. Also, doesn't sent a notification
+        if notifications are suppressed.
+        (-[WebHistoryItem setURL:]):
+        now calls extracted method
+        (-[WebHistoryItem setAlternateTitle:]):
+        doesn't send notification if notifications are suppressed
+        (-[WebHistoryItem setOriginalURLString:]):
+        ditto
+        (-[WebHistoryItem setTitle:]):
+        ditto
+        (-[WebHistoryItem _setLastVisitedTimeInterval:]):
+        ditto
+
 2004-02-26  Chris Blumenberg  <cblu at apple.com>
 
 	WebKit side of:
diff --git a/WebKit/History.subproj/WebHistoryItem.m b/WebKit/History.subproj/WebHistoryItem.m
index 0269caf..ed7ac45 100644
--- a/WebKit/History.subproj/WebHistoryItem.m
+++ b/WebKit/History.subproj/WebHistoryItem.m
@@ -47,6 +47,7 @@ NSString *WebHistoryItemChangedNotification = @"WebHistoryItemChangedNotificatio
     NSMutableDictionary *pageCache;
     BOOL isTargetItem;
     BOOL alwaysAttemptToUsePageCache;
+    BOOL notificationsSuppressed;
     int visitCount;
     // info used to repost form data
     NSData *formData;
@@ -159,8 +160,10 @@ NSString *WebHistoryItemChangedNotification = @"WebHistoryItemChangedNotificatio
     [_private->displayTitle release];
     _private->displayTitle = newDisplayTitle;
 
-    [[NSNotificationCenter defaultCenter]
+    if (!_private->notificationsSuppressed) {
+        [[NSNotificationCenter defaultCenter]
         postNotificationName: WebHistoryItemChangedNotification object: self userInfo: nil];
+    }
 }
 
 
@@ -278,18 +281,24 @@ NSString *WebHistoryItemChangedNotification = @"WebHistoryItemChangedNotificatio
     return _private->parent;
 }
 
-- (void)setURL:(NSURL *)URL
+- (void)setURLString:(NSString *)string
 {
-    NSString *string = [URL _web_originalDataAsString];
     if (!(string == _private->URLString || [string isEqual:_private->URLString])) {
         [self _retainIconInDatabase:NO];
         [_private->URLString release];
         _private->URLString = [string copy];
         [self _retainIconInDatabase:YES];
     }
-
-    [[NSNotificationCenter defaultCenter]
+    
+    if (!_private->notificationsSuppressed) {
+        [[NSNotificationCenter defaultCenter]
         postNotificationName: WebHistoryItemChangedNotification object: self userInfo: nil];
+    }
+}
+
+- (void)setURL:(NSURL *)URL
+{
+    [self setURLString:[URL _web_originalDataAsString]];
 }
 
 // The first URL we loaded to get to where this history item points.  Includes both client
@@ -300,8 +309,10 @@ NSString *WebHistoryItemChangedNotification = @"WebHistoryItemChangedNotificatio
     [_private->originalURLString release];
     _private->originalURLString = newURL;
 
-    [[NSNotificationCenter defaultCenter]
+    if (!_private->notificationsSuppressed) {
+        [[NSNotificationCenter defaultCenter]
         postNotificationName: WebHistoryItemChangedNotification object: self userInfo: nil];
+    }
 }
 
 - (void)setTitle:(NSString *)title
@@ -315,8 +326,10 @@ NSString *WebHistoryItemChangedNotification = @"WebHistoryItemChangedNotificatio
     [_private->title release];
     _private->title = newTitle;
 
-    [[NSNotificationCenter defaultCenter]
+    if (!_private->notificationsSuppressed) {
+        [[NSNotificationCenter defaultCenter]
         postNotificationName: WebHistoryItemChangedNotification object: self userInfo: nil];
+    }
 }
 
 - (void)setTarget:(NSString *)target
@@ -342,8 +355,10 @@ NSString *WebHistoryItemChangedNotification = @"WebHistoryItemChangedNotificatio
         _private->visitCount++;
     }
 
-    [[NSNotificationCenter defaultCenter]
+    if (!_private->notificationsSuppressed) {
+        [[NSNotificationCenter defaultCenter]
         postNotificationName: WebHistoryItemChangedNotification object: self userInfo: nil];
+    }
 }
 
 // FIXME:  Remove this accessor and related ivar.
@@ -568,6 +583,16 @@ NSString *WebHistoryItemChangedNotification = @"WebHistoryItemChangedNotificatio
     return _private->alwaysAttemptToUsePageCache;
 }
 
+- (void)setNotificationsSuppressed:(BOOL)flag
+{
+    _private->notificationsSuppressed = flag;
+}
+
+- (BOOL)notificationsSuppressed
+{
+    return _private->notificationsSuppressed;
+}
+
 
 
 static WebWindowWatcher *_windowWatcher;
diff --git a/WebKit/History.subproj/WebHistoryItemPrivate.h b/WebKit/History.subproj/WebHistoryItemPrivate.h
index 7d1d9b3..0f24358 100644
--- a/WebKit/History.subproj/WebHistoryItemPrivate.h
+++ b/WebKit/History.subproj/WebHistoryItemPrivate.h
@@ -36,6 +36,7 @@
 - (void)_mergeAutoCompleteHints:(WebHistoryItem *)otherItem;
 
 - (void)setURL:(NSURL *)URL;
+- (void)setURLString:(NSString *)string;
 - (void)setOriginalURLString:(NSString *)URL;
 - (void)setTarget:(NSString *)target;
 - (void)setParent:(NSString *)parent;
@@ -56,6 +57,9 @@
 - (void)setAlwaysAttemptToUsePageCache:(BOOL)flag;
 - (BOOL)alwaysAttemptToUsePageCache;
 
+- (void)setNotificationsSuppressed:(BOOL)flag;
+- (BOOL)notificationsSuppressed;
+
 - (NSCalendarDate *)_lastVisitedDate;
 - (void)_setLastVisitedTimeInterval:(NSTimeInterval)time;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list