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

trey trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:16:00 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 2113543f7f470807bb9b908a53747a15f84c5014
Author: trey <trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 17 22:12:34 2002 +0000

    WebKit:
    
    	Reworking the code to update the page icon led me to roll the WebIconDB API
    	for URL to NSString.  In addition, the vestigial "Site" was removed.
    
    	Everything below is renaming, except where noted.
    
            Reviewed by Darin
    
            * English.lproj/StringsNotToBeLocalized.txt:
            * History.subproj/WebHistoryItem.m:
            (-[WebHistoryItem _retainIconInDatabase:]):
            (-[WebHistoryItem icon]):
            * Misc.subproj/WebIconDatabase.h:
            * Misc.subproj/WebIconDatabase.m:
            (-[WebIconDatabase init]):
            (-[WebIconDatabase iconForURL:withSize:cache:]):  Use _web_isFileURL.
            (-[WebIconDatabase iconForURL:withSize:]):
            (-[WebIconDatabase retainIconForURL:]):
            (-[WebIconDatabase releaseIconForURL:]):
            (-[WebIconDatabase _iconDictionariesAreGood]):
            (-[WebIconDatabase _loadIconDictionaries]):
            (-[WebIconDatabase _updateFileDatabase]):
            (-[WebIconDatabase _iconForFileURL:withSize:]):  Cons up a NSURL to get the path.
    	Test explicitly for .htm and .html suffixes.
            (-[WebIconDatabase _setIcon:forIconURL:]):
            (-[WebIconDatabase _setIconURL:forURL:]):
            (-[WebIconDatabase _releaseIconForIconURLString:]):
            (-[WebIconDatabase _retainFutureIconForURL:]):
            (-[WebIconDatabase _releaseFutureIconForURL:]):
            (-[WebIconDatabase _sendNotificationForURL:]):
            * Misc.subproj/WebIconDatabasePrivate.h:
            * Misc.subproj/WebIconLoader.m:
            (-[WebIconLoader handleDidFinishLoading:]):
            * WebKit.exp:
            * WebView.subproj/WebDataSourcePrivate.m:
            (-[WebDataSource _updateIconDatabaseWithURL:]):
            (-[WebDataSource _loadIcon]):
    
    WebBrowser:
    
    	3127109 - REGRESSION: generic favicon shown while page from same domain is loading
    
    	We now avoid jumping to the generic icon when we're loading and are moving
    	to a URL within the same domain as the current one.
    
    	In addition, some name changes for the URL->NSString changes in the WebIconDB API.
    
            Reviewed by John
    
            * BookmarkSource.m:
            (-[BookmarkSource imageForContentItem:]):  Adopt API change.
            * BrowserWindowController.h:  New ivar, _acceptsGenericIcon.
            * BrowserWindowController.m:
            (-[BrowserWindowController windowDidLoad]):  Init new ivar.
            (-[BrowserWindowController acceptsGenericIcon]):  New getter.
            (-[BrowserWindowController setAcceptsGenericIcon:]):  New setter.
            (-[BrowserWindowController updateLocationFieldIcon]):  Obey new ivar as to
    	we will accept a generic icon when updating.
            * LocationChangeHandler.m:
            (-[LocationChangeHandler locationChangeStartedForDataSource:]):  If the new URL
    	is in the same site as the old one, avoid accepting a generic icon.
            (-[LocationChangeHandler locationChangeDone:forDataSource:]):  Reset _acceptsGenericIcon
            * NewBookmarksController.m:
            (-[NewBookmarksController awakeFromNib]):  Adopt API change.
            * TitleBarButton.m:
            (-[TitleBarButton drawPathRepresentingPopUpMenuForEvent:URL:]):  Adopt API change.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3104 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 3b28e96..af9dab1 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,42 @@
+2002-12-17  Trey Matteson  <trey at apple.com>
+
+	Reworking the code to update the page icon led me to roll the WebIconDB API
+	for URL to NSString.  In addition, the vestigial "Site" was removed.
+
+	Everything below is renaming, except where noted.
+
+        Reviewed by Darin
+
+        * English.lproj/StringsNotToBeLocalized.txt:
+        * History.subproj/WebHistoryItem.m:
+        (-[WebHistoryItem _retainIconInDatabase:]):
+        (-[WebHistoryItem icon]):
+        * Misc.subproj/WebIconDatabase.h:
+        * Misc.subproj/WebIconDatabase.m:
+        (-[WebIconDatabase init]):
+        (-[WebIconDatabase iconForURL:withSize:cache:]):  Use _web_isFileURL.
+        (-[WebIconDatabase iconForURL:withSize:]):
+        (-[WebIconDatabase retainIconForURL:]):
+        (-[WebIconDatabase releaseIconForURL:]):
+        (-[WebIconDatabase _iconDictionariesAreGood]):
+        (-[WebIconDatabase _loadIconDictionaries]):
+        (-[WebIconDatabase _updateFileDatabase]):
+        (-[WebIconDatabase _iconForFileURL:withSize:]):  Cons up a NSURL to get the path.
+	Test explicitly for .htm and .html suffixes.
+        (-[WebIconDatabase _setIcon:forIconURL:]):
+        (-[WebIconDatabase _setIconURL:forURL:]):
+        (-[WebIconDatabase _releaseIconForIconURLString:]):
+        (-[WebIconDatabase _retainFutureIconForURL:]):
+        (-[WebIconDatabase _releaseFutureIconForURL:]):
+        (-[WebIconDatabase _sendNotificationForURL:]):
+        * Misc.subproj/WebIconDatabasePrivate.h:
+        * Misc.subproj/WebIconLoader.m:
+        (-[WebIconLoader handleDidFinishLoading:]):
+        * WebKit.exp:
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource _updateIconDatabaseWithURL:]):
+        (-[WebDataSource _loadIcon]):
+
 2002-12-17  Chris Blumenberg  <cblu at apple.com>
 
 	Fixed: 3113073 - link on http://studio.adobe.com/explore/ redirects to not found page in Alex
diff --git a/WebKit/English.lproj/StringsNotToBeLocalized.txt b/WebKit/English.lproj/StringsNotToBeLocalized.txt
index 8c21371..a42621c 100644
--- a/WebKit/English.lproj/StringsNotToBeLocalized.txt
+++ b/WebKit/English.lproj/StringsNotToBeLocalized.txt
@@ -136,7 +136,7 @@
 "WebHostToSiteURLs"
 "WebIconDatabaseDidAddIconNotification"
 "WebIconDatabaseDirectory"
-"WebIconNotificationUserInfoSiteURLKey"
+"WebIconNotificationUserInfoURLKey"
 "WebIconURLToSiteURLs"
 "WebIconsOnDisk"
 "WebJavaScriptTextInputPanel"
diff --git a/WebKit/History.subproj/WebHistoryItem.m b/WebKit/History.subproj/WebHistoryItem.m
index 1832b90..8bfe522 100644
--- a/WebKit/History.subproj/WebHistoryItem.m
+++ b/WebKit/History.subproj/WebHistoryItem.m
@@ -20,13 +20,12 @@
 
 - (void)_retainIconInDatabase:(BOOL)retain
 {
-    NSURL *URL = [self URL];
-    if (URL) {
+    if (_URLString) {
         WebIconDatabase *iconDB = [WebIconDatabase sharedIconDatabase];
         if (retain) {
-            [iconDB retainIconForSiteURL:URL];
+            [iconDB retainIconForURL:_URLString];
         } else {
-            [iconDB releaseIconForSiteURL:URL];
+            [iconDB releaseIconForURL:_URLString];
         }
     }
 }
@@ -128,7 +127,7 @@
 {
     // Always get fresh icon from database. It's a client's responsibility to watch
     // for updates to the database if desired.
-    return [[WebIconDatabase sharedIconDatabase] iconForSiteURL:[self URL] withSize:WebIconSmallSize];
+    return [[WebIconDatabase sharedIconDatabase] iconForURL:_URLString withSize:WebIconSmallSize];
 }
 
 
diff --git a/WebKit/Misc.subproj/WebIconDatabase.h b/WebKit/Misc.subproj/WebIconDatabase.h
index 9f08058..a239608 100644
--- a/WebKit/Misc.subproj/WebIconDatabase.h
+++ b/WebKit/Misc.subproj/WebIconDatabase.h
@@ -9,10 +9,10 @@
 
 // Sent whenever a site icon has changed. The object of the notification is the icon database.
 // The userInfo contains the site URL who's icon has changed.
-// It can be accessed with the key WebIconNotificationUserInfoSiteURLKey.
+// It can be accessed with the key WebIconNotificationUserInfoURLKey.
 extern NSString *WebIconDatabaseDidAddIconNotification;
 
-extern NSString *WebIconNotificationUserInfoSiteURLKey;
+extern NSString *WebIconNotificationUserInfoURLKey;
 
 extern NSSize WebIconSmallSize;  // 16 x 16
 extern NSSize WebIconMediumSize; // 32 x 32
@@ -52,23 +52,23 @@ extern NSSize WebIconLargeSize;  // 128 x 128
 + (WebIconDatabase *)sharedIconDatabase;
 
 /*!
-    @method iconForSiteURL:withSize:
-    @discussion Calls iconForSiteURL:withSize:cache: with YES for cache.
-    @param siteURL
+    @method iconForURL:withSize:
+    @discussion Calls iconForURL:withSize:cache: with YES for cache.
+    @param URL
     @param size
 */
-- (NSImage *)iconForSiteURL:(NSURL *)siteURL withSize:(NSSize)size;
+- (NSImage *)iconForURL:(NSString *)URL withSize:(NSSize)size;
 
 /*!
-    @method iconForSiteURL:withSize:cache:
+    @method iconForURL:withSize:cache:
     @discussion Returns an icon for a web site URL from memory or disk. nil if none is found.
     Usually called by a UI element to determine if a site URL has an associated icon.
     Often called by the observer of WebIconChangedNotification after the notification is sent.
-    @param siteURL
+    @param URL
     @param size
     @param cache If yes, caches the returned image in memory if not already cached
 */
-- (NSImage *)iconForSiteURL:(NSURL *)siteURL withSize:(NSSize)size cache:(BOOL)cache;
+- (NSImage *)iconForURL:(NSString *)URL withSize:(NSSize)size cache:(BOOL)cache;
 
 /*!
     @method defaultIconWithSize:
@@ -77,18 +77,18 @@ extern NSSize WebIconLargeSize;  // 128 x 128
 - (NSImage *)defaultIconWithSize:(NSSize)size;
 
 /*!
-    @method retainIconForSiteURL:
+    @method retainIconForURL:
     @abstract Increments the retain count of the icon.
-    @param siteURL
+    @param URL
 */
-- (void)retainIconForSiteURL:(NSURL *)siteURL;
+- (void)retainIconForURL:(NSString *)URL;
 
 /*!
-    @method releaseIconForSiteURL:
+    @method releaseIconForURL:
     @abstract Decrements the retain count of the icon.
-    @param siteURL
+    @param URL
 */
-- (void)releaseIconForSiteURL:(NSURL *)siteURL;
+- (void)releaseIconForURL:(NSString *)URL;
 
 /*!
     @method delayDatabaseCleanup:
diff --git a/WebKit/Misc.subproj/WebIconDatabase.m b/WebKit/Misc.subproj/WebIconDatabase.m
index bcabdec..401946d 100644
--- a/WebKit/Misc.subproj/WebIconDatabase.m
+++ b/WebKit/Misc.subproj/WebIconDatabase.m
@@ -18,12 +18,12 @@
 #define WebIconDatabaseDefaultDirectory ([NSString stringWithFormat:@"%@/%@", NSHomeDirectory(), @"Library/Caches/com.apple.WebKit/Icons"])
 
 #define WebIconsOnDiskKey 	@"WebIconsOnDisk"
-#define WebSiteURLToIconURLKey 	@"WebSiteURLToIconURLKey"
-#define WebIconURLToSiteURLsKey @"WebIconURLToSiteURLs"
-#define WebHostToSiteURLsKey 	@"WebHostToSiteURLs"
+#define WebURLToIconURLKey 	@"WebSiteURLToIconURLKey"
+#define WebIconURLToURLsKey 	@"WebIconURLToSiteURLs"
+#define WebHostToURLsKey 	@"WebHostToSiteURLs"
 
 NSString *WebIconDatabaseDidAddIconNotification = @"WebIconDatabaseDidAddIconNotification";
-NSString *WebIconNotificationUserInfoSiteURLKey = @"WebIconNotificationUserInfoSiteURLKey";
+NSString *WebIconNotificationUserInfoURLKey = @"WebIconNotificationUserInfoURLKey";
 
 NSSize WebIconSmallSize = {16, 16};
 NSSize WebIconMediumSize = {32, 32};
@@ -39,15 +39,15 @@ NSSize WebIconLargeSize = {128, 128};
 - (void)_loadIconDictionaries;
 - (void)_updateFileDatabase;
 - (NSMutableDictionary *)_iconsForIconURLString:(NSString *)iconURL;
-- (NSImage *)_iconForFileURL:(NSURL *)fileURL withSize:(NSSize)size;
+- (NSImage *)_iconForFileURL:(NSString *)fileURL withSize:(NSSize)size;
 - (NSMutableDictionary *)_builtInIconsForHost:(NSString *)host;
 - (void)_retainIconForIconURLString:(NSString *)iconURL;
 - (void)_releaseIconForIconURLString:(NSString *)iconURL;
-- (void)_retainFutureIconForSiteURL:(NSURL *)siteURL;
-- (void)_releaseFutureIconForSiteURL:(NSURL *)siteURL;
+- (void)_retainFutureIconForURL:(NSString *)URL;
+- (void)_releaseFutureIconForURL:(NSString *)URL;
 - (void)_retainOriginalIconsOnDisk;
 - (void)_releaseOriginalIconsOnDisk;
-- (void)_sendNotificationForSiteURL:(NSURL *)siteURL;
+- (void)_sendNotificationForURL:(NSString *)URL;
 - (NSImage *)_largestIconFromDictionary:(NSMutableDictionary *)icons;
 - (NSMutableDictionary *)_iconsBySplittingRepresentationsOfIcon:(NSImage *)icon;
 - (NSImage *)_iconFromDictionary:(NSMutableDictionary *)icons forSize:(NSSize)size cache:(BOOL)cache;
@@ -79,7 +79,7 @@ NSSize WebIconLargeSize = {128, 128};
 
     _private->iconURLToIcons = 			[[NSMutableDictionary dictionary] retain];
     _private->iconURLToRetainCount = 		[[NSMutableDictionary dictionary] retain];
-    _private->futureSiteURLToRetainCount = 	[[NSMutableDictionary dictionary] retain];
+    _private->futureURLToRetainCount = 		[[NSMutableDictionary dictionary] retain];
 
     _private->iconsToEraseWithURLs = 	[[NSMutableSet set] retain];
     _private->iconsToSaveWithURLs = 	[[NSMutableSet set] retain];
@@ -97,20 +97,20 @@ NSSize WebIconLargeSize = {128, 128};
     return self;
 }
 
-- (NSImage *)iconForSiteURL:(NSURL *)siteURL withSize:(NSSize)size cache:(BOOL)cache
+- (NSImage *)iconForURL:(NSString *)URL withSize:(NSSize)size cache:(BOOL)cache
 {
     ASSERT(size.width);
     ASSERT(size.height);
     
-    if (!siteURL) {
+    if (!URL) {
         return [self defaultIconWithSize:size];
     }
-    
-    if ([siteURL isFileURL]) {
-        return [self _iconForFileURL:siteURL withSize:size];
+
+    if ([URL _web_isFileURL]) {
+        return [self _iconForFileURL:URL withSize:size];
     }
     
-    NSString *iconURLString = [_private->siteURLToIconURL objectForKey:[siteURL absoluteString]];
+    NSString *iconURLString = [_private->URLToIconURL objectForKey:URL];
     if (!iconURLString) {
         // Don't have it
         return [self defaultIconWithSize:size];
@@ -125,9 +125,9 @@ NSSize WebIconLargeSize = {128, 128};
     return [self _iconFromDictionary:icons forSize:size cache:cache];
 }
 
-- (NSImage *)iconForSiteURL:(NSURL *)siteURL withSize:(NSSize)size
+- (NSImage *)iconForURL:(NSString *)URL withSize:(NSSize)size
 {
-    return [self iconForSiteURL:siteURL withSize:size cache:YES];
+    return [self iconForURL:URL withSize:size cache:YES];
 }
 
 - (NSImage *)defaultIconWithSize:(NSSize)size
@@ -148,29 +148,29 @@ NSSize WebIconLargeSize = {128, 128};
     return [self _iconFromDictionary:_private->defaultIcons forSize:size cache:YES];
 }
 
-- (void)retainIconForSiteURL:(NSURL *)siteURL
+- (void)retainIconForURL:(NSString *)URL
 {
-    ASSERT(siteURL);
+    ASSERT(URL);
     
-    NSString *iconURLString = [_private->siteURLToIconURL objectForKey:[siteURL absoluteString]];
+    NSString *iconURLString = [_private->URLToIconURL objectForKey:URL];
     
     if(iconURLString){
         [self _retainIconForIconURLString:iconURLString];
     }else{
-        [self _retainFutureIconForSiteURL:siteURL];
+        [self _retainFutureIconForURL:URL];
     }
 }
 
-- (void)releaseIconForSiteURL:(NSURL *)siteURL
+- (void)releaseIconForURL:(NSString *)URL
 {
-    ASSERT(siteURL);
+    ASSERT(URL);
     
-    NSString *iconURLString = [_private->siteURLToIconURL objectForKey:[siteURL absoluteString]];
+    NSString *iconURLString = [_private->URLToIconURL objectForKey:URL];
     
     if(iconURLString){
         [self _releaseIconForIconURLString:iconURLString];
     }else{
-        [self _releaseFutureIconForSiteURL:siteURL];        
+        [self _releaseFutureIconForURL:URL];        
     }
 }
 
@@ -235,23 +235,23 @@ NSSize WebIconLargeSize = {128, 128};
         return NO;
     }
 
-    if (![_private->siteURLToIconURL isKindOfClass:[NSMutableDictionary class]]) {
+    if (![_private->URLToIconURL isKindOfClass:[NSMutableDictionary class]]) {
         return NO;
     }
-    if (![[_private->siteURLToIconURL keyEnumerator] _web_isAllStrings]) {
+    if (![[_private->URLToIconURL keyEnumerator] _web_isAllStrings]) {
         return NO;
     }
-    if (![[_private->siteURLToIconURL objectEnumerator] _web_isAllStrings]) {
+    if (![[_private->URLToIconURL objectEnumerator] _web_isAllStrings]) {
         return NO;
     }
 
-    if (![_private->iconURLToSiteURLs isKindOfClass:[NSMutableDictionary class]]) {
+    if (![_private->iconURLToURLs isKindOfClass:[NSMutableDictionary class]]) {
         return NO;
     }
-    if (![[_private->iconURLToSiteURLs keyEnumerator] _web_isAllStrings]) {
+    if (![[_private->iconURLToURLs keyEnumerator] _web_isAllStrings]) {
         return NO;
     }
-    e = [_private->iconURLToSiteURLs objectEnumerator];
+    e = [_private->iconURLToURLs objectEnumerator];
     while ((o = [e nextObject])) {
         if (![o isKindOfClass:[NSMutableSet class]]) {
             return NO;
@@ -269,18 +269,18 @@ NSSize WebIconLargeSize = {128, 128};
     WebFileDatabase *fileDB = _private->fileDatabase;
 
     _private->iconsOnDiskWithURLs = 	[fileDB objectForKey:WebIconsOnDiskKey];
-    _private->siteURLToIconURL = 	[fileDB objectForKey:WebSiteURLToIconURLKey];
-    _private->iconURLToSiteURLs = 	[fileDB objectForKey:WebIconURLToSiteURLsKey];
+    _private->URLToIconURL = 		[fileDB objectForKey:WebURLToIconURLKey];
+    _private->iconURLToURLs = 	[fileDB objectForKey:WebIconURLToURLsKey];
 
     if (![self _iconDictionariesAreGood]) {
         _private->iconsOnDiskWithURLs = [NSMutableSet set];
-        _private->siteURLToIconURL = 	[NSMutableDictionary dictionary];
-        _private->iconURLToSiteURLs = 	[NSMutableDictionary dictionary];
+        _private->URLToIconURL = 	[NSMutableDictionary dictionary];
+        _private->iconURLToURLs = 	[NSMutableDictionary dictionary];
     }
 
     [_private->iconsOnDiskWithURLs retain];
-    [_private->iconURLToSiteURLs retain];
-    [_private->siteURLToIconURL retain];
+    [_private->iconURLToURLs retain];
+    [_private->URLToIconURL retain];
 }
 
 // Only called by _setIconURL:forKey:
@@ -330,16 +330,15 @@ NSSize WebIconLargeSize = {128, 128};
 
     // Save the icon dictionaries to disk
     [fileDB setObject:_private->iconsOnDiskWithURLs 	forKey:WebIconsOnDiskKey];
-    [fileDB setObject:_private->siteURLToIconURL	forKey:WebSiteURLToIconURLKey];
-    [fileDB setObject:_private->iconURLToSiteURLs 	forKey:WebIconURLToSiteURLsKey];
+    [fileDB setObject:_private->URLToIconURL		forKey:WebURLToIconURLKey];
+    [fileDB setObject:_private->iconURLToURLs 		forKey:WebIconURLToURLsKey];
 }
 
-- (BOOL)_hasIconForIconURL:(NSURL *)iconURL;
+- (BOOL)_hasIconForIconURL:(NSString *)iconURL;
 {
-    NSString *iconURLString = [iconURL absoluteString];
-    return (([_private->iconURLToIcons objectForKey:iconURLString] ||
-             [_private->iconsOnDiskWithURLs containsObject:iconURLString]) &&
-            [_private->iconURLToRetainCount objectForKey:iconURLString]);
+    return (([_private->iconURLToIcons objectForKey:iconURL] ||
+             [_private->iconsOnDiskWithURLs containsObject:iconURL]) &&
+            [_private->iconURLToRetainCount objectForKey:iconURL]);
 }
 
 - (NSMutableDictionary *)_iconsForIconURLString:(NSString *)iconURLString
@@ -376,28 +375,36 @@ NSSize WebIconLargeSize = {128, 128};
 }
 
 
-- (NSImage *)_iconForFileURL:(NSURL *)fileURL withSize:(NSSize)size
+- (NSImage *)_iconForFileURL:(NSString *)file withSize:(NSSize)size
 {
     ASSERT(size.width);
     ASSERT(size.height);
     
     NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
     NSImage *icon;
-    
-    if([[[fileURL path] pathExtension] _web_hasCaseInsensitivePrefix:@"htm"]){
+    NSURL *URL = [NSURL _web_URLWithString:file];
+    if (!URL) {
+        return nil;
+    }
+
+    NSString *path = [URL path];
+    NSString *suffix = [path pathExtension];
+    if([suffix _web_isCaseInsensitiveEqualToString:@"htm"]
+       || [suffix _web_isCaseInsensitiveEqualToString:@"html"])
+    {
         if(!_private->htmlIcons){
             icon = [workspace iconForFileType:@"html"];
             _private->htmlIcons = [[self _iconsBySplittingRepresentationsOfIcon:icon] retain];
         }
         return [self _iconFromDictionary:_private->htmlIcons forSize:size cache:YES];
     }else{
-        icon = [workspace iconForFile:[fileURL path]];
+        icon = [workspace iconForFile:path];
         [self _scaleIcon:icon toSize:size];
         return icon;
     }
 }
 
-- (void)_setIcon:(NSImage *)icon forIconURL:(NSURL *)iconURL
+- (void)_setIcon:(NSImage *)icon forIconURL:(NSString *)iconURL
 {
     ASSERT(icon);
     ASSERT(iconURL);
@@ -408,52 +415,48 @@ NSSize WebIconLargeSize = {128, 128};
         return;
     }
 
-    NSString *iconURLString = [iconURL absoluteString];
-    [_private->iconURLToIcons setObject:icons forKey:iconURLString];
+    [_private->iconURLToIcons setObject:icons forKey:iconURL];
 
-    [self _retainIconForIconURLString:iconURLString];
+    [self _retainIconForIconURLString:iconURL];
     
     // Release the newly created icon much like an autorelease.
     // This gives the client enough time to retain it.
     // FIXME: Should use an actual autorelease here using a proxy object instead.
-    [self performSelector:@selector(_releaseIconForIconURLString:) withObject:iconURLString afterDelay:0];
+    [self performSelector:@selector(_releaseIconForIconURLString:) withObject:iconURL afterDelay:0];
 }
 
-- (void)_setIconURL:(NSURL *)iconURL forSiteURL:(NSURL *)siteURL
+- (void)_setIconURL:(NSString *)iconURL forURL:(NSString *)URL
 {
     ASSERT(iconURL);
-    ASSERT(siteURL);
+    ASSERT(URL);
     ASSERT([self _hasIconForIconURL:iconURL]);
-    
-    NSString *siteURLString = [siteURL absoluteString];
-    NSString *iconURLString = [iconURL absoluteString];
 
-    if([[_private->siteURLToIconURL objectForKey:siteURLString] isEqualToString:iconURLString] &&
-       [_private->iconsOnDiskWithURLs containsObject:iconURLString]){
+    if([[_private->URLToIconURL objectForKey:URL] isEqualToString:iconURL] &&
+       [_private->iconsOnDiskWithURLs containsObject:iconURL]){
         // Don't do any work if the icon URL is already bound to the site URL
         return;
     }
     
-    [_private->siteURLToIconURL setObject:iconURLString forKey:siteURLString];
+    [_private->URLToIconURL setObject:iconURL forKey:URL];
     
-    NSMutableSet *siteURLStrings = [_private->iconURLToSiteURLs objectForKey:iconURLString];
-    if(!siteURLStrings){
-        siteURLStrings = [NSMutableSet set];
-        [_private->iconURLToSiteURLs setObject:siteURLStrings forKey:iconURLString];
+    NSMutableSet *URLStrings = [_private->iconURLToURLs objectForKey:iconURL];
+    if(!URLStrings){
+        URLStrings = [NSMutableSet set];
+        [_private->iconURLToURLs setObject:URLStrings forKey:iconURL];
     }
-    [siteURLStrings addObject:siteURLString];
+    [URLStrings addObject:URL];
 
     
-    NSNumber *futureRetainCount = [_private->futureSiteURLToRetainCount objectForKey:siteURLString];
+    NSNumber *futureRetainCount = [_private->futureURLToRetainCount objectForKey:URL];
 
     if(futureRetainCount){
-        NSNumber *retainCount = [_private->iconURLToRetainCount objectForKey:iconURLString];
+        NSNumber *retainCount = [_private->iconURLToRetainCount objectForKey:iconURL];
         int newRetainCount = [retainCount intValue] + [futureRetainCount intValue];
-        [_private->iconURLToRetainCount setObject:[NSNumber numberWithInt:newRetainCount] forKey:iconURLString];
-        [_private->futureSiteURLToRetainCount removeObjectForKey:siteURLString];
+        [_private->iconURLToRetainCount setObject:[NSNumber numberWithInt:newRetainCount] forKey:iconURL];
+        [_private->futureURLToRetainCount removeObjectForKey:URL];
     }
 
-    [self _sendNotificationForSiteURL:siteURL];
+    [self _sendNotificationForURL:URL];
     [self _updateFileDatabase];
 }
 
@@ -507,20 +510,18 @@ NSSize WebIconLargeSize = {128, 128};
 
         // Remove the icon's associated site URLs
         [iconURLString retain];
-        NSSet *siteURLStrings = [_private->iconURLToSiteURLs objectForKey:iconURLString];
-        [_private->siteURLToIconURL removeObjectsForKeys:[siteURLStrings allObjects]];
-        [_private->iconURLToSiteURLs removeObjectForKey:iconURLString];
+        NSSet *URLStrings = [_private->iconURLToURLs objectForKey:iconURLString];
+        [_private->URLToIconURL removeObjectsForKeys:[URLStrings allObjects]];
+        [_private->iconURLToURLs removeObjectForKey:iconURLString];
         [iconURLString release];
     }
 }
 
-- (void)_retainFutureIconForSiteURL:(NSURL *)siteURL
+- (void)_retainFutureIconForURL:(NSString *)URL
 {
-    ASSERT(siteURL);
+    ASSERT(URL);
     
-    NSString *siteURLString = [siteURL absoluteString];
-    
-    NSNumber *retainCount = [_private->futureSiteURLToRetainCount objectForKey:siteURLString];
+    NSNumber *retainCount = [_private->futureURLToRetainCount objectForKey:URL];
     int newRetainCount;
 
     if(retainCount){
@@ -529,16 +530,14 @@ NSSize WebIconLargeSize = {128, 128};
         newRetainCount = 1;
     }
 
-    [_private->futureSiteURLToRetainCount setObject:[NSNumber numberWithInt:newRetainCount] forKey:siteURLString];
+    [_private->futureURLToRetainCount setObject:[NSNumber numberWithInt:newRetainCount] forKey:URL];
 }
 
-- (void)_releaseFutureIconForSiteURL:(NSURL *)siteURL
+- (void)_releaseFutureIconForURL:(NSString *)URL
 {
-    ASSERT(siteURL);
-    
-    NSString *siteURLString = [siteURL absoluteString];
+    ASSERT(URL);
     
-    NSNumber *retainCount = [_private->futureSiteURLToRetainCount objectForKey:siteURLString];
+    NSNumber *retainCount = [_private->futureURLToRetainCount objectForKey:URL];
 
     if(!retainCount){
         [NSException raise:NSGenericException
@@ -549,9 +548,9 @@ NSSize WebIconLargeSize = {128, 128};
     int newRetainCount = [retainCount intValue] - 1;
 
     if(newRetainCount == 0){
-        [_private->futureSiteURLToRetainCount removeObjectForKey:siteURLString];
+        [_private->futureURLToRetainCount removeObjectForKey:URL];
     }else{
-        [_private->futureSiteURLToRetainCount setObject:[NSNumber numberWithInt:newRetainCount] forKey:siteURLString];
+        [_private->futureURLToRetainCount setObject:[NSNumber numberWithInt:newRetainCount] forKey:URL];
     }
 }
 
@@ -584,12 +583,12 @@ NSSize WebIconLargeSize = {128, 128};
     _private->didCleanup = YES;
 }
 
-- (void)_sendNotificationForSiteURL:(NSURL *)siteURL
+- (void)_sendNotificationForURL:(NSString *)URL
 {
-    ASSERT(siteURL);
+    ASSERT(URL);
     
-    NSDictionary *userInfo = [NSDictionary dictionaryWithObject:siteURL
-                                                         forKey:WebIconNotificationUserInfoSiteURLKey];
+    NSDictionary *userInfo = [NSDictionary dictionaryWithObject:URL
+                                                         forKey:WebIconNotificationUserInfoURLKey];
     [[NSNotificationCenter defaultCenter] postNotificationName:WebIconDatabaseDidAddIconNotification
                                                         object:self
                                                       userInfo:userInfo];
diff --git a/WebKit/Misc.subproj/WebIconDatabasePrivate.h b/WebKit/Misc.subproj/WebIconDatabasePrivate.h
index e997873..acc590f 100644
--- a/WebKit/Misc.subproj/WebIconDatabasePrivate.h
+++ b/WebKit/Misc.subproj/WebIconDatabasePrivate.h
@@ -18,9 +18,9 @@
 
     NSMutableDictionary *iconURLToIcons;
     NSMutableDictionary *iconURLToRetainCount;
-    NSMutableDictionary *iconURLToSiteURLs;
-    NSMutableDictionary *siteURLToIconURL;    
-    NSMutableDictionary *futureSiteURLToRetainCount;
+    NSMutableDictionary *iconURLToURLs;
+    NSMutableDictionary *URLToIconURL;    
+    NSMutableDictionary *futureURLToRetainCount;
     
     NSMutableSet *iconsOnDiskWithURLs;
     NSMutableSet *iconsToEraseWithURLs;
@@ -40,11 +40,11 @@
 @interface WebIconDatabase (WebPrivate)
 
 // Called by WebIconLoader after loading an icon.
-- (void)_setIcon:(NSImage *)icon forIconURL:(NSURL *)iconURL;
+- (void)_setIcon:(NSImage *)icon forIconURL:(NSString *)iconURL;
 
 // Called by WebDataSource to bind a web site URL to a icon URL and icon image.
-- (void)_setIconURL:(NSURL *)iconURL forSiteURL:(NSURL *)siteURL;
+- (void)_setIconURL:(NSString *)iconURL forURL:(NSString *)URL;
 
-- (BOOL)_hasIconForIconURL:(NSURL *)iconURL;
+- (BOOL)_hasIconForIconURL:(NSString *)iconURL;
 
 @end
\ No newline at end of file
diff --git a/WebKit/Misc.subproj/WebIconLoader.m b/WebKit/Misc.subproj/WebIconLoader.m
index 3e8b8a0..14238c3 100644
--- a/WebKit/Misc.subproj/WebIconLoader.m
+++ b/WebKit/Misc.subproj/WebIconLoader.m
@@ -102,7 +102,7 @@
 {
     NSImage *icon = [[NSImage alloc] initWithData:_private->resourceData];
     if (icon) {
-        [[WebIconDatabase sharedIconDatabase] _setIcon:icon forIconURL:_private->URL];
+        [[WebIconDatabase sharedIconDatabase] _setIcon:icon forIconURL:[_private->URL absoluteString]];
         [_private->delegate iconLoader:self receivedPageIcon:icon];
         [icon release];
     }
diff --git a/WebKit/WebKit.exp b/WebKit/WebKit.exp
index 6384f34..955e4b3 100644
--- a/WebKit/WebKit.exp
+++ b/WebKit/WebKit.exp
@@ -49,7 +49,7 @@ _WebHistoryLoadedNotification
 _WebIconDatabaseDidAddIconNotification
 _WebIconLargeSize
 _WebIconMediumSize
-_WebIconNotificationUserInfoSiteURLKey
+_WebIconNotificationUserInfoURLKey
 _WebIconSmallSize
 _WebModifiedBookmarkKey
 _WebURLNamePboardType
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 42158c7..c831ecf 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -520,8 +520,8 @@
     WebIconDatabase *iconDB = [WebIconDatabase sharedIconDatabase];
 
     // Bind the URL of the original request and the final URL to the icon URL.
-    [iconDB _setIconURL:iconURL forSiteURL:[self URL]];
-    [iconDB _setIconURL:iconURL forSiteURL:[[self _originalRequest] URL]];
+    [iconDB _setIconURL:[iconURL absoluteString] forURL:[[self URL] absoluteString]];
+    [iconDB _setIconURL:[iconURL absoluteString] forURL:[[[self _originalRequest] URL] absoluteString]];
     [[_private->controller locationChangeDelegate] receivedPageIcon:nil forDataSource:self];
 }
 
@@ -547,7 +547,7 @@
     }
 
     if(_private->iconURL != nil){
-        if([[WebIconDatabase sharedIconDatabase] _hasIconForIconURL:_private->iconURL]){
+        if([[WebIconDatabase sharedIconDatabase] _hasIconForIconURL:[_private->iconURL absoluteString]]){
             [self _updateIconDatabaseWithURL:_private->iconURL];
         }else{
             _private->iconLoader = [[WebIconLoader alloc] initWithURL:_private->iconURL];

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list