WebApplicationCacheManagerProxy.h [plain text]
#ifndef WebApplicationCacheManagerProxy_h
#define WebApplicationCacheManagerProxy_h
#include "APIObject.h"
#include "GenericCallback.h"
#include "MessageReceiver.h"
#include "WebContextSupplement.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
namespace IPC {
class Connection;
}
namespace WebKit {
class WebSecurityOrigin;
struct SecurityOriginData;
typedef GenericCallback<API::Array*> ArrayCallback;
class WebApplicationCacheManagerProxy : public API::ObjectImpl<API::Object::Type::ApplicationCacheManager>, public WebContextSupplement, private IPC::MessageReceiver {
public:
static const char* supplementName();
static PassRefPtr<WebApplicationCacheManagerProxy> create(WebContext*);
virtual ~WebApplicationCacheManagerProxy();
void getApplicationCacheOrigins(std::function<void (API::Array*, CallbackBase::Error)>);
void deleteEntriesForOrigin(WebSecurityOrigin*);
void deleteAllEntries();
using API::Object::ref;
using API::Object::deref;
private:
explicit WebApplicationCacheManagerProxy(WebContext*);
void didGetApplicationCacheOrigins(const Vector<SecurityOriginData>&, uint64_t callbackID);
virtual void contextDestroyed() override;
virtual void processDidClose(WebProcessProxy*) override;
virtual bool shouldTerminate(WebProcessProxy*) const override;
virtual void refWebContextSupplement() override;
virtual void derefWebContextSupplement() override;
virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&) override;
HashMap<uint64_t, RefPtr<ArrayCallback>> m_arrayCallbacks;
};
}
#endif // WebApplicationCacheManagerProxy_h