WebIconDatabaseProxy.h [plain text]
#ifndef WebIconDatabaseProxy_h
#define WebIconDatabaseProxy_h
#include "APIObject.h"
#include "MessageReceiver.h"
#include <WebCore/IconDatabaseBase.h>
#include <wtf/HashMap.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
namespace WebKit {
class WebProcess;
class WebIconDatabaseProxy : public WebCore::IconDatabaseBase, private IPC::MessageReceiver {
public:
explicit WebIconDatabaseProxy(WebProcess*);
virtual ~WebIconDatabaseProxy();
bool isEnabled() const override;
void setEnabled(bool) override;
void retainIconForPageURL(const String&) override;
void releaseIconForPageURL(const String&) override;
void setIconURLForPageURL(const String&, const String&) override;
void setIconDataForIconURL(PassRefPtr<WebCore::SharedBuffer>, const String&) override;
String synchronousIconURLForPageURL(const String&) override;
bool synchronousIconDataKnownForIconURL(const String&) override;
WebCore::IconLoadDecision synchronousLoadDecisionForIconURL(const String&, WebCore::DocumentLoader*) override;
WebCore::Image* synchronousIconForPageURL(const String&, const WebCore::IntSize&) override;
bool supportsAsynchronousMode() override;
void loadDecisionForIconURL(const String&, PassRefPtr<WebCore::IconLoadDecisionCallback>) override;
void receivedIconLoadDecision(int decision, uint64_t callbackID);
void iconDataForIconURL(const String&, PassRefPtr<WebCore::IconDataCallback>) override;
private:
void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
void urlImportFinished();
bool m_isEnabled;
WebProcess* m_process;
HashMap<uint64_t, RefPtr<WebCore::IconLoadDecisionCallback>> m_iconLoadDecisionCallbacks;
};
}
#endif // WebIconDatabaseProxy_h