[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 07:43:18 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 8728e458d0fcf3629a243e703064327c3b31c986
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed May 28 00:20:22 2003 +0000

    WebKit:
    
    		Don't load and save icons if the icon DB directory default is not set.
    
            Reviewed by darin.
    
            * Misc.subproj/WebIconDatabase.m:
            (-[WebIconDatabase _createFileDatabase]): don't create the DB if the default is not set
            (-[WebIconDatabase _loadIconDictionaries]): don't load the dictionaries if the DB doesn't exist
            (-[WebIconDatabase _updateFileDatabase]): don't update the DB if it doesn't exist
            * WebView.subproj/WebDataSourcePrivate.m:
            (-[WebDataSource _loadIcon]): don't load icons if the icon DB directory default is not set
    
    WebBrowser:
    
    	Moved the icon DB to ~/Library/Safari/Icons
    
            Reviewed by darin.
    
            * AppController.m:
            (+[AppController initialize]): move the icon DB
            (+[AppController _settingsDirectoryPath]): made this a class method
            (-[AppController settingsDirectoryPath]): call the class method
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4438 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 53c26ce..523f760 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,16 @@
+2003-05-27  Chris Blumenberg  <cblu at apple.com>
+
+		Don't load and save icons if the icon DB directory default is not set.
+
+        Reviewed by darin.
+
+        * Misc.subproj/WebIconDatabase.m:
+        (-[WebIconDatabase _createFileDatabase]): don't create the DB if the default is not set
+        (-[WebIconDatabase _loadIconDictionaries]): don't load the dictionaries if the DB doesn't exist
+        (-[WebIconDatabase _updateFileDatabase]): don't update the DB if it doesn't exist
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource _loadIcon]): don't load icons if the icon DB directory default is not set
+
 2003-05-27  Maciej Stachowiak  <mjs at apple.com>
 
 	Rolled in fix from Safari-80~1-branch
diff --git a/WebKit/Misc.subproj/WebIconDatabase.h b/WebKit/Misc.subproj/WebIconDatabase.h
index e797eac..f7b1701 100644
--- a/WebKit/Misc.subproj/WebIconDatabase.h
+++ b/WebKit/Misc.subproj/WebIconDatabase.h
@@ -51,6 +51,8 @@ extern NSSize WebIconLargeSize;  // 128 x 128
 */
 + (WebIconDatabase *)sharedIconDatabase;
 
+- (BOOL)iconsAreSaved;
+
 /*!
     @method iconForURL:withSize:
     @discussion Calls iconForURL:withSize:cache: with YES for cache.
diff --git a/WebKit/Misc.subproj/WebIconDatabase.m b/WebKit/Misc.subproj/WebIconDatabase.m
index ff09d25..483e81c 100644
--- a/WebKit/Misc.subproj/WebIconDatabase.m
+++ b/WebKit/Misc.subproj/WebIconDatabase.m
@@ -37,7 +37,6 @@ NSSize WebIconLargeSize = {128, 128};
 @end
 
 @interface WebIconDatabase (WebInternal)
-
 - (void)_createFileDatabase;
 - (void)_loadIconDictionaries;
 - (void)_updateFileDatabase;
@@ -55,7 +54,6 @@ NSSize WebIconLargeSize = {128, 128};
 - (NSMutableDictionary *)_iconsBySplittingRepresentationsOfIcon:(NSImage *)icon;
 - (NSImage *)_iconFromDictionary:(NSMutableDictionary *)icons forSize:(NSSize)size cache:(BOOL)cache;
 - (void)_scaleIcon:(NSImage *)icon toSize:(NSSize)size;
-
 @end
 
 
@@ -76,7 +74,7 @@ NSSize WebIconLargeSize = {128, 128};
     [super init];
     
     _private = [[WebIconDatabasePrivate alloc] init];
-    
+
     [self _createFileDatabase];
     [self _loadIconDictionaries];
 
@@ -101,6 +99,11 @@ NSSize WebIconLargeSize = {128, 128};
     return self;
 }
 
+- (BOOL)iconsAreSaved
+{
+    return (_private->fileDatabase != nil);
+}
+
 - (NSImage *)iconForURL:(NSString *)URL withSize:(NSSize)size cache:(BOOL)cache
 {
     ASSERT(size.width);
@@ -221,8 +224,7 @@ NSSize WebIconLargeSize = {128, 128};
     NSString *databaseDirectory = [[NSUserDefaults standardUserDefaults] objectForKey:WebIconDatabaseDirectoryDefaultsKey];
 
     if (!databaseDirectory) {
-        NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier];
-        databaseDirectory = [NSString stringWithFormat:@"%@/Library/Caches/WebKitIcons/%@", NSHomeDirectory(), bundleIdentifier];
+        return;
     }
 
     _private->fileDatabase = [[WebFileDatabase alloc] initWithPath:databaseDirectory];
@@ -274,7 +276,10 @@ NSSize WebIconLargeSize = {128, 128};
 - (void)_loadIconDictionaries
 {
     WebFileDatabase *fileDB = _private->fileDatabase;
-
+    if (!fileDB) {
+        return;
+    }
+    
     NSNumber *version = [fileDB objectForKey:WebIconDatabaseVersionKey];
     int v = 0;
     // no version means first version
@@ -309,6 +314,9 @@ NSSize WebIconLargeSize = {128, 128};
     }
 
     WebFileDatabase *fileDB = _private->fileDatabase;
+    if (!fileDB) {
+        return;
+    }
 
     [fileDB setObject:[NSNumber numberWithInt:WebIconDatabaseCurrentVersion] forKey:WebIconDatabaseVersionKey];
 
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index 428fa98..b37de8e 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -183,7 +183,6 @@
 </dict>
 </plist>
 ";
-			shouldUseHeadermap = 0;
 		};
 		0867D69DFE84028FC02AAC07 = {
 			buildActionMask = 2147483647;
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index eef507d..7528e76 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -608,7 +608,9 @@
 
 - (void)_loadIcon
 {
-    if([self webFrame] != [[self _webView] mainFrame] || _private->mainDocumentError || _private->iconLoader){
+    // Don't load an icon if 1) this is not the main frame 2) we ended in error 3) we already did 4) they aren't save by the DB.
+    if ([self webFrame] != [[self _webView] mainFrame] || _private->mainDocumentError || _private->iconLoader ||
+       ![[WebIconDatabase sharedIconDatabase] iconsAreSaved]) {
         return;
     }
                 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list