From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebKit2/UIProcess/WebIconDatabase.h | 60 +++++++++++++++--------------- 1 file changed, 31 insertions(+), 29 deletions(-) (limited to 'Source/WebKit2/UIProcess/WebIconDatabase.h') diff --git a/Source/WebKit2/UIProcess/WebIconDatabase.h b/Source/WebKit2/UIProcess/WebIconDatabase.h index 816b20d4b..8b70fe824 100644 --- a/Source/WebKit2/UIProcess/WebIconDatabase.h +++ b/Source/WebKit2/UIProcess/WebIconDatabase.h @@ -27,21 +27,14 @@ #define WebIconDatabase_h #include "APIObject.h" - #include "Connection.h" #include "WebIconDatabaseClient.h" #include -#include #include -#include -#include -#include -#include -#include - -namespace IPC { -class ArgumentDecoder; -class DataReference; +#include + +namespace API { +class Data; } namespace WebCore { @@ -51,15 +44,15 @@ class Image; namespace WebKit { -class WebContext; +class WebProcessPool; -class WebIconDatabase : public API::ObjectImpl, public WebCore::IconDatabaseClient, private IPC::MessageReceiver { +class WebIconDatabase : public API::ObjectImpl, private WebCore::IconDatabaseClient, private IPC::MessageReceiver { public: - static PassRefPtr create(WebContext*); + static PassRefPtr create(WebProcessPool*); virtual ~WebIconDatabase(); void invalidate(); - void clearContext() { m_webContext = 0; } + void clearProcessPool() { m_processPool = nullptr; } void setDatabasePath(const String&); void enableDatabaseCleanup(); @@ -67,17 +60,19 @@ public: void releaseIconForPageURL(const String&); void setIconURLForPageURL(const String&, const String&); void setIconDataForIconURL(const IPC::DataReference&, const String&); - + void synchronousIconDataForPageURL(const String&, IPC::DataReference&); void synchronousIconURLForPageURL(const String&, String&); void synchronousIconDataKnownForIconURL(const String&, bool&) const; void synchronousLoadDecisionForIconURL(const String&, int&) const; - + void getLoadDecisionForIconURL(const String&, uint64_t callbackID); void didReceiveIconForPageURL(const String&); WebCore::Image* imageForPageURL(const String&, const WebCore::IntSize& iconSize = WebCore::IntSize(32, 32)); WebCore::NativeImagePtr nativeImageForPageURL(const String&, const WebCore::IntSize& iconSize = WebCore::IntSize(32, 32)); + PassRefPtr iconDataForPageURL(const String& pageURL); + bool isOpen(); bool isUrlImportCompleted(); @@ -88,28 +83,35 @@ public: void initializeIconDatabaseClient(const WKIconDatabaseClientBase*); void setPrivateBrowsingEnabled(bool); - + + // Called when the WebProcessPool is through with this WebIconDatabase but the + // WebCore::IconDatabase possibly isn't done shutting down. + // In that case this WebIconDatabase will deref() itself when the time is right. + void derefWhenAppropriate(); + private: - WebIconDatabase(WebContext*); + explicit WebIconDatabase(WebProcessPool&); // WebCore::IconDatabaseClient - virtual void didImportIconURLForPageURL(const String&); - virtual void didImportIconDataForPageURL(const String&); - virtual void didChangeIconForPageURL(const String&); - virtual void didRemoveAllIcons(); - virtual void didFinishURLImport(); + void didImportIconURLForPageURL(const String&) override; + void didImportIconDataForPageURL(const String&) override; + void didChangeIconForPageURL(const String&) override; + void didRemoveAllIcons() override; + void didFinishURLImport() override; + void didClose() override; // IPC::MessageReceiver - virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&) override; - virtual void didReceiveSyncMessage(IPC::Connection*, IPC::MessageDecoder&, std::unique_ptr&) override; + void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; + void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr&) override; void notifyIconDataReadyForPageURL(const String&); - WebContext* m_webContext; - - OwnPtr m_iconDatabaseImpl; + WebProcessPool* m_processPool; + + std::unique_ptr m_iconDatabaseImpl; bool m_urlImportCompleted; bool m_databaseCleanupDisabled; + bool m_shouldDerefWhenAppropriate; HashMap m_pendingLoadDecisionURLMap; WebIconDatabaseClient m_iconDatabaseClient; -- cgit v1.2.1