#ifndef InspectorApplicationCacheAgent_h
#define InspectorApplicationCacheAgent_h
#include "InspectorFrontend.h"
#include "core/inspector/InspectorBaseAgent.h"
#include "core/loader/appcache/ApplicationCacheHost.h"
#include "wtf/Noncopyable.h"
#include "wtf/PassOwnPtr.h"
namespace WebCore {
class LocalFrame;
class InspectorFrontend;
class InspectorPageAgent;
class InstrumentingAgents;
typedef String ErrorString;
class InspectorApplicationCacheAgent FINAL : public InspectorBaseAgent<InspectorApplicationCacheAgent>, public InspectorBackendDispatcher::ApplicationCacheCommandHandler {
WTF_MAKE_NONCOPYABLE(InspectorApplicationCacheAgent); WTF_MAKE_FAST_ALLOCATED;
public:
static PassOwnPtr<InspectorApplicationCacheAgent> create(InspectorPageAgent* pageAgent)
{
return adoptPtr(new InspectorApplicationCacheAgent(pageAgent));
}
virtual ~InspectorApplicationCacheAgent() { }
virtual void setFrontend(InspectorFrontend*) OVERRIDE;
virtual void clearFrontend() OVERRIDE;
virtual void restore() OVERRIDE;
void updateApplicationCacheStatus(LocalFrame*);
void networkStateChanged(bool online);
virtual void enable(ErrorString*) OVERRIDE;
virtual void getFramesWithManifests(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::ApplicationCache::FrameWithManifest> >& result) OVERRIDE;
virtual void getManifestForFrame(ErrorString*, const String& frameId, String* manifestURL) OVERRIDE;
virtual void getApplicationCacheForFrame(ErrorString*, const String& frameId, RefPtr<TypeBuilder::ApplicationCache::ApplicationCache>&) OVERRIDE;
private:
InspectorApplicationCacheAgent(InspectorPageAgent*);
PassRefPtr<TypeBuilder::ApplicationCache::ApplicationCache> buildObjectForApplicationCache(const ApplicationCacheHost::ResourceInfoList&, const ApplicationCacheHost::CacheInfo&);
PassRefPtr<TypeBuilder::Array<TypeBuilder::ApplicationCache::ApplicationCacheResource> > buildArrayForApplicationCacheResources(const ApplicationCacheHost::ResourceInfoList&);
PassRefPtr<TypeBuilder::ApplicationCache::ApplicationCacheResource> buildObjectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo&);
DocumentLoader* assertFrameWithDocumentLoader(ErrorString*, String frameId);
InspectorPageAgent* m_pageAgent;
InspectorFrontend::ApplicationCache* m_frontend;
};
}
#endif