WebCore:
authorbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Jul 2006 17:47:41 +0000 (17:47 +0000)
committerbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Jul 2006 17:47:41 +0000 (17:47 +0000)
        Reviewed by Alexey

        Resolved the console error messages people got from the new DB even if they didn't have it enabled

        * icon/IconDatabase.cpp:
        (WebCore::IconDatabase::pruneUnreferencedIcons):
        (WebCore::IconDatabase::pruneUnretainedIcons):
        Added quick check to bail if the DB isn't open

WebKit:

        Reviewed by Alexey

        Resolved the console error messages people got from the new DB even if they didn't have it enabled

        * Misc/WebIconDatabase.m:
        (-[WebIconDatabase init]):
        Disabled initializing the IconDatabaseBridge if user is living on the old DB

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15308 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/icon/IconDatabase.cpp
WebKit/ChangeLog
WebKit/Misc/WebIconDatabase.m

index f7481557c27ae308a81e4815c04442152031fb57..20ee1b13811eb28dbe1f0e680d16c7dc882b8d51 100644 (file)
@@ -1,3 +1,14 @@
+2006-07-10  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Alexey
+
+        Resolved the console error messages people got from the new DB even if they didn't have it enabled
+
+        * icon/IconDatabase.cpp:
+        (WebCore::IconDatabase::pruneUnreferencedIcons):
+        (WebCore::IconDatabase::pruneUnretainedIcons):
+        Added quick check to bail if the DB isn't open
+
 2006-07-10  David Harrison  <harrison@apple.com>
 
         Reviewed by Tim Hatcher
index 75e0d1b2af7d6f506871c0561da2e0b7baa4a373..5705e18b011a1c9c82021d62f11aebe18236fe54 100644 (file)
@@ -706,7 +706,7 @@ void IconDatabase::performSetIconURLForPageURL(int64_t iconID, const String& pag
 
 void IconDatabase::pruneUnreferencedIcons(int numberToPrune)
 {
-    if (!numberToPrune)
+    if (!numberToPrune || !isOpen())
         return;
     
     if (numberToPrune > 0) {
@@ -720,7 +720,9 @@ void IconDatabase::pruneUnreferencedIcons(int numberToPrune)
 
 void IconDatabase::pruneUnretainedIcons(Timer<IconDatabase>* timer)
 {
-
+    if (!isOpen())
+        return;
+        
 // FIXME - The PageURL delete and the pruneunreferenced icons need to be in an atomic transaction
 #ifndef NDEBUG
     double start = CFAbsoluteTimeGetCurrent();
index c181c62b406055590d3d7619132c0a4bccded174..0242f710c925149de178337561a72d969e8f904f 100644 (file)
@@ -1,3 +1,13 @@
+2006-07-10  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Alexey
+
+        Resolved the console error messages people got from the new DB even if they didn't have it enabled
+
+        * Misc/WebIconDatabase.m:
+        (-[WebIconDatabase init]):
+        Disabled initializing the IconDatabaseBridge if user is living on the old DB
+
 2006-07-10  Darin Adler  <darin@apple.com>
 
         - try to fix Windows build
index 27ef7dd83c7a393792059d48677835ccaae7e726..b627d46f1d008bc3523b3996674496992f9bf587 100644 (file)
@@ -123,6 +123,7 @@ NSSize WebIconLargeSize = {128, 128};
 
     _isClosing = NO;
 
+#ifdef ICONDEBUG
     _private->databaseBridge = [WebCoreIconDatabaseBridge sharedBridgeInstance];
     if (_private->databaseBridge) {
         NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
@@ -135,6 +136,9 @@ NSSize WebIconLargeSize = {128, 128};
         databaseDirectory = [databaseDirectory stringByExpandingTildeInPath];
         [_private->databaseBridge openSharedDatabaseWithPath:databaseDirectory];
     }
+#else
+    _private->databaseBridge = nil;
+#endif
     
     _private->iconURLToIcons = [[NSMutableDictionary alloc] init];
     _private->iconURLToExtraRetainCount = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, NULL);