InspectorDatabaseAgent.h [plain text]
#ifndef InspectorDatabaseAgent_h
#define InspectorDatabaseAgent_h
#include "PlatformString.h"
#include <wtf/HashMap.h>
#include <wtf/PassOwnPtr.h>
namespace WebCore {
class Database;
class InspectorArray;
class InspectorDatabaseResource;
class InspectorFrontend;
class InspectorState;
class InstrumentingAgents;
typedef String ErrorString;
class InspectorDatabaseAgent {
public:
class FrontendProvider;
static PassOwnPtr<InspectorDatabaseAgent> create(InstrumentingAgents* instrumentingAgents, InspectorState* state)
{
return adoptPtr(new InspectorDatabaseAgent(instrumentingAgents, state));
}
~InspectorDatabaseAgent();
void setFrontend(InspectorFrontend*);
void clearFrontend();
void clearResources();
void restore();
void enable(ErrorString*);
void disable(ErrorString*);
void getDatabaseTableNames(ErrorString*, int databaseId, RefPtr<InspectorArray>* names);
void executeSQL(ErrorString*, int databaseId, const String& query, bool* success, int* transactionId);
int databaseId(Database*);
void didOpenDatabase(PassRefPtr<Database>, const String& domain, const String& name, const String& version);
private:
explicit InspectorDatabaseAgent(InstrumentingAgents*, InspectorState*);
Database* databaseForId(int databaseId);
InspectorDatabaseResource* findByFileName(const String& fileName);
InstrumentingAgents* m_instrumentingAgents;
InspectorState* m_inspectorState;
typedef HashMap<int, RefPtr<InspectorDatabaseResource> > DatabaseResourcesMap;
DatabaseResourcesMap m_resources;
RefPtr<FrontendProvider> m_frontendProvider;
bool m_enabled;
};
}
#endif // !defined(InspectorDatabaseAgent_h)