InspectorDOMStorageAgent.h [plain text]
#ifndef InspectorDOMStorageAgent_h
#define InspectorDOMStorageAgent_h
#include "PlatformString.h"
#include <wtf/HashMap.h>
#include <wtf/PassOwnPtr.h>
namespace WebCore {
class Frame;
class InspectorArray;
class InspectorDOMStorageResource;
class InspectorFrontend;
class InspectorState;
class InstrumentingAgents;
class Storage;
class StorageArea;
typedef String ErrorString;
class InspectorDOMStorageAgent {
public:
static PassOwnPtr<InspectorDOMStorageAgent> create(InstrumentingAgents* instrumentingAgents, InspectorState* state)
{
return adoptPtr(new InspectorDOMStorageAgent(instrumentingAgents, state));
}
~InspectorDOMStorageAgent();
void setFrontend(InspectorFrontend*);
void clearFrontend();
void clearResources();
void restore();
void enable(ErrorString*);
void disable(ErrorString*);
void getDOMStorageEntries(ErrorString*, int storageId, RefPtr<InspectorArray>* entries);
void setDOMStorageItem(ErrorString*, int storageId, const String& key, const String& value, bool* success);
void removeDOMStorageItem(ErrorString*, int storageId, const String& key, bool* success);
int storageId(Storage*);
void didUseDOMStorage(StorageArea*, bool isLocalStorage, Frame*);
private:
InspectorDOMStorageAgent(InstrumentingAgents*, InspectorState*);
InspectorDOMStorageResource* getDOMStorageResourceForId(int storageId);
InstrumentingAgents* m_instrumentingAgents;
InspectorState* m_inspectorState;
typedef HashMap<int, RefPtr<InspectorDOMStorageResource> > DOMStorageResourcesMap;
DOMStorageResourcesMap m_resources;
InspectorFrontend* m_frontend;
bool m_enabled;
};
}
#endif // !defined(InspectorDOMStorageAgent_h)