#ifndef ApplicationCache_h
#define ApplicationCache_h
#include "bindings/v8/ScriptWrappable.h"
#include "core/events/EventTarget.h"
#include "core/loader/appcache/ApplicationCacheHost.h"
#include "core/frame/DOMWindowProperty.h"
#include "heap/Handle.h"
#include "wtf/Forward.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
namespace WebCore {
class ExceptionState;
class LocalFrame;
class KURL;
class ApplicationCache FINAL : public RefCountedWillBeRefCountedGarbageCollected<ApplicationCache>, public ScriptWrappable, public EventTargetWithInlineData, public DOMWindowProperty {
DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<ApplicationCache>);
public:
static PassRefPtrWillBeRawPtr<ApplicationCache> create(LocalFrame* frame)
{
return adoptRefWillBeRefCountedGarbageCollected(new ApplicationCache(frame));
}
virtual ~ApplicationCache() { ASSERT(!m_frame); }
virtual void willDestroyGlobalObjectInFrame() OVERRIDE;
unsigned short status() const;
void update(ExceptionState&);
void swapCache(ExceptionState&);
void abort();
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 const AtomicString& interfaceName() const OVERRIDE;
virtual ExecutionContext* executionContext() const OVERRIDE;
static const AtomicString& toEventType(ApplicationCacheHost::EventID);
void trace(Visitor*) { }
private:
explicit ApplicationCache(LocalFrame*);
ApplicationCacheHost* applicationCacheHost() const;
};
}
#endif