DOMApplicationCache.h [plain text]
#ifndef DOMApplicationCache_h
#define DOMApplicationCache_h
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
#include "ApplicationCacheHost.h"
#include "EventNames.h"
#include "EventTarget.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 KURL;
class DOMApplicationCache : public RefCounted<DOMApplicationCache>, public EventTarget {
public:
static PassRefPtr<DOMApplicationCache> create(Frame* frame) { return adoptRef(new DOMApplicationCache(frame)); }
~DOMApplicationCache() { ASSERT(!m_frame); }
Frame* frame() const { return m_frame; }
void disconnectFrame();
unsigned short status() const;
void update(ExceptionCode&);
void swapCache(ExceptionCode&);
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 ScriptExecutionContext* scriptExecutionContext() const;
DOMApplicationCache* toDOMApplicationCache() { return this; }
static const AtomicString& toEventType(ApplicationCacheHost::EventID id);
private:
DOMApplicationCache(Frame*);
virtual void refEventTarget() { ref(); }
virtual void derefEventTarget() { deref(); }
virtual EventTargetData* eventTargetData();
virtual EventTargetData* ensureEventTargetData();
ApplicationCacheHost* applicationCacheHost() const;
Frame* m_frame;
EventTargetData m_eventTargetData;
};
}
#endif // ENABLE(OFFLINE_WEB_APPLICATIONS)
#endif // DOMApplicationCache_h