WebMediaCacheManagerProxy.h [plain text]
#ifndef WebMediaCacheManagerProxy_h
#define WebMediaCacheManagerProxy_h
#include "APIObject.h"
#include "GenericCallback.h"
#include "ImmutableArray.h"
#include "MessageReceiver.h"
#include "WebContextSupplement.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
namespace WebKit {
class WebContext;
class WebProcessProxy;
typedef GenericCallback<WKArrayRef> ArrayCallback;
class WebMediaCacheManagerProxy : public TypedAPIObject<APIObject::TypeMediaCacheManager>, public WebContextSupplement, private CoreIPC::MessageReceiver {
public:
static const char* supplementName();
static PassRefPtr<WebMediaCacheManagerProxy> create(WebContext*);
virtual ~WebMediaCacheManagerProxy();
void getHostnamesWithMediaCache(PassRefPtr<ArrayCallback>);
void clearCacheForHostname(const String&);
void clearCacheForAllHostnames();
using APIObject::ref;
using APIObject::deref;
private:
explicit WebMediaCacheManagerProxy(WebContext*);
void didGetHostnamesWithMediaCache(const Vector<String>&, 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(CoreIPC::Connection*, CoreIPC::MessageDecoder&) OVERRIDE;
HashMap<uint64_t, RefPtr<ArrayCallback>> m_arrayCallbacks;
};
}
#endif // WebMediaCacheManagerProxy_h