DOMApplicationCache.h [plain text]
#ifndef DOMApplicationCache_h
#define DOMApplicationCache_h
#include "ApplicationCacheHost.h"
#include "DOMWindowProperty.h"
#include "EventNames.h"
#include "EventTarget.h"
#include "ScriptWrappable.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
#include <wtf/text/AtomicStringHash.h>
namespace WebCore {
class Frame;
class URL;
class DOMApplicationCache final : public ScriptWrappable, public RefCounted<DOMApplicationCache>, public EventTargetWithInlineData, public DOMWindowProperty {
public:
static PassRefPtr<DOMApplicationCache> create(Frame* frame) { return adoptRef(new DOMApplicationCache(frame)); }
virtual ~DOMApplicationCache() { ASSERT(!m_frame); }
virtual void disconnectFrameForPageCache() override;
virtual void reconnectFrameFromPageCache(Frame*) override;
virtual void willDestroyGlobalObjectInFrame() override;
unsigned short status() const;
void update(ExceptionCode&);
void swapCache(ExceptionCode&);
void abort();
using RefCounted<DOMApplicationCache>::ref;
using RefCounted<DOMApplicationCache>::deref;
DEFINE_ATTRIBUTE_EVENT_LISTENER(checking);
DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
DEFINE_ATTRIBUTE_EVENT_LISTENER(noupdate);
DEFINE_ATTRIBUTE_EVENT_LISTENER(downloading);
DEFINE_ATTRIBUTE_EVENT_LISTENER(progress);
DEFINE_ATTRIBUTE_EVENT_LISTENER(updateready);
DEFINE_ATTRIBUTE_EVENT_LISTENER(cached);
DEFINE_ATTRIBUTE_EVENT_LISTENER(obsolete);
virtual EventTargetInterface eventTargetInterface() const override { return DOMApplicationCacheEventTargetInterfaceType; }
virtual ScriptExecutionContext* scriptExecutionContext() const override;
static const AtomicString& toEventType(ApplicationCacheHost::EventID id);
private:
explicit DOMApplicationCache(Frame*);
virtual void refEventTarget() override { ref(); }
virtual void derefEventTarget() override { deref(); }
ApplicationCacheHost* applicationCacheHost() const;
};
}
#endif // DOMApplicationCache_h