Commit fcfb1285 authored by beidson's avatar beidson
Browse files

Reviewed by Maciej

        The ICONDEBUG flag no choose either/or the new icon database and the old one
        No longer any need to live side by side to compare results

        * Misc/WebIconDatabase.m:
        (-[NSMutableDictionary iconURLForURL:]):
        (-[NSMutableDictionary retainIconForURL:]):
        (-[NSMutableDictionary releaseIconForURL:]):
        (-[WebIconDatabase _setHaveNoIconForIconURL:]):
        (-[WebIconDatabase _setIconURL:forURL:]):
        (-[WebIconDatabase _resetCachedWebPreferences:]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15259 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3e865649
2006-07-09 Brady Eidson <beidson@apple.com>
Reviewed by Maciej
The ICONDEBUG flag no choose either/or the new icon database and the old one
No longer any need to live side by side to compare results
* Misc/WebIconDatabase.m:
(-[NSMutableDictionary iconURLForURL:]):
(-[NSMutableDictionary retainIconForURL:]):
(-[NSMutableDictionary releaseIconForURL:]):
(-[WebIconDatabase _setHaveNoIconForIconURL:]):
(-[WebIconDatabase _setIconURL:forURL:]):
(-[WebIconDatabase _resetCachedWebPreferences:]):
2006-07-08 Timothy Hatcher <timothy@apple.com>
Reviewed by Maciej.
......
......@@ -214,14 +214,12 @@ - (NSString *)iconURLForURL:(NSString *)URL
{
if (![self _isEnabled])
return nil;
#ifdef ICONDEBUG
NSString* iconurl = [_private->databaseBridge iconURLForPageURL:URL];
NSString* oldURL = [_private->pageURLToIconURL objectForKey:URL];
if ([oldURL isEqualToString:iconurl])
LOG(IconDatabase,"iconURLForURL - Old and New icon databases agree on %@ for PageURL %@", iconurl, URL);
else
LOG(IconDatabase,"iconURLForURL - Old (%@) and New (%@) disagree on PageURL %@", oldURL, iconurl, URL );
return iconurl;
#endif
return URL ? [_private->pageURLToIconURL objectForKey:URL] : nil;
}
......@@ -248,12 +246,15 @@ - (void)retainIconForURL:(NSString *)URL
ASSERT(URL);
if (![self _isEnabled])
return;
WebNSUInteger retainCount = (WebNSUInteger)(void *)CFDictionaryGetValue(_private->pageURLToRetainCount, URL);
CFDictionarySetValue(_private->pageURLToRetainCount, URL, (void *)(retainCount + 1));
#ifdef ICONDEBUG
[_private->databaseBridge retainIconForURL:URL];
return;
#endif
WebNSUInteger retainCount = (WebNSUInteger)(void *)CFDictionaryGetValue(_private->pageURLToRetainCount, URL);
CFDictionarySetValue(_private->pageURLToRetainCount, URL, (void *)(retainCount + 1));
}
- (void)releaseIconForURL:(NSString *)pageURL
......@@ -261,8 +262,10 @@ - (void)releaseIconForURL:(NSString *)pageURL
ASSERT(pageURL);
if (![self _isEnabled])
return;
#ifdef ICONDEBUG
[_private->databaseBridge releaseIconForURL:pageURL];
return;
#endif
WebNSUInteger retainCount = (WebNSUInteger)(void *)CFDictionaryGetValue(_private->pageURLToRetainCount, pageURL);
......@@ -416,6 +419,7 @@ - (void)_setHaveNoIconForIconURL:(NSString *)iconURL
#ifdef ICONDEBUG
[_private->databaseBridge _setHaveNoIconForIconURL:iconURL];
return;
#endif
[_private->iconURLsWithNoIcons addObject:iconURL];
......@@ -443,6 +447,7 @@ - (void)_setIconURL:(NSString *)iconURL forURL:(NSString *)URL
#ifdef ICONDEBUG
[_private->databaseBridge _setIconURL:iconURL forURL:URL];
return;
#endif
if ([[_private->pageURLToIconURL objectForKey:URL] isEqualToString:iconURL]) {
......@@ -881,13 +886,16 @@ - (void)_releaseOriginalIconsOnDisk
- (void)_resetCachedWebPreferences:(NSNotification *)notification
{
BOOL privateBrowsingEnabledNow = [[WebPreferences standardPreferences] privateBrowsingEnabled];
#ifdef ICONDEBUG
[_private->databaseBridge setPrivateBrowsingEnabled:privateBrowsingEnabledNow];
return;
#endif
if (privateBrowsingEnabledNow == _private->privateBrowsingEnabled)
return;
_private->privateBrowsingEnabled = privateBrowsingEnabledNow;
#ifdef ICONDEBUG
[_private->databaseBridge setPrivateBrowsingEnabled:privateBrowsingEnabledNow];
#endif
// When private browsing is turned off, forget everything we learned while it was on
if (!_private->privateBrowsingEnabled) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment