Commit 64f5d3a7 authored by loislo@chromium.org's avatar loislo@chromium.org
Browse files

2011-02-16 Ilya Tikhonovsky <loislo@chromium.org>

        Reviewed by Yury Semikhatsky.

        Web Inspector: move Database and DOMStorage related things from InspectorAgent to the corresponding agents.

        https://bugs.webkit.org/show_bug.cgi?id=54455

        Some set of instrumentation calls should work even if we have no InspectorFrontend instance and corresponding agents.
        At the moment we are using InspectorAgent instance for such calls.

        * inspector/InspectorAgent.cpp:
        (WebCore::InspectorAgent::InspectorAgent):
        (WebCore::InspectorAgent::createFrontendLifetimeAgents):
        (WebCore::InspectorAgent::pushDataCollectedOffline):
        (WebCore::InspectorAgent::didCommitLoad):
        * inspector/InspectorAgent.h:
        (WebCore::InspectorOfflineResourcesBase::~InspectorOfflineResourcesBase):
        (WebCore::InspectorOfflineResourcesBase::InspectorOfflineResourcesBase):
        (WebCore::InspectorAgent::databaseAgentResources):
        (WebCore::InspectorAgent::domStorageAgentResources):
        * inspector/InspectorDOMStorageAgent.cpp:
        (WebCore::InspectorDOMStorageAgent::Resources::clear):
        (WebCore::InspectorDOMStorageAgent::Resources::pushDataCollectedOffline):
        (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
        (WebCore::InspectorDOMStorageAgent::~InspectorDOMStorageAgent):
        (WebCore::InspectorDOMStorageAgent::createOfflineStorage):
        (WebCore::InspectorDOMStorageAgent::selectDOMStorage):
        (WebCore::InspectorDOMStorageAgent::getDOMStorageResourceForId):
        (WebCore::InspectorDOMStorageAgent::didUseDOMStorage):
        * inspector/InspectorDOMStorageAgent.h:
        (WebCore::InspectorDOMStorageAgent::create):
        * inspector/InspectorDatabaseAgent.cpp:
        (WebCore::InspectorDatabaseAgent::Resources::clear):
        (WebCore::InspectorDatabaseAgent::Resources::pushDataCollectedOffline):
        (WebCore::InspectorDatabaseAgent::didOpenDatabase):
        (WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
        (WebCore::InspectorDatabaseAgent::createOfflineStorage):
        (WebCore::InspectorDatabaseAgent::databaseForId):
        (WebCore::InspectorDatabaseAgent::selectDatabase):
        * inspector/InspectorDatabaseAgent.h:
        (WebCore::InspectorDatabaseAgent::create):
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didOpenDatabaseImpl):
        (WebCore::InspectorInstrumentation::didUseDOMStorageImpl):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78692 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b4232b23
2011-02-16 Ilya Tikhonovsky <loislo@chromium.org>
Reviewed by Yury Semikhatsky.
Web Inspector: move Database and DOMStorage related things from InspectorAgent to the corresponding agents.
https://bugs.webkit.org/show_bug.cgi?id=54455
Some set of instrumentation calls should work even if we have no InspectorFrontend instance and corresponding agents.
At the moment we are using InspectorAgent instance for such calls.
* inspector/InspectorAgent.cpp:
(WebCore::InspectorAgent::InspectorAgent):
(WebCore::InspectorAgent::createFrontendLifetimeAgents):
(WebCore::InspectorAgent::pushDataCollectedOffline):
(WebCore::InspectorAgent::didCommitLoad):
* inspector/InspectorAgent.h:
(WebCore::InspectorOfflineResourcesBase::~InspectorOfflineResourcesBase):
(WebCore::InspectorOfflineResourcesBase::InspectorOfflineResourcesBase):
(WebCore::InspectorAgent::databaseAgentResources):
(WebCore::InspectorAgent::domStorageAgentResources):
* inspector/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::Resources::clear):
(WebCore::InspectorDOMStorageAgent::Resources::pushDataCollectedOffline):
(WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
(WebCore::InspectorDOMStorageAgent::~InspectorDOMStorageAgent):
(WebCore::InspectorDOMStorageAgent::createOfflineStorage):
(WebCore::InspectorDOMStorageAgent::selectDOMStorage):
(WebCore::InspectorDOMStorageAgent::getDOMStorageResourceForId):
(WebCore::InspectorDOMStorageAgent::didUseDOMStorage):
* inspector/InspectorDOMStorageAgent.h:
(WebCore::InspectorDOMStorageAgent::create):
* inspector/InspectorDatabaseAgent.cpp:
(WebCore::InspectorDatabaseAgent::Resources::clear):
(WebCore::InspectorDatabaseAgent::Resources::pushDataCollectedOffline):
(WebCore::InspectorDatabaseAgent::didOpenDatabase):
(WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
(WebCore::InspectorDatabaseAgent::createOfflineStorage):
(WebCore::InspectorDatabaseAgent::databaseForId):
(WebCore::InspectorDatabaseAgent::selectDatabase):
* inspector/InspectorDatabaseAgent.h:
(WebCore::InspectorDatabaseAgent::create):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didOpenDatabaseImpl):
(WebCore::InspectorInstrumentation::didUseDOMStorageImpl):
2011-02-15 John Sullivan <sullivan@apple.com>
 
Reviewed by Antti Koivisto.
......@@ -106,14 +106,11 @@
#include <wtf/text/StringConcatenate.h>
#if ENABLE(DATABASE)
#include "Database.h"
#include "InspectorDatabaseAgent.h"
#endif
#if ENABLE(DOM_STORAGE)
#include "InspectorDOMStorageAgent.h"
#include "Storage.h"
#include "StorageArea.h"
#endif
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
......@@ -141,6 +138,12 @@ InspectorAgent::InspectorAgent(Page* page, InspectorClient* client)
, m_client(client)
, m_frontend(0)
, m_cssAgent(new InspectorCSSAgent())
#if ENABLE(DATABASE)
, m_databaseAgentResources(InspectorDatabaseAgent::createStorage())
#endif
#if ENABLE(DOM_STORAGE)
, m_domStorageAgentResources(InspectorDOMStorageAgent::createStorage())
#endif
, m_state(new InspectorState(client))
, m_injectedScriptHost(InjectedScriptHost::create(this))
, m_consoleAgent(new InspectorConsoleAgent(this))
......@@ -387,11 +390,11 @@ void InspectorAgent::createFrontendLifetimeAgents()
m_runtimeAgent = InspectorRuntimeAgent::create(m_injectedScriptHost.get());
#if ENABLE(DATABASE)
m_databaseAgent = InspectorDatabaseAgent::create(&m_databaseResources, m_frontend);
m_databaseAgent = InspectorDatabaseAgent::create(databaseAgentResources(), m_frontend);
#endif
#if ENABLE(DOM_STORAGE)
m_domStorageAgent = InspectorDOMStorageAgent::create(&m_domStorageResources, m_frontend);
m_domStorageAgent = InspectorDOMStorageAgent::create(domStorageAgentResources(), m_frontend);
#endif
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
......@@ -456,16 +459,6 @@ void InspectorAgent::pushDataCollectedOffline()
{
m_domAgent->setDocument(m_inspectedPage->mainFrame()->document());
#if ENABLE(DATABASE)
DatabaseResourcesMap::iterator databasesEnd = m_databaseResources.end();
for (DatabaseResourcesMap::iterator it = m_databaseResources.begin(); it != databasesEnd; ++it)
it->second->bind(m_frontend);
#endif
#if ENABLE(DOM_STORAGE)
DOMStorageResourcesMap::iterator domStorageEnd = m_domStorageResources.end();
for (DOMStorageResourcesMap::iterator it = m_domStorageResources.begin(); it != domStorageEnd; ++it)
it->second->bind(m_frontend);
#endif
#if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(WORKERS)
WorkersMap::iterator workersEnd = m_workers.end();
for (WorkersMap::iterator it = m_workers.begin(); it != workersEnd; ++it) {
......@@ -544,10 +537,10 @@ void InspectorAgent::didCommitLoad(DocumentLoader* loader)
m_workers.clear();
#endif
#if ENABLE(DATABASE)
m_databaseResources.clear();
InspectorDatabaseAgent::clear(this);
#endif
#if ENABLE(DOM_STORAGE)
m_domStorageResources.clear();
InspectorDOMStorageAgent::clear(this);
#endif
if (m_frontend)
......@@ -683,22 +676,6 @@ void InspectorAgent::didDestroyWorker(intptr_t id)
}
#endif // ENABLE(WORKERS)
#if ENABLE(DATABASE)
void InspectorAgent::didOpenDatabase(PassRefPtr<Database> database, const String& domain, const String& name, const String& version)
{
if (!enabled())
return;
RefPtr<InspectorDatabaseResource> resource = InspectorDatabaseResource::create(database, domain, name, version);
m_databaseResources.set(resource->id(), resource);
// Resources are only bound while visible.
if (m_frontend)
resource->bind(m_frontend);
}
#endif
void InspectorAgent::getCookies(RefPtr<InspectorArray>* cookies, WTF::String* cookiesString)
{
// If we can get raw cookies.
......@@ -783,28 +760,6 @@ void InspectorAgent::deleteCookie(const String& cookieName, const String& domain
}
}
#if ENABLE(DOM_STORAGE)
void InspectorAgent::didUseDOMStorage(StorageArea* storageArea, bool isLocalStorage, Frame* frame)
{
if (!enabled())
return;
DOMStorageResourcesMap::iterator domStorageEnd = m_domStorageResources.end();
for (DOMStorageResourcesMap::iterator it = m_domStorageResources.begin(); it != domStorageEnd; ++it)
if (it->second->isSameHostAndType(frame, isLocalStorage))
return;
RefPtr<Storage> domStorage = Storage::create(frame, storageArea);
RefPtr<InspectorDOMStorageResource> resource = InspectorDOMStorageResource::create(domStorage.get(), isLocalStorage, frame);
m_domStorageResources.set(resource->id(), resource);
// Resources are only bound while visible.
if (m_frontend)
resource->bind(m_frontend);
}
#endif
#if ENABLE(WEB_SOCKETS)
void InspectorAgent::didCreateWebSocket(unsigned long identifier, const KURL& requestURL, const KURL& documentURL)
{
......
......@@ -99,6 +99,15 @@ class WebSocketHandshakeRequest;
class WebSocketHandshakeResponse;
#endif
class InspectorOfflineResourcesBase {
WTF_MAKE_NONCOPYABLE(InspectorOfflineResourcesBase);
public:
virtual ~InspectorOfflineResourcesBase() {}
protected:
InspectorOfflineResourcesBase() {}
};
class InspectorAgent {
WTF_MAKE_NONCOPYABLE(InspectorAgent);
WTF_MAKE_FAST_ALLOCATED;
......@@ -145,9 +154,11 @@ public:
InspectorTimelineAgent* timelineAgent() { return m_timelineAgent.get(); }
#if ENABLE(DATABASE)
InspectorDatabaseAgent* databaseAgent() { return m_databaseAgent.get(); }
InspectorOfflineResourcesBase* databaseAgentResources() { return m_databaseAgentResources.get(); }
#endif
#if ENABLE(DOM_STORAGE)
InspectorDOMStorageAgent* domStorageAgent() { return m_domStorageAgent.get(); }
InspectorOfflineResourcesBase* domStorageAgentResources() { return m_domStorageAgentResources.get(); }
#endif
#if ENABLE(JAVASCRIPT_DEBUGGER)
InspectorBrowserDebuggerAgent* browserDebuggerAgent() const { return m_browserDebuggerAgent.get(); }
......@@ -183,14 +194,6 @@ public:
void didDestroyWorker(intptr_t);
#endif
#if ENABLE(DATABASE)
void didOpenDatabase(PassRefPtr<Database>, const String& domain, const String& name, const String& version);
#endif
#if ENABLE(DOM_STORAGE)
void didUseDOMStorage(StorageArea*, bool isLocalStorage, Frame*);
#endif
#if ENABLE(WEB_SOCKETS)
void didCreateWebSocket(unsigned long identifier, const KURL& requestURL, const KURL& documentURL);
void willSendWebSocketHandshakeRequest(unsigned long identifier, const WebSocketHandshakeRequest&);
......@@ -275,10 +278,12 @@ private:
#if ENABLE(DATABASE)
OwnPtr<InspectorDatabaseAgent> m_databaseAgent;
OwnPtr<InspectorOfflineResourcesBase> m_databaseAgentResources;
#endif
#if ENABLE(DOM_STORAGE)
OwnPtr<InspectorDOMStorageAgent> m_domStorageAgent;
OwnPtr<InspectorOfflineResourcesBase> m_domStorageAgentResources;
#endif
OwnPtr<InspectorTimelineAgent> m_timelineAgent;
......@@ -293,15 +298,6 @@ private:
RefPtr<InspectorResourceAgent> m_resourceAgent;
OwnPtr<InspectorRuntimeAgent> m_runtimeAgent;
#if ENABLE(DATABASE)
typedef HashMap<int, RefPtr<InspectorDatabaseResource> > DatabaseResourcesMap;
DatabaseResourcesMap m_databaseResources;
#endif
#if ENABLE(DOM_STORAGE)
typedef HashMap<int, RefPtr<InspectorDOMStorageResource> > DOMStorageResourcesMap;
DOMStorageResourcesMap m_domStorageResources;
#endif
RefPtr<InjectedScriptHost> m_injectedScriptHost;
OwnPtr<InspectorConsoleAgent> m_consoleAgent;
......
......@@ -36,23 +36,47 @@
#include "DOMWindow.h"
#include "ExceptionCode.h"
#include "Frame.h"
#include "InspectorAgent.h"
#include "InspectorDOMStorageResource.h"
#include "InspectorFrontend.h"
#include "InspectorValues.h"
#include "Storage.h"
#include "StorageArea.h"
#include "VoidCallback.h"
#include <wtf/Vector.h>
namespace WebCore {
typedef HashMap<int, RefPtr<InspectorDOMStorageResource> > DOMStorageResourcesMap;
class InspectorDOMStorageAgent::Resources : public InspectorOfflineResourcesBase {
public:
DOMStorageResourcesMap m_map;
};
InspectorDOMStorageAgent::InspectorDOMStorageAgent(InspectorOfflineResourcesBase* domStorageAgentResources, InspectorFrontend* frontend)
: m_resources(static_cast<InspectorDOMStorageAgent::Resources*>(domStorageAgentResources))
, m_frontend(frontend)
{
ASSERT(domStorageAgentResources);
DOMStorageResourcesMap::iterator resourcesEnd = m_resources->m_map.end();
for (DOMStorageResourcesMap::iterator it = m_resources->m_map.begin(); it != resourcesEnd; ++it)
it->second->bind(m_frontend);
}
InspectorDOMStorageAgent::~InspectorDOMStorageAgent()
{
DOMStorageResourcesMap::iterator domStorageEnd = m_domStorageResources->end();
for (DOMStorageResourcesMap::iterator it = m_domStorageResources->begin(); it != domStorageEnd; ++it)
DOMStorageResourcesMap::iterator domStorageEnd = m_resources->m_map.end();
for (DOMStorageResourcesMap::iterator it = m_resources->m_map.begin(); it != domStorageEnd; ++it)
it->second->unbind();
}
PassOwnPtr<InspectorOfflineResourcesBase> InspectorDOMStorageAgent::createStorage()
{
return adoptPtr(new Resources());
}
void InspectorDOMStorageAgent::getDOMStorageEntries(long storageId, RefPtr<InspectorArray>* entries)
{
InspectorDOMStorageResource* storageResource = getDOMStorageResourceForId(storageId);
......@@ -99,8 +123,8 @@ void InspectorDOMStorageAgent::selectDOMStorage(Storage* storage)
ExceptionCode ec = 0;
bool isLocalStorage = (frame->domWindow()->localStorage(ec) == storage && !ec);
long storageResourceId = 0;
DOMStorageResourcesMap::iterator domStorageEnd = m_domStorageResources->end();
for (DOMStorageResourcesMap::iterator it = m_domStorageResources->begin(); it != domStorageEnd; ++it) {
DOMStorageResourcesMap::iterator domStorageEnd = m_resources->m_map.end();
for (DOMStorageResourcesMap::iterator it = m_resources->m_map.begin(); it != domStorageEnd; ++it) {
if (it->second->isSameHostAndType(frame, isLocalStorage)) {
storageResourceId = it->first;
break;
......@@ -110,20 +134,41 @@ void InspectorDOMStorageAgent::selectDOMStorage(Storage* storage)
m_frontend->selectDOMStorage(storageResourceId);
}
InspectorDOMStorageAgent::InspectorDOMStorageAgent(DOMStorageResourcesMap* domStorageResources, InspectorFrontend* frontend)
: m_domStorageResources(domStorageResources)
, m_frontend(frontend)
{
}
InspectorDOMStorageResource* InspectorDOMStorageAgent::getDOMStorageResourceForId(long storageId)
{
DOMStorageResourcesMap::iterator it = m_domStorageResources->find(storageId);
if (it == m_domStorageResources->end())
DOMStorageResourcesMap::iterator it = m_resources->m_map.find(storageId);
if (it == m_resources->m_map.end())
return 0;
return it->second.get();
}
void InspectorDOMStorageAgent::didUseDOMStorage(InspectorAgent* inspectorAgent, StorageArea* storageArea, bool isLocalStorage, Frame* frame)
{
if (!inspectorAgent->enabled())
return;
Resources* resources = static_cast<Resources*>(inspectorAgent->domStorageAgentResources());
DOMStorageResourcesMap::iterator domStorageEnd = resources->m_map.end();
for (DOMStorageResourcesMap::iterator it = resources->m_map.begin(); it != domStorageEnd; ++it)
if (it->second->isSameHostAndType(frame, isLocalStorage))
return;
RefPtr<Storage> domStorage = Storage::create(frame, storageArea);
RefPtr<InspectorDOMStorageResource> resource = InspectorDOMStorageResource::create(domStorage.get(), isLocalStorage, frame);
resources->m_map.set(resource->id(), resource);
// Resources are only bound while visible.
if (inspectorAgent->frontend())
resource->bind(inspectorAgent->frontend());
}
void InspectorDOMStorageAgent::clear(InspectorAgent* inspectorAgent)
{
static_cast<Resources*>(inspectorAgent->domStorageAgentResources())->m_map.clear();
}
} // namespace WebCore
#endif // ENABLE(INSPECTOR) && ENABLE(DOM_STORE)
......@@ -35,20 +35,27 @@
namespace WebCore {
class Frame;
class InspectorAgent;
class InspectorArray;
class InspectorDOMStorageResource;
class InspectorFrontend;
class InspectorOfflineResourcesBase;
class Storage;
class StorageArea;
class InspectorDOMStorageAgent {
public:
typedef HashMap<int, RefPtr<InspectorDOMStorageResource> > DOMStorageResourcesMap;
class Resources;
static PassOwnPtr<InspectorDOMStorageAgent> create(DOMStorageResourcesMap* domStorageResources, InspectorFrontend* frontend)
static PassOwnPtr<InspectorDOMStorageAgent> create(InspectorOfflineResourcesBase* domStorageResources, InspectorFrontend* frontend)
{
return adoptPtr(new InspectorDOMStorageAgent(domStorageResources, frontend));
}
static PassOwnPtr<InspectorOfflineResourcesBase> createStorage();
static void clear(InspectorAgent*);
virtual ~InspectorDOMStorageAgent();
// Called from the front-end.
......@@ -59,12 +66,15 @@ public:
// Called from the injected script.
void selectDOMStorage(Storage* storage);
// Called from InspectorInstrumentation
static void didUseDOMStorage(InspectorAgent*, StorageArea*, bool isLocalStorage, Frame*);
private:
InspectorDOMStorageAgent(DOMStorageResourcesMap*, InspectorFrontend*);
InspectorDOMStorageAgent(InspectorOfflineResourcesBase*, InspectorFrontend*);
InspectorDOMStorageResource* getDOMStorageResourceForId(long storageId);
DOMStorageResourcesMap* m_domStorageResources;
Resources* m_resources;
InspectorFrontend* m_frontend;
};
......
......@@ -218,11 +218,55 @@ private:
} // namespace
typedef HashMap<int, RefPtr<InspectorDatabaseResource> > DatabaseResourcesMap;
class InspectorDatabaseAgent::Resources : public InspectorOfflineResourcesBase {
public:
DatabaseResourcesMap m_map;
};
void InspectorDatabaseAgent::didOpenDatabase(InspectorAgent* inspectorAgent, PassRefPtr<Database> database, const String& domain, const String& name, const String& version)
{
if (!inspectorAgent->enabled())
return;
RefPtr<InspectorDatabaseResource> resource = InspectorDatabaseResource::create(database, domain, name, version);
Resources* resources = static_cast<Resources*>(inspectorAgent->databaseAgentResources());
ASSERT(resources);
resources->m_map.set(resource->id(), resource);
// Resources are only bound while visible.
if (InspectorFrontend* frontend = inspectorAgent->frontend())
resource->bind(frontend);
}
void InspectorDatabaseAgent::clear(InspectorAgent* inspectorAgent)
{
static_cast<Resources*>(inspectorAgent->databaseAgentResources())->m_map.clear();
}
InspectorDatabaseAgent::InspectorDatabaseAgent(InspectorOfflineResourcesBase* resources, InspectorFrontend* frontend)
: m_resources(static_cast<Resources*>(resources))
, m_frontendProvider(FrontendProvider::create(frontend))
{
ASSERT(resources);
DatabaseResourcesMap::iterator databasesEnd = m_resources->m_map.end();
for (DatabaseResourcesMap::iterator it = m_resources->m_map.begin(); it != databasesEnd; ++it)
it->second->bind(m_frontendProvider->frontend());
}
InspectorDatabaseAgent::~InspectorDatabaseAgent()
{
m_frontendProvider->clearFrontend();
}
PassOwnPtr<InspectorOfflineResourcesBase> InspectorDatabaseAgent::createStorage()
{
return adoptPtr(new Resources());
}
void InspectorDatabaseAgent::getDatabaseTableNames(long databaseId, RefPtr<InspectorArray>* names)
{
Database* database = databaseForId(databaseId);
......@@ -252,8 +296,8 @@ void InspectorDatabaseAgent::executeSQL(long databaseId, const String& query, bo
Database* InspectorDatabaseAgent::databaseForId(long databaseId)
{
DatabaseResourcesMap::iterator it = m_databaseResources->find(databaseId);
if (it == m_databaseResources->end())
DatabaseResourcesMap::iterator it = m_resources->m_map.find(databaseId);
if (it == m_resources->m_map.end())
return 0;
return it->second->database();
}
......@@ -263,7 +307,7 @@ void InspectorDatabaseAgent::selectDatabase(Database* database)
if (!m_frontendProvider->frontend())
return;
for (DatabaseResourcesMap::iterator it = m_databaseResources->begin(); it != m_databaseResources->end(); ++it) {
for (DatabaseResourcesMap::iterator it = m_resources->m_map.begin(); it != m_resources->m_map.end(); ++it) {
if (it->second->database() == database) {
m_frontendProvider->frontend()->selectDatabase(it->first);
break;
......@@ -271,12 +315,6 @@ void InspectorDatabaseAgent::selectDatabase(Database* database)
}
}
InspectorDatabaseAgent::InspectorDatabaseAgent(DatabaseResourcesMap* databaseResources, InspectorFrontend* frontend)
: m_databaseResources(databaseResources)
, m_frontendProvider(FrontendProvider::create(frontend))
{
}
} // namespace WebCore
#endif // ENABLE(INSPECTOR) && ENABLE(DATABASE)
......@@ -36,21 +36,24 @@
namespace WebCore {
class Database;
class InspectorAgent;
class InspectorArray;
class InspectorDatabaseResource;
class InspectorFrontend;
class InspectorOfflineResourcesBase;
class InspectorDatabaseAgent {
public:
class FrontendProvider;
class Resources;
typedef HashMap<int, RefPtr<InspectorDatabaseResource> > DatabaseResourcesMap;
static PassOwnPtr<InspectorDatabaseAgent> create(DatabaseResourcesMap* databaseResources, InspectorFrontend* frontend)
static PassOwnPtr<InspectorDatabaseAgent> create(InspectorOfflineResourcesBase* storage, InspectorFrontend* frontend)
{
return adoptPtr(new InspectorDatabaseAgent(databaseResources, frontend));
return adoptPtr(new InspectorDatabaseAgent(storage, frontend));
}
static PassOwnPtr<InspectorOfflineResourcesBase> createStorage();
static void clear(InspectorAgent*);
virtual ~InspectorDatabaseAgent();
// Called from the front-end.
......@@ -61,10 +64,11 @@ public:
Database* databaseForId(long databaseId);
void selectDatabase(Database* database);
static void didOpenDatabase(InspectorAgent*, PassRefPtr<Database>, const String& domain, const String& name, const String& version);
private:
InspectorDatabaseAgent(DatabaseResourcesMap*, InspectorFrontend*);
InspectorDatabaseAgent(InspectorOfflineResourcesBase*, InspectorFrontend*);
DatabaseResourcesMap* m_databaseResources;
Resources* m_resources;
RefPtr<FrontendProvider> m_frontendProvider;
};
......
......@@ -42,7 +42,9 @@
#include "InspectorApplicationCacheAgent.h"
#include "InspectorBrowserDebuggerAgent.h"
#include "InspectorConsoleAgent.h"
#include "InspectorDatabaseAgent.h"
#include "InspectorDOMAgent.h"
#include "InspectorDOMStorageAgent.h"
#include "InspectorDebuggerAgent.h"
#include "InspectorProfilerAgent.h"
#include "InspectorResourceAgent.h"
......@@ -585,14 +587,14 @@ bool InspectorInstrumentation::profilerEnabledImpl(InspectorAgent* inspectorAgen
#if ENABLE(DATABASE)
void InspectorInstrumentation::didOpenDatabaseImpl(InspectorAgent* inspectorAgent, PassRefPtr<Database> database, const String& domain, const String& name, const String& version)
{
inspectorAgent->didOpenDatabase(database, domain, name, version);
InspectorDatabaseAgent::didOpenDatabase(inspectorAgent, database, domain, name, version);
}
#endif
#if ENABLE(DOM_STORAGE)
void InspectorInstrumentation::didUseDOMStorageImpl(InspectorAgent* inspectorAgent, StorageArea* storageArea, bool isLocalStorage, Frame* frame)
{
inspectorAgent->didUseDOMStorage(storageArea, isLocalStorage, frame);
InspectorDOMStorageAgent::didUseDOMStorage(inspectorAgent, storageArea, isLocalStorage, frame);
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment