diff options
Diffstat (limited to 'WebKit/mac/Misc/WebIconDatabase.mm')
-rw-r--r-- | WebKit/mac/Misc/WebIconDatabase.mm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/WebKit/mac/Misc/WebIconDatabase.mm b/WebKit/mac/Misc/WebIconDatabase.mm index d4df14b..62c8e2f 100644 --- a/WebKit/mac/Misc/WebIconDatabase.mm +++ b/WebKit/mac/Misc/WebIconDatabase.mm @@ -65,8 +65,12 @@ NSSize WebIconLargeSize = {128, 128}; static WebIconDatabaseClient* defaultClient() { +#if ENABLE(ICONDATABASE) static WebIconDatabaseClient* defaultClient = new WebIconDatabaseClient(); return defaultClient; +#else + return 0; +#endif } @interface WebIconDatabase (WebReallyInternal) @@ -584,6 +588,8 @@ bool importToWebCoreFormat() // here because this code is only executed once for each icon database instance. We could // make this configurable on a per-client basis someday if that seemed useful. // See <rdar://problem/5320208>. + // FIXME: This has nothing to do with importing from the old to the new database format and should be moved elsewhere, + // especially because we might eventually delete all of this legacy importing code and we shouldn't delete this. CFStringRef databasePath = iconDatabase()->databasePath().createCFString(); if (databasePath) { CFURLRef databasePathURL = CFURLCreateWithFileSystemPath(0, databasePath, kCFURLPOSIXPathStyle, FALSE); @@ -614,6 +620,13 @@ bool importToWebCoreFormat() if (![pageURLToIconURL isKindOfClass:[NSMutableDictionary class]]) pageURLToIconURL = nil; + if (!pageURLToIconURL) { + // We found no Safari-2-style icon database. Bail out immediately and do not delete everything + // in whatever directory we ended up looking in! Return true so we won't bother to check again. + // FIXME: We can probably delete all of the code to convert Safari-2-style icon databases now. + return true; + } + NSEnumerator *enumerator = [pageURLToIconURL keyEnumerator]; NSString *url, *iconURL; |