webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Instance Methods | Class Methods | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
WebIconDatabase Class Reference

#import <WebIconDatabase.h>

Inheritance diagram for WebIconDatabase:
IWebIconDatabase WebCore::IconDatabaseClient NSObject

Instance Methods

(NSImage *) - iconForURL:withSize:
 
(NSImage *) - iconForURL:withSize:cache:
 
(NSString *) - iconURLForURL:
 
(NSImage *) - defaultIconWithSize:
 
(NSImage *) - defaultIconForURL:withSize:
 
(void- retainIconForURL:
 
(void- releaseIconForURL:
 
(void- setDelegate:
 
(id- delegate
 
(virtual HRESULT STDMETHODCALLTYPE) - QueryInterface
 
(virtual ULONG STDMETHODCALLTYPE) - AddRef
 
(virtual ULONG STDMETHODCALLTYPE) - Release
 
(virtual HRESULT STDMETHODCALLTYPE) - sharedIconDatabase
 
(virtual HRESULT STDMETHODCALLTYPE) - iconForURL
 
(virtual HRESULT STDMETHODCALLTYPE) - defaultIconWithSize
 
(virtual HRESULT STDMETHODCALLTYPE) - retainIconForURL
 
(virtual HRESULT STDMETHODCALLTYPE) - releaseIconForURL
 
(virtual HRESULT STDMETHODCALLTYPE) - removeAllIcons
 
(virtual HRESULT STDMETHODCALLTYPE) - delayDatabaseCleanup
 
(virtual HRESULT STDMETHODCALLTYPE) - allowDatabaseCleanup
 
(virtual HRESULT STDMETHODCALLTYPE) - iconURLForURL
 
(virtual HRESULT STDMETHODCALLTYPE) - isEnabled
 
(virtual HRESULT STDMETHODCALLTYPE) - setEnabled
 
(virtual HRESULT STDMETHODCALLTYPE) - hasIconForURL
 
(virtual void- didRemoveAllIcons
 
(virtual void- didImportIconURLForPageURL
 
(virtual void- didImportIconDataForPageURL
 
(virtual void- didChangeIconForPageURL
 
(virtual void- didFinishURLImport
 
- Instance Methods inherited from IWebIconDatabase
HRESULT sharedIconDatabase ([out, retval] IWebIconDatabase **result)
 
HRESULT iconForURL ([in] BSTR url, [in] LPSIZE size, [in] BOOL cache, [out, retval] HBITMAP *hBitmap)
 
HRESULT defaultIconWithSize ([in] LPSIZE size, [out, retval] HBITMAP *hBitmap)
 
HRESULT retainIconForURL ([in] BSTR url)
 
HRESULT releaseIconForURL ([in] BSTR url)
 
HRESULT iconURLForURL ([in] BSTR url, [out, retval] BSTR *iconURL)
 
HRESULT isEnabled ([out, retval] BOOL *result)
 
HRESULT hasIconForURL ([in] BSTR url, [out, retval] BOOL *result)
 
- Instance Methods inherited from WebCore::IconDatabaseClient
virtual ~IconDatabaseClient ()
 
virtual void didClose ()
 
virtual ~IconDatabaseClient ()
 
virtual void didClose ()
 

Class Methods

(WebIconDatabase *) + sharedIconDatabase
 
(void+ delayDatabaseCleanup
 
(void+ allowDatabaseCleanup
 
(static WebIconDatabase *) + createInstance
 
(static WebIconDatabase *) + sharedWebIconDatabase
 
(static BSTR+ iconDatabaseDidAddIconNotification
 
(static BSTR+ iconDatabaseDidRemoveAllIconsNotification
 
(static BSTR+ iconDatabaseNotificationUserInfoURLKey
 

Protected Member Functions

(HBITMAP) - getOrCreateSharedBitmap
 
(HBITMAP) - getOrCreateDefaultIconBitmap
 
(void- scheduleNotificationDelivery
 

Static Protected Member Functions

(static void+ deliverNotifications
 

Protected Attributes

ULONG m_refCount { 0 }
 
HashMap< IntSize, HBITMAP > m_defaultIconMap
 
HashMap< IntSize, HBITMAP > m_sharedIconMap
 
Lock m_notificationMutex
 
Vector< Stringm_notificationQueue
 
bool m_deliveryRequested { false }
 

Static Protected Attributes

static WebIconDatabasem_sharedWebIconDatabase = 0
 

Detailed Description

Features:

Uses:

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.

Features:

Uses:

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.

Method Documentation

◆ AddRef()

- (ULONG) AddRef (void

◆ allowDatabaseCleanup() [1/2]

+ (HRESULT) allowDatabaseCleanup

allowDatabaseCleanup: 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.

Implements IWebIconDatabase.

◆ allowDatabaseCleanup() [2/2]

- (virtual HRESULT STDMETHODCALLTYPE) allowDatabaseCleanup

allowDatabaseCleanup: 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;

Implements IWebIconDatabase.

◆ createInstance()

+ (WebIconDatabase *) createInstance

◆ defaultIconForURL:withSize:()

- (NSImage *) defaultIconForURL: (NSString *)  URL
withSize: (NSSize)  size 

◆ defaultIconWithSize()

- (HRESULT) defaultIconWithSize (_In_ LPSIZE)  size
(__deref_opt_out HBITMAP *)  result 

◆ defaultIconWithSize:()

- (NSImage *) defaultIconWithSize: (NSSize)  size

defaultIconWithSize:

◆ delayDatabaseCleanup() [1/2]

+ (HRESULT) delayDatabaseCleanup

delayDatabaseCleanup: 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.

Implements IWebIconDatabase.

◆ delayDatabaseCleanup() [2/2]

- (virtual HRESULT STDMETHODCALLTYPE) delayDatabaseCleanup

delayDatabaseCleanup: 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;

Implements IWebIconDatabase.

◆ delegate()

- (id) delegate

◆ deliverNotifications()

+ (void) deliverNotifications (void *) 

◆ didChangeIconForPageURL()

- (void) didChangeIconForPageURL (const WTF::String &)  pageURL

◆ didFinishURLImport()

- (void) didFinishURLImport

◆ didImportIconDataForPageURL()

- (void) didImportIconDataForPageURL (const WTF::String &)  pageURL

◆ didImportIconURLForPageURL()

- (void) didImportIconURLForPageURL (const WTF::String &)  pageURL

◆ didRemoveAllIcons()

- (void) didRemoveAllIcons

◆ getOrCreateDefaultIconBitmap()

- (HBITMAP) getOrCreateDefaultIconBitmap (const IntSize &)  size

◆ getOrCreateSharedBitmap()

- (HBITMAP) getOrCreateSharedBitmap (const IntSize &)  size

◆ hasIconForURL()

- (HRESULT) hasIconForURL (_In_ BSTR url
(_Out_ BOOL *)  result 

◆ iconDatabaseDidAddIconNotification()

+ (BSTR) iconDatabaseDidAddIconNotification

◆ iconDatabaseDidRemoveAllIconsNotification()

+ (BSTR) iconDatabaseDidRemoveAllIconsNotification

◆ iconDatabaseNotificationUserInfoURLKey()

+ (BSTR) iconDatabaseNotificationUserInfoURLKey

◆ iconForURL()

- (HRESULT) iconForURL (_In_ BSTR url
(_In_ LPSIZE)  size
(BOOL cache
(__deref_opt_out HBITMAP *)  image 

◆ iconForURL:withSize:()

- (NSImage *) iconForURL: (NSString *)  URL
withSize: (NSSize)  size 

iconForURL:withSize: Calls iconForURL:withSize:cache: with YES for cache.

◆ iconForURL:withSize:cache:()

- (NSImage *) iconForURL: (NSString *)  URL
withSize: (NSSize)  size
cache: (BOOL cache 

iconForURL:withSize:cache: 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.

Parameters
cacheIf yes, caches the returned image in memory if not already cached

◆ iconURLForURL()

- (HRESULT) iconURLForURL (_In_ BSTR url
(__deref_opt_out BSTR *)  iconURL 

◆ iconURLForURL:()

- (NSString *) iconURLForURL: (NSString *)  URL

iconURLForURL:withSize:cache: Returns an icon URL for a web site URL from memory or disk. nil if none is found.

◆ isEnabled()

- (HRESULT) isEnabled (_Out_ BOOL *)  result

◆ QueryInterface()

- (HRESULT) QueryInterface (_In_ REFIID)  riid
(_COM_Outptr_ void **)  ppvObject 

◆ Release()

- (ULONG) Release (void

◆ releaseIconForURL()

- (HRESULT) releaseIconForURL (_In_ BSTR url

◆ releaseIconForURL:()

- (void) releaseIconForURL: (NSString *)  URL

releaseIconForURL: Decrements the retain count of the icon.

◆ removeAllIcons()

- (HRESULT) removeAllIcons

removeAllIcons: Emtpies the Icon Database

  • (void)removeAllIcons;

Implements IWebIconDatabase.

◆ retainIconForURL()

- (HRESULT) retainIconForURL (_In_ BSTR url

◆ retainIconForURL:()

- (void) retainIconForURL: (NSString *)  URL

retainIconForURL: Increments the retain count of the icon.

◆ scheduleNotificationDelivery()

- (void) scheduleNotificationDelivery

◆ setDelegate:()

- (void) setDelegate: (id delegate

◆ setEnabled()

- (HRESULT) setEnabled (BOOL flag

setEnabled: Enables or disables the icon database based on the flag passed in.

Parameters
flagPass true to enable the icon database, or false to disable it.
  • (void)setEnabled:(BOOL)flag;

Implements IWebIconDatabase.

◆ sharedIconDatabase() [1/2]

- (HRESULT) sharedIconDatabase (_COM_Outptr_opt_ IWebIconDatabase **)  result

◆ sharedIconDatabase() [2/2]

+ (WebIconDatabase *) sharedIconDatabase

sharedIconDatabase Returns a shared instance of the icon database

◆ sharedWebIconDatabase()

+ (WebIconDatabase *) sharedWebIconDatabase

Member Data Documentation

◆ m_defaultIconMap

- (HashMap<IntSize, HBITMAP>) m_defaultIconMap
protected

◆ m_deliveryRequested

- (bool) m_deliveryRequested { false }
protected

◆ m_notificationMutex

- (Lock) m_notificationMutex
protected

◆ m_notificationQueue

- (Vector<String>) m_notificationQueue
protected

◆ m_refCount

- (ULONG) m_refCount { 0 }
protected

◆ m_sharedIconMap

- (HashMap<IntSize, HBITMAP>) m_sharedIconMap
protected

◆ m_sharedWebIconDatabase

+ (WebIconDatabase *) m_sharedWebIconDatabase = 0
staticprotected

The documentation for this class was generated from the following files: