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

cblu cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:36:16 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit af9d14ce6189f6500ab9dbc8be4f6805aea40ee5
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 5 01:56:01 2002 +0000

    	- don't set nil data on the web file db
    	- store absolute URLs in the db, not base URL/path combination URLs
    	- support for multiple hosts with the same built-in icon
    
            * Misc.subproj/WebIconDatabase.m:
            (-[WebIconDatabase init]): renamed some dictionaries
            (-[WebIconDatabase iconForSiteURL:withSize:]): call _builtInIconsForHost
            (-[WebIconDatabase _updateFileDatabase]): check for nil
            (-[WebIconDatabase _hasIconForSiteURL:]): call _pathForBuiltInIconForHost
            (-[WebIconDatabase _pathForBuiltInIconForHost:]): new
            (-[WebIconDatabase _builtInIconsForHost:]): call _pathForBuiltInIconForHost
            * Misc.subproj/WebIconDatabasePrivate.h:
            * WebView.subproj/WebDataSourcePrivate.m:
            (-[WebDataSource _loadIcon]): use absolute URL
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1964 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index dd8d638..0f13024 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,22 @@
 2002-09-04  Chris Blumenberg  <cblu at apple.com>
 
+	- don't set nil data on the web file db
+	- store absolute URLs in the db, not base URL/path combination URLs
+	- support for multiple hosts with the same built-in icon
+
+        * Misc.subproj/WebIconDatabase.m:
+        (-[WebIconDatabase init]): renamed some dictionaries
+        (-[WebIconDatabase iconForSiteURL:withSize:]): call _builtInIconsForHost
+        (-[WebIconDatabase _updateFileDatabase]): check for nil
+        (-[WebIconDatabase _hasIconForSiteURL:]): call _pathForBuiltInIconForHost
+        (-[WebIconDatabase _pathForBuiltInIconForHost:]): new
+        (-[WebIconDatabase _builtInIconsForHost:]): call _pathForBuiltInIconForHost
+        * Misc.subproj/WebIconDatabasePrivate.h:
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource _loadIcon]): use absolute URL
+
+2002-09-04  Chris Blumenberg  <cblu at apple.com>
+
 	Made the icon DB take a a path for built-in icons so that we only load them when necessary.
 
         * Misc.subproj/WebIconDatabase.m:
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index dd8d638..0f13024 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,5 +1,22 @@
 2002-09-04  Chris Blumenberg  <cblu at apple.com>
 
+	- don't set nil data on the web file db
+	- store absolute URLs in the db, not base URL/path combination URLs
+	- support for multiple hosts with the same built-in icon
+
+        * Misc.subproj/WebIconDatabase.m:
+        (-[WebIconDatabase init]): renamed some dictionaries
+        (-[WebIconDatabase iconForSiteURL:withSize:]): call _builtInIconsForHost
+        (-[WebIconDatabase _updateFileDatabase]): check for nil
+        (-[WebIconDatabase _hasIconForSiteURL:]): call _pathForBuiltInIconForHost
+        (-[WebIconDatabase _pathForBuiltInIconForHost:]): new
+        (-[WebIconDatabase _builtInIconsForHost:]): call _pathForBuiltInIconForHost
+        * Misc.subproj/WebIconDatabasePrivate.h:
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource _loadIcon]): use absolute URL
+
+2002-09-04  Chris Blumenberg  <cblu at apple.com>
+
 	Made the icon DB take a a path for built-in icons so that we only load them when necessary.
 
         * Misc.subproj/WebIconDatabase.m:
diff --git a/WebKit/Misc.subproj/WebIconDatabase.m b/WebKit/Misc.subproj/WebIconDatabase.m
index 926744d..cc0a90c 100644
--- a/WebKit/Misc.subproj/WebIconDatabase.m
+++ b/WebKit/Misc.subproj/WebIconDatabase.m
@@ -34,6 +34,7 @@ NSSize WebIconMediumSize = {32, 32};
 - (void)_updateFileDatabase;
 - (NSMutableArray *)_iconsForIconURL:(NSURL *)iconURL;
 - (NSImage *)_iconForFileURL:(NSURL *)fileURL withSize:(NSSize)size;
+- (NSString *)_pathForBuiltInIconForHost:(NSString *)host;
 - (NSMutableArray *)_builtInIconsForHost:(NSString *)host;
 - (void)_retainIconForIconURL:(NSURL *)iconURL;
 - (void)_releaseIconForIconURL:(NSURL *)iconURL;
@@ -74,7 +75,7 @@ NSSize WebIconMediumSize = {32, 32};
     _private->iconURLToIcons = [[NSMutableDictionary dictionary] retain];
     _private->iconURLToRetainCount = [[NSMutableDictionary dictionary] retain];
     _private->futureSiteURLToRetainCount = [[NSMutableDictionary dictionary] retain];
-    _private->hostToBuiltInIcons = [[NSMutableDictionary dictionary] retain];
+    _private->pathToBuiltInIcons = [[NSMutableDictionary dictionary] retain];
     _private->hostToBuiltInIconPath = [[NSMutableDictionary dictionary] retain];
 
     _private->iconsToEraseWithURLs = [[NSMutableSet set] retain];
@@ -95,7 +96,6 @@ NSSize WebIconMediumSize = {32, 32};
 
 - (NSImage *)iconForSiteURL:(NSURL *)siteURL withSize:(NSSize)size
 {
-
     if(!siteURL){
         return [self defaultIconWithSize:size];
     }
@@ -310,8 +310,10 @@ NSSize WebIconMediumSize = {32, 32};
     while ((iconURL = [enumerator nextObject]) != nil) {
         //NSLog(@"writing %@", iconURL);
         iconData = [[self _iconForIconURL:iconURL] TIFFRepresentation];
-        [fileDB setObject:iconData forKey:iconURL];
-        [_private->iconsOnDiskWithURLs addObject:iconURL];
+        if(iconData){
+            [fileDB setObject:iconData forKey:iconURL];
+            [_private->iconsOnDiskWithURLs addObject:iconURL];
+        }
     }
     
     [_private->iconsToEraseWithURLs removeAllObjects];
@@ -328,7 +330,7 @@ NSSize WebIconMediumSize = {32, 32};
 {
     if([siteURL isFileURL]){
         return YES;
-    }else if([_private->hostToBuiltInIconPath objectForKey:[siteURL host]]){
+    }else if([self _pathForBuiltInIconForHost:[siteURL host]]){
         return YES;
     }else if([_private->siteURLToIconURL objectForKey:siteURL]){
         return YES;
@@ -396,15 +398,13 @@ NSSize WebIconMediumSize = {32, 32};
     }
 }
 
-- (NSMutableArray *)_builtInIconsForHost:(NSString *)host
+- (NSString *)_pathForBuiltInIconForHost:(NSString *)host
 {
     NSArray *hostParts = [host componentsSeparatedByString:@"."];
     NSMutableString *truncatedHost = [NSMutableString string];
     NSString *hostPart, *path;
-    NSMutableArray *icons;
     BOOL firstPart = YES;
-    NSImage *icon;
-    
+
     NSEnumerator *enumerator = [hostParts reverseObjectEnumerator];
     while ((hostPart = [enumerator nextObject]) != nil) {
         if(firstPart){
@@ -414,18 +414,7 @@ NSSize WebIconMediumSize = {32, 32};
             [truncatedHost insertString:[NSString stringWithFormat:@"%@.", hostPart] atIndex:0];
             path = [_private->hostToBuiltInIconPath objectForKey:truncatedHost];
             if(path){
-                icons = [_private->hostToBuiltInIcons objectForKey:truncatedHost];
-                if(!icons){
-                    icon = [[NSImage alloc] initWithContentsOfFile:path];
-                    if(icon){
-                        icons = [NSMutableArray arrayWithObject:icon];
-                        [_private->hostToBuiltInIcons setObject:icons forKey:host];
-                        [icon release];
-                    }
-                }
-                if(icons){
-                    return icons;
-                }
+                return path;
             }
         }
     }
@@ -433,6 +422,26 @@ NSSize WebIconMediumSize = {32, 32};
     return nil;
 }
 
+- (NSMutableArray *)_builtInIconsForHost:(NSString *)host
+{
+    NSString *path = [self _pathForBuiltInIconForHost:host];
+    NSMutableArray *icons = nil;
+    
+    if(path){
+        icons = [_private->pathToBuiltInIcons objectForKey:path];    
+        if(!icons){
+            NSImage *icon = [[NSImage alloc] initWithContentsOfFile:path];
+            if(icon){
+                icons = [NSMutableArray arrayWithObject:icon];
+                [_private->pathToBuiltInIcons setObject:icons forKey:path];
+                [icon release];
+            }
+        }
+    }
+    
+    return icons;
+}
+
 - (void)_setIcon:(NSImage *)icon forIconURL:(NSURL *)iconURL
 {
     if(!icon || !iconURL){
diff --git a/WebKit/Misc.subproj/WebIconDatabasePrivate.h b/WebKit/Misc.subproj/WebIconDatabasePrivate.h
index 9dc84b6..cce92fa 100644
--- a/WebKit/Misc.subproj/WebIconDatabasePrivate.h
+++ b/WebKit/Misc.subproj/WebIconDatabasePrivate.h
@@ -22,7 +22,7 @@
     NSMutableDictionary *siteURLToIconURL;    
     NSMutableDictionary *futureSiteURLToRetainCount;
     NSMutableDictionary *hostToSiteURLs;
-    NSMutableDictionary *hostToBuiltInIcons;
+    NSMutableDictionary *pathToBuiltInIcons;
     NSMutableDictionary *hostToBuiltInIconPath;
     
     NSMutableSet *iconsOnDiskWithURLs;
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 49e3ed6..d558b9c 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -462,7 +462,7 @@
             
             if(!_private->iconURL){
                 // No icon URL from the LINK tag so try the server's root
-                _private->iconURL = [[NSURL _web_URLWithString:@"/favicon.ico" relativeToURL:dataSourceURL] retain];
+                _private->iconURL = [[[NSURL _web_URLWithString:@"/favicon.ico" relativeToURL:dataSourceURL] absoluteURL] retain];
             }
 
             if(_private->iconURL != nil){

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list