https://bugs.webkit.org/show_bug.cgi?id=55721
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Mar 2011 00:52:52 +0000 (00:52 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Mar 2011 00:52:52 +0000 (00:52 +0000)
Global IconDatabase should be returned by reference, not as a pointer

Reviewed by Darin Adler.

../WebCore:

* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
(WebCore::HistoryItem::~HistoryItem):
(WebCore::HistoryItem::reset):
(WebCore::HistoryItem::icon):
(WebCore::HistoryItem::setURLString):

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::startIconLoader):
(WebCore::FrameLoader::commitIconURLToIconDatabase):

* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):

* loader/icon/IconDatabase.cpp:
(WebCore::iconDatabase):
* loader/icon/IconDatabase.h:
* loader/icon/IconDatabaseNone.cpp:
(WebCore::iconDatabase):
* loader/icon/wince/IconDatabaseWinCE.cpp:
(WebCore::iconDatabase):

* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::finishLoading):

../WebKit/efl:

* ewk/ewk_settings.cpp:
(ewk_settings_icon_database_path_set):
(ewk_settings_icon_database_path_get):
(ewk_settings_icon_database_clear):
(ewk_settings_icon_database_icon_surface_get):
(ewk_settings_icon_database_icon_object_add):

../WebKit/gtk:

* webkit/webkitglobals.cpp:
(closeIconDatabaseOnExit):
(WebKit::setIconDatabaseEnabled):
* webkit/webkitwebview.cpp:
(webkit_web_view_get_icon_uri):

../WebKit/mac:

* Misc/WebCoreStatistics.mm:
(+[WebCoreStatistics iconPageURLMappingCount]):
(+[WebCoreStatistics iconRetainedPageURLCount]):
(+[WebCoreStatistics iconRecordCount]):
(+[WebCoreStatistics iconsWithDataCount]):
* Misc/WebIconDatabase.mm:
(-[WebIconDatabase init]):
(-[WebIconDatabase iconForURL:withSize:cache:]):
(-[WebIconDatabase iconURLForURL:]):
(-[WebIconDatabase defaultIconWithSize:]):
(-[WebIconDatabase retainIconForURL:]):
(-[WebIconDatabase releaseIconForURL:]):
(-[WebIconDatabase isEnabled]):
(-[WebIconDatabase setEnabled:]):
(-[WebIconDatabase removeAllIcons]):
(+[WebIconDatabase _checkIntegrityBeforeOpening]):
(-[WebIconDatabase _startUpIconDatabase]):
(-[WebIconDatabase _applicationWillTerminate:]):
(-[WebIconDatabase _resetCachedWebPreferences:]):
(importToWebCoreFormat):
* WebView/WebView.mm:
(-[WebView _dispatchDidReceiveIconFromWebFrame:]):

../WebKit/qt:

* Api/qwebsettings.cpp:
(QWebSettings::setIconDatabasePath):
(QWebSettings::iconDatabasePath):
(QWebSettings::clearIconDatabase):
(QWebSettings::iconForUrl):

../WebKit/win:

* WebCoreStatistics.cpp:
(WebCoreStatistics::iconPageURLMappingCount):
(WebCoreStatistics::iconRetainedPageURLCount):
(WebCoreStatistics::iconRecordCount):
(WebCoreStatistics::iconsWithDataCount):
* WebIconDatabase.cpp:
(WebIconDatabase::init):
(WebIconDatabase::startUpIconDatabase):
(WebIconDatabase::iconForURL):
(WebIconDatabase::retainIconForURL):
(WebIconDatabase::releaseIconForURL):
(WebIconDatabase::removeAllIcons):
(WebIconDatabase::iconURLForURL):
(WebIconDatabase::isEnabled):
(WebIconDatabase::setEnabled):
(WebIconDatabase::hasIconForURL):
(WebIconDatabase::getOrCreateDefaultIconBitmap):
* WebKitDLL.cpp:
(shutDownWebKit):

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

24 files changed:
Source/WebCore/ChangeLog
Source/WebCore/history/HistoryItem.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp
Source/WebCore/loader/icon/IconDatabase.cpp
Source/WebCore/loader/icon/IconDatabase.h
Source/WebCore/loader/icon/IconDatabaseNone.cpp
Source/WebCore/loader/icon/IconLoader.cpp
Source/WebCore/loader/icon/wince/IconDatabaseWinCE.cpp
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/ewk/ewk_settings.cpp
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/webkit/webkitglobals.cpp
Source/WebKit/gtk/webkit/webkitwebview.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Misc/WebCoreStatistics.mm
Source/WebKit/mac/Misc/WebIconDatabase.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/qt/Api/qwebsettings.cpp
Source/WebKit/qt/ChangeLog
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreStatistics.cpp
Source/WebKit/win/WebIconDatabase.cpp
Source/WebKit/win/WebKitDLL.cpp

index 202d5efb148bf9239c42878b7a749b1cf6bb85fc..ed69b5833b32bcdd0b955e0eb7625b9140e74667 100644 (file)
@@ -1,3 +1,35 @@
+2011-03-03  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=55721
+        Global IconDatabase should be returned by reference, not as a pointer
+
+        * history/HistoryItem.cpp:
+        (WebCore::HistoryItem::HistoryItem):
+        (WebCore::HistoryItem::~HistoryItem):
+        (WebCore::HistoryItem::reset):
+        (WebCore::HistoryItem::icon):
+        (WebCore::HistoryItem::setURLString):
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::startIconLoader):
+        (WebCore::FrameLoader::commitIconURLToIconDatabase):
+
+        * loader/archive/cf/LegacyWebArchive.cpp:
+        (WebCore::LegacyWebArchive::create):
+
+        * loader/icon/IconDatabase.cpp:
+        (WebCore::iconDatabase):
+        * loader/icon/IconDatabase.h:
+        * loader/icon/IconDatabaseNone.cpp:
+        (WebCore::iconDatabase):
+        * loader/icon/wince/IconDatabaseWinCE.cpp:
+        (WebCore::iconDatabase):
+
+        * loader/icon/IconLoader.cpp:
+        (WebCore::IconLoader::finishLoading):
+
 2011-03-03  Ryosuke Niwa  <rniwa@webkit.org>
 
         Reviewed by Martin Robinson.
index c698db3e00d23a928c6d3c246dfeb86e4891f194..c31aa86c85ea1819d3d89f51300d9a4235b4bf93 100644 (file)
@@ -85,7 +85,7 @@ HistoryItem::HistoryItem(const String& urlString, const String& title, double ti
     , m_next(0)
     , m_prev(0)
 {    
-    iconDatabase()->retainIconForPageURL(m_urlString);
+    iconDatabase().retainIconForPageURL(m_urlString);
 }
 
 HistoryItem::HistoryItem(const String& urlString, const String& title, const String& alternateTitle, double time)
@@ -104,7 +104,7 @@ HistoryItem::HistoryItem(const String& urlString, const String& title, const Str
     , m_next(0)
     , m_prev(0)
 {
-    iconDatabase()->retainIconForPageURL(m_urlString);
+    iconDatabase().retainIconForPageURL(m_urlString);
 }
 
 HistoryItem::HistoryItem(const KURL& url, const String& target, const String& parent, const String& title)
@@ -124,13 +124,13 @@ HistoryItem::HistoryItem(const KURL& url, const String& target, const String& pa
     , m_next(0)
     , m_prev(0)
 {    
-    iconDatabase()->retainIconForPageURL(m_urlString);
+    iconDatabase().retainIconForPageURL(m_urlString);
 }
 
 HistoryItem::~HistoryItem()
 {
     ASSERT(!m_cachedPage);
-    iconDatabase()->releaseIconForPageURL(m_urlString);
+    iconDatabase().releaseIconForPageURL(m_urlString);
 #if PLATFORM(ANDROID)
     if (m_bridge)
         m_bridge->detachHistoryItem();
@@ -178,7 +178,7 @@ PassRefPtr<HistoryItem> HistoryItem::copy() const
 
 void HistoryItem::reset()
 {
-    iconDatabase()->releaseIconForPageURL(m_urlString);
+    iconDatabase().releaseIconForPageURL(m_urlString);
 
     m_urlString = String();
     m_originalURLString = String();
@@ -232,8 +232,8 @@ const String& HistoryItem::alternateTitle() const
 
 Image* HistoryItem::icon() const
 {
-    Image* result = iconDatabase()->iconForPageURL(m_urlString, IntSize(16, 16));
-    return result ? result : iconDatabase()->defaultIcon(IntSize(16, 16));
+    Image* result = iconDatabase().iconForPageURL(m_urlString, IntSize(16, 16));
+    return result ? result : iconDatabase().defaultIcon(IntSize(16, 16));
 }
 
 double HistoryItem::lastVisitedTime() const
@@ -275,9 +275,9 @@ void HistoryItem::setAlternateTitle(const String& alternateTitle)
 void HistoryItem::setURLString(const String& urlString)
 {
     if (m_urlString != urlString) {
-        iconDatabase()->releaseIconForPageURL(m_urlString);
+        iconDatabase().releaseIconForPageURL(m_urlString);
         m_urlString = urlString;
-        iconDatabase()->retainIconForPageURL(m_urlString);
+        iconDatabase().retainIconForPageURL(m_urlString);
     }
     
     notifyHistoryItemChanged(this);
index d532dae422ca3835a4411444acedec4bd431d17b..35f206a749679daf8e03d03bc5de63315d850892 100644 (file)
@@ -692,7 +692,7 @@ void FrameLoader::startIconLoader()
     if (!isLoadingMainFrame())
         return;
 
-    if (!iconDatabase() || !iconDatabase()->isEnabled())
+    if (!iconDatabase().isEnabled())
         return;
     
     KURL url(iconURL());
@@ -702,7 +702,7 @@ void FrameLoader::startIconLoader()
 
     // If we're not reloading and the icon database doesn't say to load now then bail before we actually start the load
     if (loadType() != FrameLoadTypeReload && loadType() != FrameLoadTypeReloadFromOrigin) {
-        IconLoadDecision decision = iconDatabase()->loadDecisionForIconURL(urlString, m_documentLoader.get());
+        IconLoadDecision decision = iconDatabase().loadDecisionForIconURL(urlString, m_documentLoader.get());
         if (decision == IconLoadNo) {
             LOG(IconDatabase, "FrameLoader::startIconLoader() - Told not to load this icon, committing iconURL %s to database for pageURL mapping", urlString.ascii().data());
             commitIconURLToIconDatabase(url);
@@ -711,11 +711,11 @@ void FrameLoader::startIconLoader()
             // If the icon data hasn't been read in from disk yet, kick off the read of the icon from the database to make sure someone
             // has done it.  This is after registering for the notification so the WebView can call the appropriate delegate method.
             // Otherwise if the icon data *is* available, notify the delegate
-            if (!iconDatabase()->iconDataKnownForIconURL(urlString)) {
+            if (!iconDatabase().iconDataKnownForIconURL(urlString)) {
                 LOG(IconDatabase, "Told not to load icon %s but icon data is not yet available - registering for notification and requesting load from disk", urlString.ascii().data());
                 m_client->registerForIconNotification();
-                iconDatabase()->iconForPageURL(m_frame->document()->url().string(), IntSize(0, 0));
-                iconDatabase()->iconForPageURL(originalRequestURL().string(), IntSize(0, 0));
+                iconDatabase().iconForPageURL(m_frame->document()->url().string(), IntSize(0, 0));
+                iconDatabase().iconForPageURL(originalRequestURL().string(), IntSize(0, 0));
             } else
                 m_client->dispatchDidReceiveIcon();
                 
@@ -750,10 +750,9 @@ void FrameLoader::startIconLoader()
 
 void FrameLoader::commitIconURLToIconDatabase(const KURL& icon)
 {
-    ASSERT(iconDatabase());
     LOG(IconDatabase, "Committing iconURL %s to database for pageURLs %s and %s", icon.string().ascii().data(), m_frame->document()->url().string().ascii().data(), originalRequestURL().string().ascii().data());
-    iconDatabase()->setIconURLForPageURL(icon.string(), m_frame->document()->url().string());
-    iconDatabase()->setIconURLForPageURL(icon.string(), originalRequestURL().string());
+    iconDatabase().setIconURLForPageURL(icon.string(), m_frame->document()->url().string());
+    iconDatabase().setIconURLForPageURL(icon.string(), originalRequestURL().string());
 }
 
 void FrameLoader::finishedParsing()
index d9575fe9b02c20cd9b5c3b5ad3997821a5a35387..7979423c9dbd15fa43d3c0d29d123e515cca263e 100644 (file)
@@ -545,10 +545,10 @@ PassRefPtr<LegacyWebArchive> LegacyWebArchive::create(const String& markupString
     }
 
     // Add favicon if one exists for this page, if we are archiving the entire page.
-    if (nodesSize && nodes[0]->isDocumentNode() && iconDatabase() && iconDatabase()->isEnabled()) {
-        const String& iconURL = iconDatabase()->iconURLForPageURL(responseURL);
-        if (!iconURL.isEmpty() && iconDatabase()->iconDataKnownForIconURL(iconURL)) {
-            if (Image* iconImage = iconDatabase()->iconForPageURL(responseURL, IntSize(16, 16))) {
+    if (nodesSize && nodes[0]->isDocumentNode() && iconDatabase().isEnabled()) {
+        const String& iconURL = iconDatabase().iconURLForPageURL(responseURL);
+        if (!iconURL.isEmpty() && iconDatabase().iconDataKnownForIconURL(iconURL)) {
+            if (Image* iconImage = iconDatabase().iconForPageURL(responseURL, IntSize(16, 16))) {
                 if (RefPtr<ArchiveResource> resource = ArchiveResource::create(iconImage->data(), KURL(ParsedURLString, iconURL), "image/x-icon", "", ""))
                     subresources.append(resource.release());
             }
index c00d3958dbdcdf1de2d55842e4a008a2423e4e8a..c5863c1ce0582c3b430a167e4805badcd90eb308 100644 (file)
@@ -91,13 +91,13 @@ static IconDatabaseClient* defaultClient()
     return defaultClient;
 }
 
-IconDatabase* iconDatabase()
+IconDatabase& iconDatabase()
 {
     if (!sharedIconDatabase) {
         ScriptController::initializeThreading();
         sharedIconDatabase = new IconDatabase;
     }
-    return sharedIconDatabase;
+    return *sharedIconDatabase;
 }
 
 // ************************
index 5dc8288434429eb584c60f61a3fc4cfc91bd9d5d..8617430d65ce3bd66e26567e4d8eb667eb0d4f54 100644 (file)
@@ -106,7 +106,7 @@ public:
 private:
     IconDatabase();
     ~IconDatabase();
-    friend IconDatabase* iconDatabase();
+    friend IconDatabase& iconDatabase();
 
 #if ENABLE(ICONDATABASE)
     static void notifyPendingLoadDecisionsOnMainThread(void*);
@@ -240,7 +240,7 @@ private:
 };
 
 // Function to obtain the global icon database.
-IconDatabase* iconDatabase();
+IconDatabase& iconDatabase();
 
 } // namespace WebCore
 
index 7b7cc9f6217cca22895f4273df7f107d28c749a9..de28cddf59101f9b263d975e3bdf6baf361e1792 100644 (file)
@@ -56,11 +56,11 @@ String IconDatabase::defaultDatabaseFilename()
     return defaultDatabaseFilename.threadsafeCopy();
 }
 
-IconDatabase* iconDatabase()
+IconDatabase& iconDatabase()
 {
     if (!sharedIconDatabase)
         sharedIconDatabase = new IconDatabase;
-    return sharedIconDatabase;
+    return *sharedIconDatabase;
 }
 
 IconDatabase::IconDatabase()
index 5d57e3817267b03daea587afaced5fcd9cca6b08..96e6954173f5f674d3aa239a755303c2a8f45038 100644 (file)
@@ -161,7 +161,7 @@ void IconLoader::finishLoading(const KURL& iconURL, PassRefPtr<SharedBuffer> dat
         // Setting the icon data only after committing to the database ensures that the data is
         // kept in memory (so it does not have to be read from the database asynchronously), since
         // there is a page URL referencing it.
-        iconDatabase()->setIconDataForIconURL(data, iconURL.string());
+        iconDatabase().setIconDataForIconURL(data, iconURL.string());
         m_frame->loader()->client()->dispatchDidReceiveIcon();
     }
 
index 54a36e5b62e6dda88106413ed16dc26578dd4af2..50d3a70c2ae1b77f3d05d36e92e4d213d1e79285 100644 (file)
 
 namespace WebCore {
 
+static IconDatabase* sharedIconDatabase = 0;
+
 // Function to obtain the global icon database.
-IconDatabase* iconDatabase() { return 0; }
+IconDatabase& iconDatabase()
+{
+    if (!sharedIconDatabase)
+        sharedIconDatabase = new IconDatabase;
+    return *sharedIconDatabase;
+}
 
 IconDatabase::IconDatabase() {}
 IconDatabase::~IconDatabase() {}
index 2fc143d6651e89b2e8f5ce2f374d8c505bcad71f..7549974d59ac34b5a74669bc73d46b6318420749 100644 (file)
@@ -1,3 +1,17 @@
+2011-03-03  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=55721
+        Global IconDatabase should be returned by reference, not as a pointer
+
+        * ewk/ewk_settings.cpp:
+        (ewk_settings_icon_database_path_set):
+        (ewk_settings_icon_database_path_get):
+        (ewk_settings_icon_database_clear):
+        (ewk_settings_icon_database_icon_surface_get):
+        (ewk_settings_icon_database_icon_object_add):
+
 2011-03-03  Alexey Proskuryakov  <ap@apple.com>
 
         Removing an include of WebCoreKeyboardUIMode.h that Ive just added. It's already included
index c35a62ec8fe35819c8989de3321471c36e42bba0..580e1e6be48f6e1e156a9a1da0eb84414c86507a 100644 (file)
@@ -134,7 +134,7 @@ const char *ewk_settings_web_database_path_get()
  */
 Eina_Bool ewk_settings_icon_database_path_set(const char *directory)
 {
-    WebCore::iconDatabase()->delayDatabaseCleanup();
+    WebCore::iconDatabase().delayDatabaseCleanup();
 
     if (directory) {
         struct stat st;
@@ -155,15 +155,15 @@ Eina_Bool ewk_settings_icon_database_path_set(const char *directory)
             return EINA_FALSE;
         }
 
-        WebCore::iconDatabase()->setEnabled(true);
-        WebCore::iconDatabase()->open(WTF::String::fromUTF8(directory));
+        WebCore::iconDatabase().setEnabled(true);
+        WebCore::iconDatabase().open(WTF::String::fromUTF8(directory));
         if (!_ewk_icon_database_path)
             _ewk_icon_database_path = eina_stringshare_add(directory);
         else
             eina_stringshare_replace(&_ewk_icon_database_path, directory);
     } else {
-        WebCore::iconDatabase()->setEnabled(false);
-        WebCore::iconDatabase()->close();
+        WebCore::iconDatabase().setEnabled(false);
+        WebCore::iconDatabase().close();
         if (_ewk_icon_database_path) {
             eina_stringshare_del(_ewk_icon_database_path);
             _ewk_icon_database_path = 0;
@@ -183,9 +183,9 @@ Eina_Bool ewk_settings_icon_database_path_set(const char *directory)
  */
 const char* ewk_settings_icon_database_path_get(void)
 {
-    if (!WebCore::iconDatabase()->isEnabled())
+    if (!WebCore::iconDatabase().isEnabled())
         return 0;
-    if (!WebCore::iconDatabase()->isOpen())
+    if (!WebCore::iconDatabase().isOpen())
         return 0;
 
     return _ewk_icon_database_path;
@@ -202,12 +202,12 @@ const char* ewk_settings_icon_database_path_get(void)
  */
 Eina_Bool ewk_settings_icon_database_clear(void)
 {
-    if (!WebCore::iconDatabase()->isEnabled())
+    if (!WebCore::iconDatabase().isEnabled())
         return EINA_FALSE;
-    if (!WebCore::iconDatabase()->isOpen())
+    if (!WebCore::iconDatabase().isOpen())
         return EINA_FALSE;
 
-    WebCore::iconDatabase()->removeAllIcons();
+    WebCore::iconDatabase().removeAllIcons();
     return EINA_TRUE;
 }
 
@@ -226,7 +226,7 @@ cairo_surface_t* ewk_settings_icon_database_icon_surface_get(const char *url)
     EINA_SAFETY_ON_NULL_RETURN_VAL(url, 0);
 
     WebCore::KURL kurl(WebCore::KURL(), WTF::String::fromUTF8(url));
-    WebCore::Image *icon = WebCore::iconDatabase()->iconForPageURL(kurl.string(), WebCore::IntSize(16, 16));
+    WebCore::Image *icon = WebCore::iconDatabase().iconForPageURL(kurl.string(), WebCore::IntSize(16, 16));
 
     if (!icon) {
         ERR("no icon for url %s", url);
@@ -258,7 +258,7 @@ Evas_Object* ewk_settings_icon_database_icon_object_add(const char* url, Evas* c
     EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0);
 
     WebCore::KURL kurl(WebCore::KURL(), WTF::String::fromUTF8(url));
-    WebCore::Image* icon = WebCore::iconDatabase()->iconForPageURL(kurl.string(), WebCore::IntSize(16, 16));
+    WebCore::Image* icon = WebCore::iconDatabase().iconForPageURL(kurl.string(), WebCore::IntSize(16, 16));
     cairo_surface_t* surface;
 
     if (!icon) {
index d7ae20e8565290bad9dc63729941ee5dbe829bc0..333b8b3d2af3406023edd7b2a5fb44da9e825424 100644 (file)
@@ -1,3 +1,16 @@
+2011-03-03  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=55721
+        Global IconDatabase should be returned by reference, not as a pointer
+
+        * webkit/webkitglobals.cpp:
+        (closeIconDatabaseOnExit):
+        (WebKit::setIconDatabaseEnabled):
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_get_icon_uri):
+
 2011-03-03  Alexey Proskuryakov  <ap@apple.com>
 
         Removing an include of WebCoreKeyboardUIMode.h that Ive just added. It's already included
index 052800d882a7a585f449166313c6ede5bae1323d..4d07ceb80ec2bca12784ad92ce1b65c45bdee7a5 100644 (file)
@@ -225,7 +225,7 @@ static GtkWidget* currentToplevelCallback(WebKitSoupAuthDialog* feature, SoupMes
 
 static void closeIconDatabaseOnExit()
 {
-    iconDatabase()->close();
+    iconDatabase().close();
 }
 
 void webkitInit()
@@ -289,14 +289,14 @@ void setIconDatabaseEnabled(bool enabled)
     }
 
     if (enabled) {
-        iconDatabase()->setEnabled(true);
+        iconDatabase().setEnabled(true);
         GOwnPtr<gchar> iconDatabasePath(g_build_filename(g_get_user_data_dir(), "webkit", "icondatabase", NULL));
-        iconDatabase()->open(iconDatabasePath.get());
+        iconDatabase().open(iconDatabasePath.get());
         return;
     }
 
-    iconDatabase()->setEnabled(false);
-    iconDatabase()->close();
+    iconDatabase().setEnabled(false);
+    iconDatabase().close();
 }
 
 
index 79665a914567b37f85b91958b8e2e5771f5d3acb..0ffc9d9c487a342c8541f98c2dd84f7741d07e05 100644 (file)
@@ -5058,7 +5058,7 @@ WebKitHitTestResult* webkit_web_view_get_hit_test_result(WebKitWebView* webView,
 G_CONST_RETURN gchar* webkit_web_view_get_icon_uri(WebKitWebView* webView)
 {
     g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0);
-    String iconURL = iconDatabase()->iconURLForPageURL(core(webView)->mainFrame()->document()->url().prettyURL());
+    String iconURL = iconDatabase().iconURLForPageURL(core(webView)->mainFrame()->document()->url().prettyURL());
     webView->priv->iconURI = iconURL.utf8();
     return webView->priv->iconURI.data();
 }
index 2d9b394d7bfad7b3fa8560fa3e824ac99a329cc8..add125fe26a66d8358e5f886d766c4f17bbc181d 100644 (file)
@@ -1,3 +1,33 @@
+2011-03-03  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=55721
+        Global IconDatabase should be returned by reference, not as a pointer
+
+        * Misc/WebCoreStatistics.mm:
+        (+[WebCoreStatistics iconPageURLMappingCount]):
+        (+[WebCoreStatistics iconRetainedPageURLCount]):
+        (+[WebCoreStatistics iconRecordCount]):
+        (+[WebCoreStatistics iconsWithDataCount]):
+        * Misc/WebIconDatabase.mm:
+        (-[WebIconDatabase init]):
+        (-[WebIconDatabase iconForURL:withSize:cache:]):
+        (-[WebIconDatabase iconURLForURL:]):
+        (-[WebIconDatabase defaultIconWithSize:]):
+        (-[WebIconDatabase retainIconForURL:]):
+        (-[WebIconDatabase releaseIconForURL:]):
+        (-[WebIconDatabase isEnabled]):
+        (-[WebIconDatabase setEnabled:]):
+        (-[WebIconDatabase removeAllIcons]):
+        (+[WebIconDatabase _checkIntegrityBeforeOpening]):
+        (-[WebIconDatabase _startUpIconDatabase]):
+        (-[WebIconDatabase _applicationWillTerminate:]):
+        (-[WebIconDatabase _resetCachedWebPreferences:]):
+        (importToWebCoreFormat):
+        * WebView/WebView.mm:
+        (-[WebView _dispatchDidReceiveIconFromWebFrame:]):
+
 2011-03-03  Jessie Berlin  <jberlin@apple.com>
 
         Reviewed by Adam Roben.
index c3c36875f24bdef8d20762c22f2353875668c725..d593f8caf1ec3acca5b4b30a83cbd6b2c1954152 100644 (file)
@@ -122,22 +122,22 @@ using namespace WebCore;
 
 + (size_t)iconPageURLMappingCount
 {
-    return iconDatabase()->pageURLMappingCount();
+    return iconDatabase().pageURLMappingCount();
 }
 
 + (size_t)iconRetainedPageURLCount
 {
-    return iconDatabase()->retainedPageURLCount();
+    return iconDatabase().retainedPageURLCount();
 }
 
 + (size_t)iconRecordCount
 {
-    return iconDatabase()->iconRecordCount();
+    return iconDatabase().iconRecordCount();
 }
 
 + (size_t)iconsWithDataCount
 {
-    return iconDatabase()->iconRecordCountWithData();
+    return iconDatabase().iconRecordCountWithData();
 }
 
 + (size_t)cachedFontDataCount
index 14ef037ec2d1346e298ffb3ae780864e8cdcf7a3..50bcd7e586a385b394ab6ce4b1458a53b84ca128 100644 (file)
@@ -119,7 +119,7 @@ static WebIconDatabaseClient* defaultClient()
     [defaults registerDefaults:initialDefaults];
     [initialDefaults release];
     BOOL enabled = [defaults boolForKey:WebIconDatabaseEnabledDefaultsKey];
-    iconDatabase()->setEnabled(enabled);
+    iconDatabase().setEnabled(enabled);
     if (enabled)
         [self _startUpIconDatabase];
     return self;
@@ -138,7 +138,7 @@ static WebIconDatabaseClient* defaultClient()
     if ([URL _webkit_isFileURL])
         return [self _iconForFileURL:URL withSize:size];
       
-    if (Image* image = iconDatabase()->iconForPageURL(URL, IntSize(size)))
+    if (Image* image = iconDatabase().iconForPageURL(URL, IntSize(size)))
         if (NSImage *icon = webGetNSImage(image, size))
             return icon;
     return [self defaultIconForURL:URL withSize:size];
@@ -155,7 +155,7 @@ static WebIconDatabaseClient* defaultClient()
         return nil;
     ASSERT_MAIN_THREAD();
 
-    return iconDatabase()->iconURLForPageURL(URL);
+    return iconDatabase().iconURLForPageURL(URL);
 }
 
 - (NSImage *)defaultIconWithSize:(NSSize)size
@@ -164,7 +164,7 @@ static WebIconDatabaseClient* defaultClient()
     ASSERT(size.width);
     ASSERT(size.height);
     
-    Image* image = iconDatabase()->defaultIcon(IntSize(size));
+    Image* image = iconDatabase().defaultIcon(IntSize(size));
     return image ? image->getNSImage() : nil;
 }
 
@@ -182,7 +182,7 @@ static WebIconDatabaseClient* defaultClient()
     if (![self isEnabled])
         return;
 
-    iconDatabase()->retainIconForPageURL(URL);
+    iconDatabase().retainIconForPageURL(URL);
 }
 
 - (void)releaseIconForURL:(NSString *)pageURL
@@ -192,7 +192,7 @@ static WebIconDatabaseClient* defaultClient()
     if (![self isEnabled])
         return;
 
-    iconDatabase()->releaseIconForPageURL(pageURL);
+    iconDatabase().releaseIconForPageURL(pageURL);
 }
 
 + (void)delayDatabaseCleanup
@@ -227,17 +227,17 @@ static WebIconDatabaseClient* defaultClient()
 
 - (BOOL)isEnabled
 {
-    return iconDatabase()->isEnabled();
+    return iconDatabase().isEnabled();
 }
 
 - (void)setEnabled:(BOOL)flag
 {
     BOOL currentlyEnabled = [self isEnabled];
     if (currentlyEnabled && !flag) {
-        iconDatabase()->setEnabled(false);
+        iconDatabase().setEnabled(false);
         [self _shutDownIconDatabase];
     } else if (!currentlyEnabled && flag) {
-        iconDatabase()->setEnabled(true);
+        iconDatabase().setEnabled(true);
         [self _startUpIconDatabase];
     }
 }
@@ -249,7 +249,7 @@ static WebIconDatabaseClient* defaultClient()
         return;
 
     // Via the IconDatabaseClient interface, removeAllIcons() will send the WebIconDatabaseDidRemoveAllIconsNotification
-    iconDatabase()->removeAllIcons();
+    iconDatabase().removeAllIcons();
 }
 
 @end
@@ -258,7 +258,7 @@ static WebIconDatabaseClient* defaultClient()
 
 + (void)_checkIntegrityBeforeOpening
 {
-    iconDatabase()->checkIntegrityBeforeOpening();
+    iconDatabase().checkIntegrityBeforeOpening();
 }
 
 @end
@@ -286,7 +286,7 @@ static WebIconDatabaseClient* defaultClient()
 
 - (void)_startUpIconDatabase
 {
-    iconDatabase()->setClient(defaultClient());
+    iconDatabase().setClient(defaultClient());
     
     // Figure out the directory we should be using for the icon.db
     NSString *databaseDirectory = [self _databaseDirectory];
@@ -296,14 +296,14 @@ static WebIconDatabaseClient* defaultClient()
     NSString *legacyDB = [databaseDirectory stringByAppendingPathComponent:@"icon.db"];
     NSFileManager *defaultManager = [NSFileManager defaultManager];
     if ([defaultManager fileExistsAtPath:legacyDB isDirectory:&isDirectory] && !isDirectory) {
-        NSString *newDB = [databaseDirectory stringByAppendingPathComponent:iconDatabase()->defaultDatabaseFilename()];
+        NSString *newDB = [databaseDirectory stringByAppendingPathComponent:iconDatabase().defaultDatabaseFilename()];
         if (![defaultManager fileExistsAtPath:newDB])
             rename([legacyDB fileSystemRepresentation], [newDB fileSystemRepresentation]);
     }
     
     // Set the private browsing pref then open the WebCore icon database
-    iconDatabase()->setPrivateBrowsingEnabled([[WebPreferences standardPreferences] privateBrowsingEnabled]);
-    if (!iconDatabase()->open(databaseDirectory))
+    iconDatabase().setPrivateBrowsingEnabled([[WebPreferences standardPreferences] privateBrowsingEnabled]);
+    if (!iconDatabase().open(databaseDirectory))
         LOG_ERROR("Unable to open icon database");
     
     // Register for important notifications
@@ -330,7 +330,7 @@ static WebIconDatabaseClient* defaultClient()
 
 - (void)_applicationWillTerminate:(NSNotification *)notification
 {
-    iconDatabase()->close();
+    iconDatabase().close();
 }
 
 - (NSImage *)_iconForFileURL:(NSString *)file withSize:(NSSize)size
@@ -366,7 +366,7 @@ static WebIconDatabaseClient* defaultClient()
 - (void)_resetCachedWebPreferences:(NSNotification *)notification
 {
     BOOL privateBrowsingEnabledNow = [[WebPreferences standardPreferences] privateBrowsingEnabled];
-    iconDatabase()->setPrivateBrowsingEnabled(privateBrowsingEnabledNow);
+    iconDatabase().setPrivateBrowsingEnabled(privateBrowsingEnabledNow);
 }
 
 - (NSImage *)_largestIconFromDictionary:(NSMutableDictionary *)icons
@@ -626,8 +626,8 @@ bool importToWebCoreFormat()
         iconURL = [pageURLToIconURL objectForKey:url];
         if (!iconURL)
             continue;
-        iconDatabase()->importIconURLForPageURL(iconURL, url);
-        if (iconDatabase()->shouldStopThreadActivity())
+        iconDatabase().importIconURLForPageURL(iconURL, url);
+        if (iconDatabase().shouldStopThreadActivity())
             return false;
     }    
 
@@ -640,14 +640,14 @@ bool importToWebCoreFormat()
     while ((url = [enumerator nextObject]) != nil) {
         iconData = iconDataFromPathForIconURL(databaseDirectory, url);
         if (iconData)
-            iconDatabase()->importIconDataForIconURL(SharedBuffer::wrapNSData(iconData), url);
+            iconDatabase().importIconDataForIconURL(SharedBuffer::wrapNSData(iconData), url);
         else {
             // This really *shouldn't* happen, so it'd be good to track down why it might happen in a debug build
             // however, we do know how to handle it gracefully in release
             LOG_ERROR("%@ is marked as having an icon on disk, but we couldn't get the data for it", url);
-            iconDatabase()->importIconDataForIconURL(0, url);
+            iconDatabase().importIconDataForIconURL(0, url);
         }
-        if (iconDatabase()->shouldStopThreadActivity())
+        if (iconDatabase().shouldStopThreadActivity())
             return false;
     }
     
@@ -656,7 +656,7 @@ bool importToWebCoreFormat()
     NSFileManager *fileManager = [NSFileManager defaultManager];
     enumerator = [[fileManager contentsOfDirectoryAtPath:databaseDirectory error:NULL] objectEnumerator];
 
-    NSString *databaseFilename = iconDatabase()->defaultDatabaseFilename();
+    NSString *databaseFilename = iconDatabase().defaultDatabaseFilename();
 
     BOOL foundIconDB = NO;
     NSString *file;
index c7605a0c8ff7e830aa0f110d694bdb44629782d7..0b0eecedf8e269aadc18418592363a338e480371 100644 (file)
@@ -5847,7 +5847,7 @@ static inline uint64_t roundUpToPowerOf2(uint64_t num)
 
     WebFrameLoadDelegateImplementationCache* cache = &_private->frameLoadDelegateImplementations;
     if (cache->didReceiveIconForFrameFunc) {
-        Image* image = iconDatabase()->iconForPageURL(core(webFrame)->document()->url().string(), IntSize(16, 16));
+        Image* image = iconDatabase().iconForPageURL(core(webFrame)->document()->url().string(), IntSize(16, 16));
         if (NSImage *icon = webGetNSImage(image, NSMakeSize(16, 16)))
             CallFrameLoadDelegate(cache->didReceiveIconForFrameFunc, self, @selector(webView:didReceiveIcon:forFrame:), icon, webFrame);
     }
index e2d6061f61405097cb866b0f63686ee472e12761..3f0b436e99a5158ff9db68bc91839734f3ad2fce 100644 (file)
@@ -645,16 +645,16 @@ QString QWebSettings::defaultTextEncoding() const
 */
 void QWebSettings::setIconDatabasePath(const QString& path)
 {
-    WebCore::iconDatabase()->delayDatabaseCleanup();
+    WebCore::iconDatabase().delayDatabaseCleanup();
 
     if (!path.isEmpty()) {
-        WebCore::iconDatabase()->setEnabled(true);
+        WebCore::iconDatabase().setEnabled(true);
         QFileInfo info(path);
         if (info.isDir() && info.isWritable())
-            WebCore::iconDatabase()->open(path);
+            WebCore::iconDatabase().open(path);
     } else {
-        WebCore::iconDatabase()->setEnabled(false);
-        WebCore::iconDatabase()->close();
+        WebCore::iconDatabase().setEnabled(false);
+        WebCore::iconDatabase().close();
     }
 }
 
@@ -666,8 +666,8 @@ void QWebSettings::setIconDatabasePath(const QString& path)
 */
 QString QWebSettings::iconDatabasePath()
 {
-    if (WebCore::iconDatabase()->isEnabled() && WebCore::iconDatabase()->isOpen())
-        return WebCore::iconDatabase()->databasePath();
+    if (WebCore::iconDatabase().isEnabled() && WebCore::iconDatabase().isOpen())
+        return WebCore::iconDatabase().databasePath();
     else
         return QString();
 }
@@ -677,8 +677,8 @@ QString QWebSettings::iconDatabasePath()
 */
 void QWebSettings::clearIconDatabase()
 {
-    if (WebCore::iconDatabase()->isEnabled() && WebCore::iconDatabase()->isOpen())
-        WebCore::iconDatabase()->removeAllIcons();
+    if (WebCore::iconDatabase().isEnabled() && WebCore::iconDatabase().isOpen())
+        WebCore::iconDatabase().removeAllIcons();
 }
 
 /*!
@@ -693,7 +693,7 @@ void QWebSettings::clearIconDatabase()
 */
 QIcon QWebSettings::iconForUrl(const QUrl& url)
 {
-    WebCore::Image* image = WebCore::iconDatabase()->iconForPageURL(WebCore::KURL(url).string(),
+    WebCore::Image* image = WebCore::iconDatabase().iconForPageURL(WebCore::KURL(url).string(),
                                 WebCore::IntSize(16, 16));
     if (!image)
         return QPixmap();
index 7bb073de73e6565c4071562d901caa8e1c4b77e2..393bd80f48d671af7d11e955a75926f1645eb184 100644 (file)
@@ -1,3 +1,16 @@
+2011-03-03  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=55721
+        Global IconDatabase should be returned by reference, not as a pointer
+
+        * Api/qwebsettings.cpp:
+        (QWebSettings::setIconDatabasePath):
+        (QWebSettings::iconDatabasePath):
+        (QWebSettings::clearIconDatabase):
+        (QWebSettings::iconForUrl):
+
 2011-03-03  Alexey Proskuryakov  <ap@apple.com>
 
         Removing an include of WebCoreKeyboardUIMode.h that Ive just added. It's already included
index 82e2cd6adbc6d2ac81e97a412c717081c48636be..335929e03eb259fb19cd6cc6ddb9d0d702c95ce0 100644 (file)
@@ -1,3 +1,30 @@
+2011-03-03  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=55721
+        Global IconDatabase should be returned by reference, not as a pointer
+
+        * WebCoreStatistics.cpp:
+        (WebCoreStatistics::iconPageURLMappingCount):
+        (WebCoreStatistics::iconRetainedPageURLCount):
+        (WebCoreStatistics::iconRecordCount):
+        (WebCoreStatistics::iconsWithDataCount):
+        * WebIconDatabase.cpp:
+        (WebIconDatabase::init):
+        (WebIconDatabase::startUpIconDatabase):
+        (WebIconDatabase::iconForURL):
+        (WebIconDatabase::retainIconForURL):
+        (WebIconDatabase::releaseIconForURL):
+        (WebIconDatabase::removeAllIcons):
+        (WebIconDatabase::iconURLForURL):
+        (WebIconDatabase::isEnabled):
+        (WebIconDatabase::setEnabled):
+        (WebIconDatabase::hasIconForURL):
+        (WebIconDatabase::getOrCreateDefaultIconBitmap):
+        * WebKitDLL.cpp:
+        (shutDownWebKit):
+
 2011-03-03  Alexey Proskuryakov  <ap@apple.com>
 
         Removing an include of WebCoreKeyboardUIMode.h that Ive just added. It's already included
index f5c399f869231318ab522aaa66dc49204288ce51..7a9b12659d6d05ba6bac4ba721836670ba77a7ab 100644 (file)
@@ -156,7 +156,7 @@ HRESULT STDMETHODCALLTYPE WebCoreStatistics::iconPageURLMappingCount(
 {
     if (!count)
         return E_POINTER;
-    *count = (UINT) iconDatabase()->pageURLMappingCount();
+    *count = (UINT) iconDatabase().pageURLMappingCount();
     return S_OK;
 }
 
@@ -165,7 +165,7 @@ HRESULT STDMETHODCALLTYPE WebCoreStatistics::iconRetainedPageURLCount(
 {
     if (!count)
         return E_POINTER;
-    *count = (UINT) iconDatabase()->retainedPageURLCount();
+    *count = (UINT) iconDatabase().retainedPageURLCount();
     return S_OK;
 }
 
@@ -174,7 +174,7 @@ HRESULT STDMETHODCALLTYPE WebCoreStatistics::iconRecordCount(
 {
     if (!count)
         return E_POINTER;
-    *count = (UINT) iconDatabase()->iconRecordCount();
+    *count = (UINT) iconDatabase().iconRecordCount();
     return S_OK;
 }
 
@@ -183,7 +183,7 @@ HRESULT STDMETHODCALLTYPE WebCoreStatistics::iconsWithDataCount(
 {
     if (!count)
         return E_POINTER;
-    *count = (UINT) iconDatabase()->iconRecordCountWithData();
+    *count = (UINT) iconDatabase().iconRecordCountWithData();
     return S_OK;
 }
 
index c81cc82df0ee89db2e00e8244091f7fffd084b25..5ccf0b7968aafac918bb07ada0ce31ca7e997144 100644 (file)
@@ -71,7 +71,7 @@ void WebIconDatabase::init()
         enabled = FALSE;
         LOG_ERROR("Unable to get icon database enabled preference");
     }
-    iconDatabase()->setEnabled(!!enabled);
+    iconDatabase().setEnabled(!!enabled);
     if (!(!!enabled))
         return;
 
@@ -82,7 +82,7 @@ void WebIconDatabase::startUpIconDatabase()
 {
     WebPreferences* standardPrefs = WebPreferences::sharedStandardPreferences();
 
-    iconDatabase()->setClient(this);
+    iconDatabase().setClient(this);
 
     BSTR prefDatabasePath = 0;
     if (FAILED(standardPrefs->iconDatabaseLocation(&prefDatabasePath)))
@@ -97,7 +97,7 @@ void WebIconDatabase::startUpIconDatabase()
             LOG_ERROR("Failed to construct default icon database path");
     }
 
-    if (!iconDatabase()->open(databasePath))
+    if (!iconDatabase().open(databasePath))
             LOG_ERROR("Failed to open icon database path");
 }
 
@@ -172,7 +172,7 @@ HRESULT STDMETHODCALLTYPE WebIconDatabase::iconForURL(
 
     Image* icon = 0;
     if (url)
-        icon = iconDatabase()->iconForPageURL(String(url, SysStringLen(url)), intSize);
+        icon = iconDatabase().iconForPageURL(String(url, SysStringLen(url)), intSize);
 
     // Make sure we check for the case of an "empty image"
     if (icon && icon->width()) {
@@ -199,20 +199,20 @@ HRESULT STDMETHODCALLTYPE WebIconDatabase::defaultIconWithSize(
 HRESULT STDMETHODCALLTYPE WebIconDatabase::retainIconForURL(
         /* [in] */ BSTR url)
 {
-    iconDatabase()->retainIconForPageURL(String(url, SysStringLen(url)));
+    iconDatabase().retainIconForPageURL(String(url, SysStringLen(url)));
     return S_OK;
 }
 
 HRESULT STDMETHODCALLTYPE WebIconDatabase::releaseIconForURL(
         /* [in] */ BSTR url)
 {
-    iconDatabase()->releaseIconForPageURL(String(url, SysStringLen(url)));
+    iconDatabase().releaseIconForPageURL(String(url, SysStringLen(url)));
     return S_OK;
 }
 
 HRESULT STDMETHODCALLTYPE WebIconDatabase::removeAllIcons(void)
 {
-    iconDatabase()->removeAllIcons();
+    iconDatabase().removeAllIcons();
     return S_OK;
 }
 
@@ -234,7 +234,7 @@ HRESULT STDMETHODCALLTYPE WebIconDatabase::iconURLForURL(
 {
     if (!url || !iconURL)
         return E_POINTER;
-    BString iconURLBSTR(iconDatabase()->iconURLForPageURL(String(url, SysStringLen(url))));
+    BString iconURLBSTR(iconDatabase().iconURLForPageURL(String(url, SysStringLen(url))));
     *iconURL = iconURLBSTR.release();
     return S_OK;
 }
@@ -242,7 +242,7 @@ HRESULT STDMETHODCALLTYPE WebIconDatabase::iconURLForURL(
 HRESULT STDMETHODCALLTYPE WebIconDatabase::isEnabled( 
         /* [retval][out] */ BOOL *result)
 {
-    *result = iconDatabase()->isEnabled();
+    *result = iconDatabase().isEnabled();
     return S_OK;
 }
 
@@ -252,10 +252,10 @@ HRESULT STDMETHODCALLTYPE WebIconDatabase::setEnabled(
     BOOL currentlyEnabled;
     isEnabled(&currentlyEnabled);
     if (currentlyEnabled && !flag) {
-        iconDatabase()->setEnabled(false);
+        iconDatabase().setEnabled(false);
         shutDownIconDatabase();
     } else if (!currentlyEnabled && flag) {
-        iconDatabase()->setEnabled(true);
+        iconDatabase().setEnabled(true);
         startUpIconDatabase();
     }
     return S_OK;
@@ -272,11 +272,11 @@ HRESULT STDMETHODCALLTYPE WebIconDatabase::hasIconForURL(
 
     // Passing a size parameter of 0, 0 means we don't care about the result of the image, we just
     // want to make sure the read from disk to load the icon is kicked off.
-    iconDatabase()->iconForPageURL(urlString, IntSize(0, 0));
+    iconDatabase().iconForPageURL(urlString, IntSize(0, 0));
 
     // Check to see if we have a non-empty icon URL for the page, and if we do, we have an icon for
     // the page.
-    *result = !(iconDatabase()->iconURLForPageURL(urlString).isEmpty());
+    *result = !(iconDatabase().iconURLForPageURL(urlString).isEmpty());
 
     return S_OK;
 }
@@ -311,7 +311,7 @@ HBITMAP WebIconDatabase::getOrCreateDefaultIconBitmap(LPSIZE size)
     result = createDIB(size);
 
     m_defaultIconMap.set(*size, result);
-    if (!iconDatabase()->defaultIcon(*size)->getHBITMAPOfSize(result, size)) {
+    if (!iconDatabase().defaultIcon(*size)->getHBITMAPOfSize(result, size)) {
         LOG_ERROR("Failed to draw Image to HBITMAP");
         return 0;
     }
index bc7aa608cab8486c3869e77295b733af4ee2f56f..d6a5120d7487162796e013fa4801311b9d526fca 100644 (file)
@@ -133,7 +133,7 @@ STDAPI LocalServerDidDie()
 
 void shutDownWebKit()
 {
-    WebCore::iconDatabase()->close();
+    WebCore::iconDatabase().close();
     WebCore::PageGroup::closeLocalStorage();
 }