#ifndef InspectorDOMStorageAgent_h
#define InspectorDOMStorageAgent_h
#include "core/inspector/InspectorBaseAgent.h"
#include "core/storage/StorageArea.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/text/WTFString.h"
namespace WebCore {
class LocalFrame;
class InspectorFrontend;
class InspectorPageAgent;
class InstrumentingAgents;
class JSONObject;
class Storage;
class StorageArea;
typedef String ErrorString;
class InspectorDOMStorageAgent FINAL : public InspectorBaseAgent<InspectorDOMStorageAgent>, public InspectorBackendDispatcher::DOMStorageCommandHandler {
public:
static PassOwnPtr<InspectorDOMStorageAgent> create(InspectorPageAgent* pageAgent)
{
return adoptPtr(new InspectorDOMStorageAgent(pageAgent));
}
virtual ~InspectorDOMStorageAgent();
virtual void setFrontend(InspectorFrontend*) OVERRIDE;
virtual void clearFrontend() OVERRIDE;
virtual void enable(ErrorString*) OVERRIDE;
virtual void disable(ErrorString*) OVERRIDE;
virtual void getDOMStorageItems(ErrorString*, const RefPtr<JSONObject>& storageId, RefPtr<TypeBuilder::Array<TypeBuilder::Array<String> > >& items) OVERRIDE;
virtual void setDOMStorageItem(ErrorString*, const RefPtr<JSONObject>& storageId, const String& key, const String& value) OVERRIDE;
virtual void removeDOMStorageItem(ErrorString*, const RefPtr<JSONObject>& storageId, const String& key) OVERRIDE;
void didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*);
private:
InspectorDOMStorageAgent(InspectorPageAgent*);
bool isEnabled() const;
PassOwnPtrWillBeRawPtr<StorageArea> findStorageArea(ErrorString*, const RefPtr<JSONObject>&, LocalFrame*&);
PassRefPtr<TypeBuilder::DOMStorage::StorageId> storageId(SecurityOrigin*, bool isLocalStorage);
InspectorPageAgent* m_pageAgent;
InspectorFrontend* m_frontend;
};
}
#endif