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