diff options
Diffstat (limited to 'Source/WebKit2/UIProcess/WebIconDatabase.h')
-rw-r--r-- | Source/WebKit2/UIProcess/WebIconDatabase.h | 68 |
1 files changed, 36 insertions, 32 deletions
diff --git a/Source/WebKit2/UIProcess/WebIconDatabase.h b/Source/WebKit2/UIProcess/WebIconDatabase.h index be1b3dcbc..7d8b6025f 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 <WebCore/IconDatabaseClient.h> -#include <WebCore/ImageSource.h> #include <WebCore/IntSize.h> -#include <wtf/Forward.h> -#include <wtf/PassRefPtr.h> -#include <wtf/RefPtr.h> -#include <wtf/Vector.h> -#include <wtf/text/StringHash.h> - -namespace CoreIPC { -class ArgumentDecoder; -class DataReference; +#include <WebCore/NativeImagePtr.h> + +namespace API { +class Data; } namespace WebCore { @@ -51,33 +44,35 @@ class Image; namespace WebKit { -class WebContext; +class WebProcessPool; -class WebIconDatabase : public TypedAPIObject<APIObject::TypeIconDatabase>, public WebCore::IconDatabaseClient, private CoreIPC::MessageReceiver { +class WebIconDatabase : public API::ObjectImpl<API::Object::Type::IconDatabase>, private WebCore::IconDatabaseClient, private IPC::MessageReceiver { public: - static PassRefPtr<WebIconDatabase> create(WebContext*); + static PassRefPtr<WebIconDatabase> create(WebProcessPool*); virtual ~WebIconDatabase(); void invalidate(); - void clearContext() { m_webContext = 0; } + void clearProcessPool() { m_processPool = nullptr; } void setDatabasePath(const String&); void enableDatabaseCleanup(); void retainIconForPageURL(const String&); void releaseIconForPageURL(const String&); void setIconURLForPageURL(const String&, const String&); - void setIconDataForIconURL(const CoreIPC::DataReference&, const String&); - - void synchronousIconDataForPageURL(const String&, CoreIPC::DataReference&); + 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<API::Data> iconDataForPageURL(const String& pageURL); + bool isOpen(); bool isUrlImportCompleted(); @@ -85,29 +80,38 @@ public: void checkIntegrityBeforeOpening(); void close(); - void initializeIconDatabaseClient(const WKIconDatabaseClient*); + 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(); + virtual void didImportIconURLForPageURL(const String&) override; + virtual void didImportIconDataForPageURL(const String&) override; + virtual void didChangeIconForPageURL(const String&) override; + virtual void didRemoveAllIcons() override; + virtual void didFinishURLImport() override; + virtual void didClose() override; - // CoreIPC::MessageReceiver - virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&) OVERRIDE; - virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&) OVERRIDE; + // IPC::MessageReceiver + virtual void didReceiveMessage(IPC::Connection&, IPC::MessageDecoder&) override; + virtual void didReceiveSyncMessage(IPC::Connection&, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&) override; void notifyIconDataReadyForPageURL(const String&); - WebContext* m_webContext; - - OwnPtr<WebCore::IconDatabase> m_iconDatabaseImpl; + WebProcessPool* m_processPool; + + std::unique_ptr<WebCore::IconDatabase> m_iconDatabaseImpl; bool m_urlImportCompleted; bool m_databaseCleanupDisabled; + bool m_shouldDerefWhenAppropriate; HashMap<uint64_t, String> m_pendingLoadDecisionURLMap; WebIconDatabaseClient m_iconDatabaseClient; |