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