Title: [219684] trunk
Revision
219684
Author
beid...@apple.com
Date
2017-07-20 07:30:10 -0700 (Thu, 20 Jul 2017)

Log Message

Remove WebIconDatabase from WebKitLegacy/win.
https://bugs.webkit.org/show_bug.cgi?id=174608

Reviewed by Alex Christensen.

Source/WebKitLegacy/win:

It is unused.

* ForEachCoClass.h:

* Interfaces/IWebIconDatabase.idl: Removed.

* Interfaces/WebKit.idl:

* WebCoreStatistics.cpp:
(WebCoreStatistics::iconPageURLMappingCount):
(WebCoreStatistics::iconRetainedPageURLCount):
(WebCoreStatistics::iconRecordCount):
(WebCoreStatistics::iconsWithDataCount):

* WebIconDatabase.cpp: Removed.
* WebIconDatabase.h: Removed.
* WebKitClassFactory.cpp:

* WebKitDLL.cpp:
(shutDownWebKit):

* WebKitLogging.h:

* WebView.cpp:
(WebView::close):
(WebView::notifyDidAddIcon):
(WebView::registerForIconNotification):
(WebView::dispatchDidReceiveIconFromWebFrame):
(WebView::onNotify):

Tools:

* DumpRenderTree/win/DumpRenderTree.cpp:
(main):
* DumpRenderTree/win/TestRunnerWin.cpp:
(TestRunner::setIconDatabaseEnabled):

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebKitLegacy/PlatformWin.cmake (219683 => 219684)


--- trunk/Source/WebKitLegacy/PlatformWin.cmake	2017-07-20 14:28:18 UTC (rev 219683)
+++ trunk/Source/WebKitLegacy/PlatformWin.cmake	2017-07-20 14:30:10 UTC (rev 219684)
@@ -101,7 +101,6 @@
     win/WebHTMLRepresentation.h
     win/WebHistory.h
     win/WebHistoryItem.h
-    win/WebIconDatabase.h
     win/WebJavaScriptCollector.h
     win/WebKitCOMAPI.h
     win/WebKitClassFactory.h
@@ -173,7 +172,6 @@
     win/WebHTMLRepresentation.cpp
     win/WebHistory.cpp
     win/WebHistoryItem.cpp
-    win/WebIconDatabase.cpp
     win/WebInspector.cpp
     win/WebJavaScriptCollector.cpp
     win/WebKitCOMAPI.cpp
@@ -337,7 +335,6 @@
     win/Interfaces/IWebHistoryItem.idl
     win/Interfaces/IWebHistoryItemPrivate.idl
     win/Interfaces/IWebHistoryPrivate.idl
-    win/Interfaces/IWebIconDatabase.idl
     win/Interfaces/IWebInspector.idl
     win/Interfaces/IWebInspectorPrivate.idl
     win/Interfaces/IWebJavaScriptCollector.idl

Modified: trunk/Source/WebKitLegacy/win/ChangeLog (219683 => 219684)


--- trunk/Source/WebKitLegacy/win/ChangeLog	2017-07-20 14:28:18 UTC (rev 219683)
+++ trunk/Source/WebKitLegacy/win/ChangeLog	2017-07-20 14:30:10 UTC (rev 219684)
@@ -1,3 +1,40 @@
+2017-07-20  Brady Eidson  <beid...@apple.com>
+
+        Remove WebIconDatabase from WebKitLegacy/win.
+        https://bugs.webkit.org/show_bug.cgi?id=174608
+
+        Reviewed by Alex Christensen.
+
+        It is unused.
+        
+        * ForEachCoClass.h:
+
+        * Interfaces/IWebIconDatabase.idl: Removed.
+
+        * Interfaces/WebKit.idl:
+
+        * WebCoreStatistics.cpp:
+        (WebCoreStatistics::iconPageURLMappingCount):
+        (WebCoreStatistics::iconRetainedPageURLCount):
+        (WebCoreStatistics::iconRecordCount):
+        (WebCoreStatistics::iconsWithDataCount):
+
+        * WebIconDatabase.cpp: Removed.
+        * WebIconDatabase.h: Removed.
+        * WebKitClassFactory.cpp:
+
+        * WebKitDLL.cpp:
+        (shutDownWebKit):
+
+        * WebKitLogging.h:
+
+        * WebView.cpp:
+        (WebView::close):
+        (WebView::notifyDidAddIcon):
+        (WebView::registerForIconNotification):
+        (WebView::dispatchDidReceiveIconFromWebFrame):
+        (WebView::onNotify):
+
 2017-07-18  Matt Lewis  <jlew...@apple.com>
 
         Unreviewed, rolling out r219610.

Modified: trunk/Source/WebKitLegacy/win/ForEachCoClass.h (219683 => 219684)


--- trunk/Source/WebKitLegacy/win/ForEachCoClass.h	2017-07-20 14:28:18 UTC (rev 219683)
+++ trunk/Source/WebKitLegacy/win/ForEachCoClass.h	2017-07-20 14:30:10 UTC (rev 219684)
@@ -42,7 +42,6 @@
     macro(WebError) \
     macro(WebHistory) \
     macro(WebHistoryItem) \
-    macro(WebIconDatabase) \
     macro(WebJavaScriptCollector) \
     macro(WebKitStatistics) \
     macro(WebMutableURLRequest) \

Deleted: trunk/Source/WebKitLegacy/win/Interfaces/IWebIconDatabase.idl (219683 => 219684)


--- trunk/Source/WebKitLegacy/win/Interfaces/IWebIconDatabase.idl	2017-07-20 14:28:18 UTC (rev 219683)
+++ trunk/Source/WebKitLegacy/win/Interfaces/IWebIconDatabase.idl	2017-07-20 14:30:10 UTC (rev 219684)
@@ -1,174 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-cpp_quote("#define WebIconDatabaseDidAddIconNotification TEXT(\"WebIconDatabaseDidAddIconNotification\")")
-cpp_quote("#define WebIconNotificationUserInfoURLKey TEXT(\"WebIconNotificationUserInfoURLKey\")")
-cpp_quote("#define WebIconDatabaseDidRemoveAllIconsNotification TEXT(\"WebIconDatabaseDidRemoveAllIconsNotification\")")
-
-#ifndef DO_NO_IMPORTS
-import "oaidl.idl";
-import "ocidl.idl";
-#endif
-
-/*!
-    @class WebIconDatabase
-    @discussion Features:
-        - memory cache icons at different sizes
-        - disk storage
-        - icon update notification
-        
-        Uses:
-        - WebIconLoader to cache icon images
-        - UI elements to retrieve icons that represent site URLs.
-        - Save icons to disk for later use.
- 
-    Every icon in the database has a retain count.  If an icon has a retain count greater than 0, it will be written to disk for later use. If an icon's retain count equals zero it will be removed from disk.  The retain count is not persistent across launches. If the WebKit client wishes to retain an icon it should retain the icon once for every launch.  This is best done at initialization time before the database begins removing icons.  To make sure that the database does not remove unretained icons prematurely, call delayDatabaseCleanup until all desired icons are retained.  Once all are retained, call allowDatabaseCleanup.
-    
-    Note that an icon can be retained after the database clean-up has begun. This just has to be done before the icon is removed. Icons are removed from the database whenever new icons are added to it.
-    
-    Retention methods can be called for icons that are not yet in the database.
-
-    @interface WebIconDatabase : NSObject
-*/
-[
-    object,
-    oleautomation,
-    hidden,
-    uuid(E93F2616-2560-47d9-BD4D-6E2F1E1D3174),
-    pointer_default(unique)
-]
-interface IWebIconDatabase : IUnknown
-{
-    /*!
-        @method sharedIconDatabase
-        @abstract Returns a shared instance of the icon database
-        + (WebIconDatabase *)sharedIconDatabase;
-    */
-    HRESULT sharedIconDatabase([out, retval] IWebIconDatabase** result);
-
-    /*!
-        @method iconForURL:withSize:
-        @discussion Calls iconForURL:withSize:cache: with YES for cache.
-        @param URL
-        @param size
-        - (NSImage *)iconForURL:(NSString *)URL withSize:(NSSize)size;
-    */
-    /*!
-        @method iconForURL:withSize:cache:
-        @discussion Returns an icon for a web site URL from memory or disk. nil if none is found.
-        Usually called by a UI element to determine if a site URL has an associated icon.
-        Often called by the observer of WebIconChangedNotification after the notification is sent.
-        @param URL
-        @param size
-        @param cache If yes, caches the returned image in memory if not already cached
-        - (NSImage *)iconForURL:(NSString *)URL withSize:(NSSize)size cache:(BOOL)cache;
-    */
-    /*!
-        @method iconURLForURL:withSize:cache:
-        @discussion Returns an icon URL for a web site URL from memory or disk. nil if none is found.
-        @param URL
-        - (NSString *)iconURLForURL:(NSString *)URL;
-    */
-    HRESULT iconForURL([in] BSTR url, [in] LPSIZE size, [in] BOOL cache, [out, retval] HBITMAP* hBitmap);
-
-    /*!
-        @method defaultIconWithSize:
-        @param size
-        - (NSImage *)defaultIconWithSize:(NSSize)size;
-    */
-    HRESULT defaultIconWithSize([in] LPSIZE size, [out, retval] HBITMAP* hBitmap);
-
-    /*!
-        @method retainIconForURL:
-        @abstract Increments the retain count of the icon.
-        @param URL
-        - (void)retainIconForURL:(NSString *)URL;
-    */
-    HRESULT retainIconForURL([in] BSTR url);
-
-    /*!
-        @method releaseIconForURL:
-        @abstract Decrements the retain count of the icon.
-        @param URL
-        - (void)releaseIconForURL:(NSString *)URL;
-    */
-    HRESULT releaseIconForURL([in] BSTR url);
-
-    /*!
-        @method removeAllIcons:
-        @abstract Emtpies the Icon Database
-        - (void)removeAllIcons;
-    */
-    HRESULT removeAllIcons();
-
-    /*!
-        @method delayDatabaseCleanup:
-        @discussion Only effective if called before the database begins removing icons.
-        delayDatabaseCleanUp increments an internal counter that when 0 begins the database clean-up.
-        The counter equals 0 at initialization.
-        - (void)delayDatabaseCleanup;
-    */
-    HRESULT delayDatabaseCleanup();
-
-    /*!
-        @method allowDatabaseCleanup:
-        @discussion Informs the database that it now can begin removing icons.
-        allowDatabaseCleanup decrements an internal counter that when 0 begins the database clean-up.
-        The counter equals 0 at initialization.
-        - (void)allowDatabaseCleanup;
-    */
-    HRESULT allowDatabaseCleanup();
-
-    /*!
-        @method iconURLForURL:withSize:cache:
-        @discussion Returns an icon URL for a web site URL from memory or disk. nil if none is found.
-        @param URL
-        - (NSString *)iconURLForURL:(NSString *)URL;
-    */
-    HRESULT iconURLForURL([in] BSTR url, [out, retval] BSTR* iconURL);
-
-    /*!
-        @method isEnabled
-        @discussion Returns true if the icon database is currently enabled, or false if it
-        is disabled.
-        - (BOOL)isEnabled;
-    */
-    HRESULT isEnabled([out, retval] BOOL* result);
-
-    /*!
-        @method setEnabled:
-        @discussion Enables or disables the icon database based on the flag passed in.
-        @param flag Pass true to enable the icon database, or false to disable it.
-        - (void)setEnabled:(BOOL)flag;
-    */
-    HRESULT setEnabled([in] BOOL flag);
-    
-    /*!
-        @method hasIconForURL:
-        @discussion Returns whether or not the icon database has an icon for this URL.
-        @parm url The URL to test for.
-    */
-    HRESULT hasIconForURL([in] BSTR url, [out, retval] BOOL* result);
-}

Modified: trunk/Source/WebKitLegacy/win/Interfaces/WebKit.idl (219683 => 219684)


--- trunk/Source/WebKitLegacy/win/Interfaces/WebKit.idl	2017-07-20 14:28:18 UTC (rev 219683)
+++ trunk/Source/WebKitLegacy/win/Interfaces/WebKit.idl	2017-07-20 14:30:10 UTC (rev 219684)
@@ -111,7 +111,6 @@
 #include "IWebHistoryItem.idl"
 #include "IWebHistoryItemPrivate.idl"
 #include "IWebHistoryPrivate.idl"
-#include "IWebIconDatabase.idl"
 #include "IWebInspector.idl"
 #include "IWebInspectorPrivate.idl"
 #include "IWebJavaScriptCollector.idl"
@@ -176,11 +175,6 @@
         interface IWebViewPrivate2;
     }
 
-    [uuid(66827ec1-3aef-4241-bac5-f776b44f030f)]
-    coclass WebIconDatabase {
-        [default] interface IWebIconDatabase;
-    }
-
     [uuid(a062ecc3-bb1b-4694-a569-f59e0ad6be0c)]
     coclass WebMutableURLRequest {
         [default] interface IWebMutableURLRequest;

Modified: trunk/Source/WebKitLegacy/win/WebCoreStatistics.cpp (219683 => 219684)


--- trunk/Source/WebKitLegacy/win/WebCoreStatistics.cpp	2017-07-20 14:28:18 UTC (rev 219683)
+++ trunk/Source/WebKitLegacy/win/WebCoreStatistics.cpp	2017-07-20 14:30:10 UTC (rev 219684)
@@ -34,7 +34,6 @@
 #include <WebCore/FontCache.h>
 #include <WebCore/GCController.h>
 #include <WebCore/GlyphPage.h>
-#include <WebCore/IconDatabase.h>
 #include <WebCore/JSDOMWindow.h>
 #include <WebCore/PageCache.h>
 #include <WebCore/PageConsoleClient.h>
@@ -179,7 +178,7 @@
 {
     if (!count)
         return E_POINTER;
-    *count = (UINT) iconDatabase().pageURLMappingCount();
+    *count = (UINT)0;
     return S_OK;
 }
 
@@ -187,7 +186,7 @@
 {
     if (!count)
         return E_POINTER;
-    *count = (UINT) iconDatabase().retainedPageURLCount();
+    *count = (UINT)0;
     return S_OK;
 }
 
@@ -195,7 +194,7 @@
 {
     if (!count)
         return E_POINTER;
-    *count = (UINT) iconDatabase().iconRecordCount();
+    *count = (UINT)0;
     return S_OK;
 }
 
@@ -203,7 +202,7 @@
 {
     if (!count)
         return E_POINTER;
-    *count = (UINT) iconDatabase().iconRecordCountWithData();
+    *count = (UINT)0;
     return S_OK;
 }
 

Deleted: trunk/Source/WebKitLegacy/win/WebIconDatabase.cpp (219683 => 219684)


--- trunk/Source/WebKitLegacy/win/WebIconDatabase.cpp	2017-07-20 14:28:18 UTC (rev 219683)
+++ trunk/Source/WebKitLegacy/win/WebIconDatabase.cpp	2017-07-20 14:30:10 UTC (rev 219684)
@@ -1,414 +0,0 @@
-/*
- * Copyright (C) 2006-2009, 2013-2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "WebKitDLL.h"
-#include "WebIconDatabase.h"
-
-#include "COMPropertyBag.h"
-#include "WebNotificationCenter.h"
-#include "WebPreferences.h"
-#include "shlobj.h"
-#include <WebCore/BString.h>
-#include <WebCore/BitmapInfo.h>
-#include <WebCore/COMPtr.h>
-#include <WebCore/FileSystem.h>
-#include <WebCore/HWndDC.h>
-#include <WebCore/IconDatabase.h>
-#include <WebCore/Image.h>
-#include <WebCore/SharedBuffer.h>
-#include <wtf/MainThread.h>
-#include <wtf/text/WTFString.h>
-
-using namespace WebCore;
-using namespace WTF;
-
-// WebIconDatabase ----------------------------------------------------------------
-
-WebIconDatabase* WebIconDatabase::m_sharedWebIconDatabase = 0;
-
-WebIconDatabase::WebIconDatabase()
-{
-    gClassCount++;
-    gClassNameCount().add("WebIconDatabase");
-}
-
-WebIconDatabase::~WebIconDatabase()
-{
-    gClassCount--;
-    gClassNameCount().remove("WebIconDatabase");
-}
-
-void WebIconDatabase::init()
-{
-    WebPreferences* standardPrefs = WebPreferences::sharedStandardPreferences();
-    BOOL enabled = FALSE;
-    if (FAILED(standardPrefs->iconDatabaseEnabled(&enabled))) {
-        enabled = FALSE;
-        LOG_ERROR("Unable to get icon database enabled preference");
-    }
-    iconDatabase().setEnabled(!!enabled);
-    if (!(!!enabled))
-        return;
-
-    startUpIconDatabase();
-}
-
-void WebIconDatabase::startUpIconDatabase()
-{
-    WebPreferences* standardPrefs = WebPreferences::sharedStandardPreferences();
-
-    iconDatabase().setClient(this);
-
-    BString prefDatabasePath;
-    if (FAILED(standardPrefs->iconDatabaseLocation(&prefDatabasePath)))
-        LOG_ERROR("Unable to get icon database location preference");
-
-    String databasePath(prefDatabasePath, SysStringLen(prefDatabasePath));
-
-    if (databasePath.isEmpty()) {
-        databasePath = localUserSpecificStorageDirectory();
-        if (databasePath.isEmpty())
-            LOG_ERROR("Failed to construct default icon database path");
-    }
-
-    if (!iconDatabase().open(databasePath, WebCore::IconDatabase::defaultDatabaseFilename()))
-            LOG_ERROR("Failed to open icon database path");
-}
-
-void WebIconDatabase::shutDownIconDatabase()
-{
-}
-
-WebIconDatabase* WebIconDatabase::createInstance()
-{
-    WebIconDatabase* instance = new WebIconDatabase();
-    instance->AddRef();
-    return instance;
-}
-
-WebIconDatabase* WebIconDatabase::sharedWebIconDatabase()
-{
-    if (m_sharedWebIconDatabase) {
-        m_sharedWebIconDatabase->AddRef();
-        return m_sharedWebIconDatabase;
-    }
-    m_sharedWebIconDatabase = createInstance();
-    m_sharedWebIconDatabase->init();
-    return m_sharedWebIconDatabase;
-}
-
-// IUnknown -------------------------------------------------------------------
-
-HRESULT WebIconDatabase::QueryInterface(_In_ REFIID riid, _COM_Outptr_ void** ppvObject)
-{
-    if (!ppvObject)
-        return E_POINTER;
-    *ppvObject = nullptr;
-    if (IsEqualGUID(riid, IID_IUnknown))
-        *ppvObject = static_cast<IWebIconDatabase*>(this);
-    else if (IsEqualGUID(riid, IID_IWebIconDatabase))
-        *ppvObject = static_cast<IWebIconDatabase*>(this);
-    else
-        return E_NOINTERFACE;
-
-    AddRef();
-    return S_OK;
-}
-
-ULONG WebIconDatabase::AddRef()
-{
-    return ++m_refCount;
-}
-
-ULONG WebIconDatabase::Release()
-{
-    ULONG newRef = --m_refCount;
-    if (!newRef)
-        delete(this);
-
-    return newRef;
-}
-
-// IWebIconDatabase --------------------------------------------------------------------
-
-HRESULT WebIconDatabase::sharedIconDatabase(_COM_Outptr_opt_ IWebIconDatabase** result)
-{
-    if (!result)
-        return E_POINTER;
-    *result = sharedWebIconDatabase();
-    return S_OK;
-}
-
-HRESULT WebIconDatabase::iconForURL(_In_ BSTR url, _In_ LPSIZE size, BOOL /*cache*/, __deref_opt_out HBITMAP* bitmap)
-{
-    if (!size || !bitmap)
-        return E_POINTER;
-
-    IntSize intSize(*size);
-
-    Image* icon = nullptr;
-    if (url)
-        icon = iconDatabase().synchronousIconForPageURL(String(url, SysStringLen(url)), intSize);
-
-    // Make sure we check for the case of an "empty image"
-    if (icon && icon->width()) {
-        *bitmap = getOrCreateSharedBitmap(intSize);
-        if (!icon->getHBITMAPOfSize(*bitmap, &intSize)) {
-            LOG_ERROR("Failed to draw Image to HBITMAP");
-            *bitmap = 0;
-            return E_FAIL;
-        }
-        return S_OK;
-    }
-
-    return defaultIconWithSize(size, bitmap);
-}
-
-HRESULT WebIconDatabase::defaultIconWithSize(_In_ LPSIZE size, __deref_opt_out HBITMAP* result)
-{
-    if (!size || !result)
-        return E_POINTER;
-
-    IntSize intSize(*size);
-
-    *result = getOrCreateDefaultIconBitmap(intSize);
-    return S_OK;
-}
-
-HRESULT WebIconDatabase::retainIconForURL(_In_ BSTR url)
-{
-    iconDatabase().retainIconForPageURL(String(url, SysStringLen(url)));
-    return S_OK;
-}
-
-HRESULT WebIconDatabase::releaseIconForURL(_In_ BSTR url)
-{
-    iconDatabase().releaseIconForPageURL(String(url, SysStringLen(url)));
-    return S_OK;
-}
-
-HRESULT WebIconDatabase::removeAllIcons()
-{
-    iconDatabase().removeAllIcons();
-    return S_OK;
-}
-
-HRESULT WebIconDatabase::delayDatabaseCleanup()
-{
-    IconDatabase::delayDatabaseCleanup();
-    return S_OK;
-}
-
-HRESULT WebIconDatabase::allowDatabaseCleanup()
-{
-    IconDatabase::allowDatabaseCleanup();
-    return S_OK;
-}
-
-HRESULT WebIconDatabase::iconURLForURL(_In_ BSTR url, __deref_opt_out BSTR* iconURL)
-{
-    if (!url || !iconURL)
-        return E_POINTER;
-    BString iconURLBSTR(iconDatabase().synchronousIconURLForPageURL(String(url, SysStringLen(url))));
-    *iconURL = iconURLBSTR.release();
-    return S_OK;
-}
-
-HRESULT WebIconDatabase::isEnabled(_Out_ BOOL* result)
-{
-    if (!result)
-        return E_POINTER;
-    *result = iconDatabase().isEnabled();
-    return S_OK;
-}
-
-HRESULT WebIconDatabase::setEnabled(BOOL flag)
-{
-    BOOL currentlyEnabled;
-    isEnabled(&currentlyEnabled);
-    if (currentlyEnabled && !flag) {
-        iconDatabase().setEnabled(false);
-        shutDownIconDatabase();
-    } else if (!currentlyEnabled && flag) {
-        iconDatabase().setEnabled(true);
-        startUpIconDatabase();
-    }
-    return S_OK;
-}
-
-HRESULT WebIconDatabase::hasIconForURL(_In_ BSTR url, _Out_ BOOL* result)
-{
-    if (!url || !result)
-        return E_POINTER;
-
-    String urlString(url, SysStringLen(url));
-
-    // 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().synchronousIconForPageURL(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().synchronousIconURLForPageURL(urlString).isEmpty());
-
-    return S_OK;
-}
-
-static HBITMAP createDIB(const IntSize& size)
-{
-    BitmapInfo bmInfo = BitmapInfo::create(size);
-
-    HWndDC dc(0);
-    return CreateDIBSection(dc, &bmInfo, DIB_RGB_COLORS, 0, 0, 0);
-}
-
-HBITMAP WebIconDatabase::getOrCreateSharedBitmap(const IntSize& size)
-{
-    HBITMAP result = m_sharedIconMap.get(size);
-    if (result)
-        return result;
-    result = createDIB(size);
-    m_sharedIconMap.set(size, result);
-    return result;
-}
-
-HBITMAP WebIconDatabase::getOrCreateDefaultIconBitmap(const IntSize& size)
-{
-    HBITMAP result = m_defaultIconMap.get(size);
-    if (result)
-        return result;
-
-    result = createDIB(size);
-
-    m_defaultIconMap.set(size, result);
-    if (!iconDatabase().defaultIcon(size) || !iconDatabase().defaultIcon(size)->getHBITMAPOfSize(result, &size)) {
-        LOG_ERROR("Failed to draw Image to HBITMAP");
-        return 0;
-    }
-    return result;
-}
-
-// IconDatabaseClient
-
-void WebIconDatabase::didRemoveAllIcons()
-{
-    // Queueing the empty string is a special way of saying "this queued notification is the didRemoveAllIcons notification"
-    LockHolder locker(m_notificationMutex);
-    m_notificationQueue.append(String());
-    scheduleNotificationDelivery();
-}
-
-void WebIconDatabase::didImportIconURLForPageURL(const WTF::String& pageURL)
-{
-    LockHolder locker(m_notificationMutex);
-    m_notificationQueue.append(pageURL.isolatedCopy());
-    scheduleNotificationDelivery();
-}
-
-void WebIconDatabase::didImportIconDataForPageURL(const WTF::String& pageURL)
-{
-    // WebKit1 only has a single "icon did change" notification.
-    didImportIconURLForPageURL(pageURL);
-}
-
-void WebIconDatabase::didChangeIconForPageURL(const WTF::String& pageURL)
-{
-    // WebKit1 only has a single "icon did change" notification.
-    didImportIconURLForPageURL(pageURL);
-}
-
-void WebIconDatabase::didFinishURLImport()
-{
-}
-
-void WebIconDatabase::scheduleNotificationDelivery()
-{
-    // Caller of this method must hold the m_notificationQueue lock
-    ASSERT(!m_notificationMutex.tryLock());
-
-    if (!m_deliveryRequested) {
-        m_deliveryRequested = true;
-        callOnMainThread([] {
-            deliverNotifications(0);
-        });
-    }
-}
-
-BSTR WebIconDatabase::iconDatabaseDidAddIconNotification()
-{
-    static BSTR didAddIconName = SysAllocString(WebIconDatabaseDidAddIconNotification);
-    return didAddIconName;
-}
-
-BSTR WebIconDatabase::iconDatabaseNotificationUserInfoURLKey()
-{
-    static BSTR iconUserInfoURLKey = SysAllocString(WebIconNotificationUserInfoURLKey);
-    return iconUserInfoURLKey;
-}
-
-BSTR WebIconDatabase::iconDatabaseDidRemoveAllIconsNotification()
-{
-    static BSTR didRemoveAllIconsName = SysAllocString(WebIconDatabaseDidRemoveAllIconsNotification);
-    return didRemoveAllIconsName;
-}
-
-static void postDidRemoveAllIconsNotification(WebIconDatabase* iconDB)
-{
-    IWebNotificationCenter* notifyCenter = WebNotificationCenter::defaultCenterInternal();
-    notifyCenter->postNotificationName(WebIconDatabase::iconDatabaseDidRemoveAllIconsNotification(), static_cast<IWebIconDatabase*>(iconDB), 0);
-}
-
-static void postDidAddIconNotification(const String& pageURL, WebIconDatabase* iconDB)
-{
-    HashMap<String, String> dictionary;
-    dictionary.set(WebIconDatabase::iconDatabaseNotificationUserInfoURLKey(), pageURL);
-    COMPtr<IPropertyBag> userInfo(AdoptCOM, COMPropertyBag<String>::adopt(dictionary));
-
-    IWebNotificationCenter* notifyCenter = WebNotificationCenter::defaultCenterInternal();
-    notifyCenter->postNotificationName(WebIconDatabase::iconDatabaseDidAddIconNotification(), static_cast<IWebIconDatabase*>(iconDB), userInfo.get());
-}
-
-void WebIconDatabase::deliverNotifications(void*)
-{
-    ASSERT(m_sharedWebIconDatabase);
-    if (!m_sharedWebIconDatabase)
-        return;
-
-    ASSERT(m_sharedWebIconDatabase->m_deliveryRequested);
-
-    Vector<String> queue;
-    {
-        LockHolder locker(m_sharedWebIconDatabase->m_notificationMutex);
-        queue.swap(m_sharedWebIconDatabase->m_notificationQueue);
-        m_sharedWebIconDatabase->m_deliveryRequested = false;
-    }
-
-    for (unsigned i = 0; i < queue.size(); ++i) {
-        if (queue[i].isNull())
-            postDidRemoveAllIconsNotification(m_sharedWebIconDatabase);
-        else
-            postDidAddIconNotification(queue[i], m_sharedWebIconDatabase);
-    }
-}

Deleted: trunk/Source/WebKitLegacy/win/WebIconDatabase.h (219683 => 219684)


--- trunk/Source/WebKitLegacy/win/WebIconDatabase.h	2017-07-20 14:28:18 UTC (rev 219683)
+++ trunk/Source/WebKitLegacy/win/WebIconDatabase.h	2017-07-20 14:30:10 UTC (rev 219684)
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2006-2009, 2013-2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef WebIconDatabase_H
-#define WebIconDatabase_H
-
-#include "WebKit.h"
-
-#include <WebCore/IconDatabaseClient.h>
-#include <WebCore/IntSize.h>
-#include <WebCore/IntSizeHash.h>
-#include <wtf/Lock.h>
-#include <wtf/Threading.h>
-#include <wtf/Vector.h>
-
-#include <windows.h>
-
-namespace WebCore
-{
-    class IconDatabase;
-}; //namespace WebCore
-using namespace WebCore;
-using namespace WTF;
-
-class WebIconDatabase : public IWebIconDatabase, public WebCore::IconDatabaseClient
-{
-public:
-    static WebIconDatabase* createInstance();
-    static WebIconDatabase* sharedWebIconDatabase();
-private:
-    WebIconDatabase();
-    ~WebIconDatabase();
-    void init();
-    void startUpIconDatabase();
-    void shutDownIconDatabase();
-public:
-
-    // IUnknown
-    virtual HRESULT STDMETHODCALLTYPE QueryInterface(_In_ REFIID riid, _COM_Outptr_ void** ppvObject);
-    virtual ULONG STDMETHODCALLTYPE AddRef();
-    virtual ULONG STDMETHODCALLTYPE Release();
-
-    // IWebIconDatabase
-    virtual HRESULT STDMETHODCALLTYPE sharedIconDatabase(_COM_Outptr_opt_ IWebIconDatabase**);
-    virtual HRESULT STDMETHODCALLTYPE iconForURL(_In_ BSTR url, _In_ LPSIZE, BOOL cache, __deref_opt_out HBITMAP* image);
-    virtual HRESULT STDMETHODCALLTYPE defaultIconWithSize(_In_ LPSIZE, __deref_opt_out HBITMAP* result);
-    virtual HRESULT STDMETHODCALLTYPE retainIconForURL(_In_ BSTR);
-    virtual HRESULT STDMETHODCALLTYPE releaseIconForURL(_In_ BSTR);
-    virtual HRESULT STDMETHODCALLTYPE removeAllIcons();
-    virtual HRESULT STDMETHODCALLTYPE delayDatabaseCleanup();
-    virtual HRESULT STDMETHODCALLTYPE allowDatabaseCleanup();
-    virtual HRESULT STDMETHODCALLTYPE iconURLForURL(_In_ BSTR url, __deref_opt_out BSTR* iconURL);
-    virtual HRESULT STDMETHODCALLTYPE isEnabled(_Out_ BOOL*);
-    virtual HRESULT STDMETHODCALLTYPE setEnabled(BOOL);
-    virtual HRESULT STDMETHODCALLTYPE hasIconForURL(_In_ BSTR url, _Out_ BOOL* result);
-
-    // IconDatabaseClient
-    virtual void didRemoveAllIcons();
-    virtual void didImportIconURLForPageURL(const WTF::String&);
-    virtual void didImportIconDataForPageURL(const WTF::String&);
-    virtual void didChangeIconForPageURL(const WTF::String&);
-    virtual void didFinishURLImport();
-
-    static BSTR iconDatabaseDidAddIconNotification();
-    static BSTR iconDatabaseDidRemoveAllIconsNotification();
-    static BSTR iconDatabaseNotificationUserInfoURLKey();
-protected:
-    ULONG m_refCount { 0 };
-    static WebIconDatabase* m_sharedWebIconDatabase;
-
-    // Keep a set of HBITMAPs around for the default icon, and another
-    // to share amongst present site icons
-    HBITMAP getOrCreateSharedBitmap(const IntSize&);
-    HBITMAP getOrCreateDefaultIconBitmap(const IntSize&);
-    HashMap<IntSize, HBITMAP> m_defaultIconMap;
-    HashMap<IntSize, HBITMAP> m_sharedIconMap;
-
-    Lock m_notificationMutex;
-    Vector<String> m_notificationQueue;
-    void scheduleNotificationDelivery();
-    bool m_deliveryRequested { false };
-
-    static void deliverNotifications(void*);
-};
-
-#endif

Modified: trunk/Source/WebKitLegacy/win/WebKitClassFactory.cpp (219683 => 219684)


--- trunk/Source/WebKitLegacy/win/WebKitClassFactory.cpp	2017-07-20 14:28:18 UTC (rev 219683)
+++ trunk/Source/WebKitLegacy/win/WebKitClassFactory.cpp	2017-07-20 14:30:10 UTC (rev 219684)
@@ -39,7 +39,6 @@
 #include "WebGeolocationPosition.h"
 #include "WebHistory.h"
 #include "WebHistoryItem.h"
-#include "WebIconDatabase.h"
 #include "WebJavaScriptCollector.h"
 #include "WebKit.h"
 #include "WebKitMessageLoop.h"

Modified: trunk/Source/WebKitLegacy/win/WebKitDLL.cpp (219683 => 219684)


--- trunk/Source/WebKitLegacy/win/WebKitDLL.cpp	2017-07-20 14:28:18 UTC (rev 219683)
+++ trunk/Source/WebKitLegacy/win/WebKitDLL.cpp	2017-07-20 14:30:10 UTC (rev 219684)
@@ -36,7 +36,6 @@
 #include "WebKitClassFactory.h"
 #include "WebStorageNamespaceProvider.h"
 #include <WebCore/COMPtr.h>
-#include <WebCore/IconDatabase.h>
 #include <WebCore/Page.h>
 #include <WebCore/PageGroup.h>
 #include <WebCore/PlatformDisplay.h>
@@ -163,7 +162,6 @@
 
 void shutDownWebKit()
 {
-    WebCore::iconDatabase().close();
     WebKit::WebStorageNamespaceProvider::closeLocalStorage();
 #if USE(EGL)
     PlatformDisplay::shutDownEglDisplays();

Modified: trunk/Source/WebKitLegacy/win/WebKitLogging.h (219683 => 219684)


--- trunk/Source/WebKitLegacy/win/WebKitLogging.h	2017-07-20 14:28:18 UTC (rev 219683)
+++ trunk/Source/WebKitLegacy/win/WebKitLogging.h	2017-07-20 14:30:10 UTC (rev 219684)
@@ -50,7 +50,6 @@
     M(FontSubstitution) \
     M(FormDelegate) \
     M(History) \
-    M(IconDatabase) \
     M(LiveConnect) \
     M(Loading) \
     M(PageCache) \

Modified: trunk/Source/WebKitLegacy/win/WebView.cpp (219683 => 219684)


--- trunk/Source/WebKitLegacy/win/WebView.cpp	2017-07-20 14:28:18 UTC (rev 219683)
+++ trunk/Source/WebKitLegacy/win/WebView.cpp	2017-07-20 14:30:10 UTC (rev 219684)
@@ -54,7 +54,6 @@
 #include "WebFrameNetworkingContext.h"
 #include "WebGeolocationClient.h"
 #include "WebGeolocationPosition.h"
-#include "WebIconDatabase.h"
 #include "WebInspector.h"
 #include "WebInspectorClient.h"
 #include "WebKit.h"
@@ -779,7 +778,6 @@
 
     m_mainFrame = nullptr;
 
-    registerForIconNotification(false);
     IWebNotificationCenter* notifyCenter = WebNotificationCenter::defaultCenterInternal();
     notifyCenter->removeObserver(this, WebPreferences::webPreferencesChangedNotification(), static_cast<IWebPreferences*>(m_preferences.get()));
 
@@ -3223,67 +3221,17 @@
     ::SendMessage(m_toolTipHwnd, TTM_ACTIVATE, !m_toolTip.isEmpty(), 0);
 }
 
-HRESULT WebView::notifyDidAddIcon(IWebNotification* notification)
+HRESULT WebView::notifyDidAddIcon(IWebNotification*)
 {
-    COMPtr<IPropertyBag> propertyBag;
-    HRESULT hr = notification->userInfo(&propertyBag);
-    if (FAILED(hr))
-        return hr;
-    if (!propertyBag)
-        return E_FAIL;
-
-    COMVariant iconUserInfoURL;
-    hr = propertyBag->Read(WebIconDatabase::iconDatabaseNotificationUserInfoURLKey(), &iconUserInfoURL, nullptr);
-    if (FAILED(hr))
-        return hr;
-
-    if (iconUserInfoURL.variantType() != VT_BSTR)
-        return E_FAIL;
-
-    String mainFrameURL;
-    if (m_mainFrame)
-        mainFrameURL = m_mainFrame->url().string();
-
-    if (!mainFrameURL.isEmpty() && mainFrameURL == toString(V_BSTR(&iconUserInfoURL)))
-        dispatchDidReceiveIconFromWebFrame(m_mainFrame);
-
-    return hr;
+    return E_FAIL;
 }
 
-void WebView::registerForIconNotification(bool listen)
+void WebView::registerForIconNotification(bool)
 {
-    IWebNotificationCenter* nc = WebNotificationCenter::defaultCenterInternal();
-    if (listen)
-        nc->addObserver(this, WebIconDatabase::iconDatabaseDidAddIconNotification(), 0);
-    else
-        nc->removeObserver(this, WebIconDatabase::iconDatabaseDidAddIconNotification(), 0);
 }
 
-void WebView::dispatchDidReceiveIconFromWebFrame(WebFrame* frame)
+void WebView::dispatchDidReceiveIconFromWebFrame(WebFrame*)
 {
-    registerForIconNotification(false);
-
-    if (m_frameLoadDelegate) {
-        String str = frame->url().string();
-
-        IntSize sz(16, 16);
-
-        BitmapInfo bmInfo = BitmapInfo::create(sz);
-
-        HBITMAP hBitmap = nullptr;
-
-        Image* icon = iconDatabase().synchronousIconForPageURL(str, sz);
-
-        if (icon && icon->width()) {
-            HWndDC dc(0);
-            hBitmap = CreateDIBSection(dc, &bmInfo, DIB_RGB_COLORS, 0, 0, 0);
-            icon->getHBITMAPOfSize(hBitmap, &sz);
-        }
-
-        HRESULT hr = m_frameLoadDelegate->didReceiveIcon(this, hBitmap, frame);
-        if ((hr == E_NOTIMPL) && hBitmap)
-            DeleteObject(hBitmap);
-    }
 }
 
 HRESULT WebView::setAccessibilityDelegate(_In_opt_ IAccessibilityDelegate* d)
@@ -5105,9 +5053,6 @@
     if (FAILED(hr))
         return hr;
 
-    if (!wcscmp(name, WebIconDatabase::iconDatabaseDidAddIconNotification()))
-        return notifyDidAddIcon(notification);
-
     if (!wcscmp(name, WebPreferences::webPreferencesChangedNotification()))
         return notifyPreferencesChanged(notification);
 

Modified: trunk/Tools/ChangeLog (219683 => 219684)


--- trunk/Tools/ChangeLog	2017-07-20 14:28:18 UTC (rev 219683)
+++ trunk/Tools/ChangeLog	2017-07-20 14:30:10 UTC (rev 219684)
@@ -1,3 +1,15 @@
+2017-07-20  Brady Eidson  <beid...@apple.com>
+
+        Remove WebIconDatabase from WebKitLegacy/win.
+        https://bugs.webkit.org/show_bug.cgi?id=174608
+
+        Reviewed by Alex Christensen.
+
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (main):
+        * DumpRenderTree/win/TestRunnerWin.cpp:
+        (TestRunner::setIconDatabaseEnabled):
+
 2017-07-20  Zan Dobersek  <zdober...@igalia.com>
 
         [WPE] Adjust priority of GSource used in WKTR's HeadlessViewBackend

Modified: trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp (219683 => 219684)


--- trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp	2017-07-20 14:28:18 UTC (rev 219683)
+++ trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp	2017-07-20 14:30:10 UTC (rev 219684)
@@ -1566,12 +1566,6 @@
     if (!webView)
         return -4;
 
-    COMPtr<IWebIconDatabase> iconDatabase;
-    COMPtr<IWebIconDatabase> tmpIconDatabase;
-    if (FAILED(WebKitCreateInstance(CLSID_WebIconDatabase, 0, IID_IWebIconDatabase, (void**)&tmpIconDatabase)))
-        return -5;
-    if (FAILED(tmpIconDatabase->sharedIconDatabase(&iconDatabase)))
-        return -6;
     if (FAILED(webView->mainFrame(&frame)))
         return -7;
 

Modified: trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp (219683 => 219684)


--- trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp	2017-07-20 14:28:18 UTC (rev 219683)
+++ trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp	2017-07-20 14:30:10 UTC (rev 219684)
@@ -485,19 +485,8 @@
     setGeolocationPermissionCommon(allow);
 }
 
-void TestRunner::setIconDatabaseEnabled(bool iconDatabaseEnabled)
+void TestRunner::setIconDatabaseEnabled(bool)
 {
-#if ENABLE(ICONDATABASE)
-    // See also <rdar://problem/6480108>
-    COMPtr<IWebIconDatabase> iconDatabase;
-    COMPtr<IWebIconDatabase> tmpIconDatabase;
-    if (FAILED(WebKitCreateInstance(CLSID_WebIconDatabase, 0, IID_IWebIconDatabase, (void**)&tmpIconDatabase)))
-        return;
-    if (FAILED(tmpIconDatabase->sharedIconDatabase(&iconDatabase)))
-        return;
-
-    iconDatabase->setEnabled(iconDatabaseEnabled);
-#endif
 }
 
 void TestRunner::setMainFrameIsFirstResponder(bool)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to