https://bugs.webkit.org/show_bug.cgi?id=56320
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Mar 2011 21:25:51 +0000 (21:25 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Mar 2011 21:25:51 +0000 (21:25 +0000)
Remove HistoryItem::icon() and the WebCore dependency on "IconDatabaseBase::defaultIcon()"

Reviewed by Anders Carlsson.

../WebCore:

Remove HistoryItem::icon():
* history/HistoryItem.cpp:
* history/HistoryItem.h:
* WebCore.exp.in:

* loader/icon/IconDatabaseBase.h:
(WebCore::IconDatabaseBase::defaultIcon):

../WebKit/efl:

* ewk/ewk_history.cpp:
(ewk_history_item_icon_surface_get): Use IconDatabase directly.

../WebKit/mac:

* History/WebHistoryItem.mm:
(-[WebHistoryItem icon]): This far-future FIXME is now irrelevant.

../WebKit/qt:

* Api/qwebhistory.cpp:
(QWebHistoryItem::icon): Use IconDatabase directly.

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

Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/history/HistoryItem.cpp
Source/WebCore/history/HistoryItem.h
Source/WebCore/loader/icon/IconDatabaseBase.h
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/ewk/ewk_history.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/History/WebHistoryItem.mm
Source/WebKit/qt/Api/qwebhistory.cpp
Source/WebKit/qt/ChangeLog

index 6347198..dbdeb14 100644 (file)
@@ -1,3 +1,18 @@
+2011-03-14  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=56320
+        Remove HistoryItem::icon() and the WebCore dependency on "IconDatabaseBase::defaultIcon()"
+
+        Remove HistoryItem::icon():
+        * history/HistoryItem.cpp:
+        * history/HistoryItem.h:
+        * WebCore.exp.in:
+
+        * loader/icon/IconDatabaseBase.h:
+        (WebCore::IconDatabaseBase::defaultIcon):
+
 2011-03-14  Andy Estes  <aestes@apple.com>
 
         Reviewed by Darin Adler.
index b3fedc1..238ddef 100644 (file)
@@ -1032,7 +1032,6 @@ __ZNK7WebCore11HistoryItem20getTransientPropertyERKN3WTF6StringE
 __ZNK7WebCore11HistoryItem21encodeBackForwardTreeERN3WTF7EncoderE
 __ZNK7WebCore11HistoryItem3urlEv
 __ZNK7WebCore11HistoryItem4copyEv
-__ZNK7WebCore11HistoryItem4iconEv
 __ZNK7WebCore11HistoryItem5titleEv
 __ZNK7WebCore11HistoryItem6targetEv
 __ZNK7WebCore11HistoryItem8childrenEv
index 54b1ebc..363e1aa 100644 (file)
@@ -231,12 +231,6 @@ const String& HistoryItem::alternateTitle() const
     return m_displayTitle;
 }
 
-Image* HistoryItem::icon() const
-{
-    Image* result = iconDatabase().iconForPageURL(m_urlString, IntSize(16, 16));
-    return result ? result : iconDatabase().defaultIcon(IntSize(16, 16));
-}
-
 double HistoryItem::lastVisitedTime() const
 {
     return m_lastVisitedTime;
index 235f756..b9c9983 100644 (file)
@@ -105,8 +105,6 @@ public:
     void setAlternateTitle(const String& alternateTitle);
     const String& alternateTitle() const;
     
-    Image* icon() const;
-    
     const String& parent() const;
     KURL url() const;
     KURL originalURL() const;
index 38bbf62..963e075 100644 (file)
@@ -58,7 +58,6 @@ public:
     virtual bool isEnabled() const { return false; }
     
     virtual Image* iconForPageURL(const String&, const IntSize&) { return 0; }
-    virtual Image* defaultIcon(const IntSize&) { return 0; }
     
     virtual void retainIconForPageURL(const String&) { }
     virtual void releaseIconForPageURL(const String&) { }
@@ -72,9 +71,10 @@ public:
 
     // Used within one or more WebKit ports.
     // We should try to remove these dependencies from the IconDatabaseBase class.
-
     virtual void setEnabled(bool) { }
 
+    virtual Image* defaultIcon(const IntSize&) { return 0; }
+
     virtual size_t pageURLMappingCount() { return 0; }
     virtual size_t retainedPageURLCount() { return 0; }
     virtual size_t iconRecordCount() { return 0; }
index 0b34220..43daa3f 100644 (file)
@@ -1,3 +1,13 @@
+2011-03-14  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=56320
+        Remove HistoryItem::icon() and the WebCore dependency on "IconDatabaseBase::defaultIcon()"
+
+        * ewk/ewk_history.cpp:
+        (ewk_history_item_icon_surface_get): Use IconDatabase directly.
+
 2011-03-14  Ryuan Choi  <ryuan.choi@samsung.com>
 
         Reviewed by Kenneth Rohde Christiansen.
index 0a9d349..7d9a78d 100644 (file)
@@ -24,6 +24,7 @@
 #include "BackForwardListImpl.h"
 #include "EWebKit.h"
 #include "HistoryItem.h"
+#include "IconDatabaseBase.h"
 #include "Image.h"
 #include "ewk_private.h"
 #include <wtf/text/CString.h>
@@ -578,7 +579,8 @@ double ewk_history_item_time_last_visited_get(const Ewk_History_Item* item)
 cairo_surface_t* ewk_history_item_icon_surface_get(const Ewk_History_Item* item)
 {
     EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0);
-    WebCore::Image* icon = core->icon();
+    
+    WebCore::Image* icon = iconDatabase().iconForPageURL(core->url(), IntSize(16, 16));
     if (!icon) {
         ERR("icon is NULL.");
         return 0;
index eef16b8..fa11757 100644 (file)
@@ -1,3 +1,13 @@
+2011-03-14  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=56320
+        Remove HistoryItem::icon() and the WebCore dependency on "IconDatabaseBase::defaultIcon()"
+
+        * History/WebHistoryItem.mm:
+        (-[WebHistoryItem icon]): This far-future FIXME is now irrelevant.
+
 2011-03-13  Pratik Solanki  <psolanki@apple.com>
 
         Reviewed by Brady Eidson.
index de56180..530b18a 100644 (file)
@@ -185,12 +185,6 @@ void WKNotifyHistoryItemChanged(HistoryItem*)
 - (NSImage *)icon
 {
     return [[WebIconDatabase sharedIconDatabase] iconForURL:[self URLString] withSize:WebIconSmallSize];
-    
-    // FIXME: Ideally, this code should simply be the following -
-    // return core(_private)->icon()->getNSImage();
-    // Once radar -
-    // <rdar://problem/4906567> - NSImage returned from WebCore::Image may be incorrect size
-    // is resolved
 }
 
 - (NSTimeInterval)lastVisitedTimeInterval
index a9761de..4abb458 100644 (file)
 #include "qwebframe_p.h"
 
 #include "BackForwardListImpl.h"
-#include "PlatformString.h"
+#include "IconDatabaseBase.h"
 #include "Image.h"
+#include "IntSize.h"
 #include "KURL.h"
 #include "Page.h"
 #include "PageGroup.h"
+#include "PlatformString.h"
 
 #include <QSharedData>
 #include <QDebug>
@@ -156,7 +158,8 @@ QDateTime QWebHistoryItem::lastVisited() const
 QIcon QWebHistoryItem::icon() const
 {
     if (d->item)
-        return *d->item->icon()->nativeImageForCurrentFrame();
+        return *WebCore::iconDatabase().iconForPageURL(d->item->url(), WebCore::IntSize(16, 16))->nativeImageForCurrentFrame();
+
     return QIcon();
 }
 
index 2aaef56..d476b14 100644 (file)
@@ -1,3 +1,13 @@
+2011-03-14  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=56320
+        Remove HistoryItem::icon() and the WebCore dependency on "IconDatabaseBase::defaultIcon()"
+
+        * Api/qwebhistory.cpp:
+        (QWebHistoryItem::icon): Use IconDatabase directly.
+
 2011-03-11  Brady Eidson  <beidson@apple.com>
 
         Reviewed by attempt at build fix!