InspectorApplicationCacheAgent.h [plain text]
#ifndef InspectorApplicationCacheAgent_h
#define InspectorApplicationCacheAgent_h
#if ENABLE(INSPECTOR)
#include "ApplicationCacheHost.h"
#include "InspectorBaseAgent.h"
#include "InspectorFrontend.h"
#include <wtf/Noncopyable.h>
#include <wtf/PassOwnPtr.h>
namespace WebCore {
class Frame;
class InspectorArray;
class InspectorAgent;
class InspectorFrontend;
class InspectorObject;
class InspectorPageAgent;
class InspectorValue;
class InspectorState;
class InstrumentingAgents;
class Page;
class ResourceResponse;
typedef String ErrorString;
class InspectorApplicationCacheAgent : public InspectorBaseAgent<InspectorApplicationCacheAgent>, public InspectorBackendDispatcher::ApplicationCacheCommandHandler {
WTF_MAKE_NONCOPYABLE(InspectorApplicationCacheAgent); WTF_MAKE_FAST_ALLOCATED;
public:
static PassOwnPtr<InspectorApplicationCacheAgent> create(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* state, InspectorPageAgent* pageAgent)
{
return adoptPtr(new InspectorApplicationCacheAgent(instrumentingAgents, state, pageAgent));
}
~InspectorApplicationCacheAgent() { }
virtual void setFrontend(InspectorFrontend*);
virtual void clearFrontend();
virtual void restore();
void updateApplicationCacheStatus(Frame*);
void networkStateChanged();
virtual void enable(ErrorString*);
virtual void getFramesWithManifests(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::ApplicationCache::FrameWithManifest> >& result);
virtual void getManifestForFrame(ErrorString*, const String& frameId, String* manifestURL);
virtual void getApplicationCacheForFrame(ErrorString*, const String& frameId, RefPtr<TypeBuilder::ApplicationCache::ApplicationCache>&);
private:
InspectorApplicationCacheAgent(InstrumentingAgents*, InspectorCompositeState*, 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 // ENABLE(INSPECTOR)
#endif // InspectorApplicationCacheAgent_h