Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: Source/modules/webdatabase/DatabaseClient.cpp

Issue 147353007: DevTools: remove references to modules/webdatabase from core/inspector (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/webdatabase/DatabaseClient.h ('k') | Source/modules/webdatabase/DatabaseManager.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webdatabase/DatabaseClient.cpp
diff --git a/Source/modules/webdatabase/DatabaseClient.cpp b/Source/modules/webdatabase/DatabaseClient.cpp
index ef4c9e88d1831968493dcd2a785173a60fb1fca8..4f127a117fe52476b5f03e8fb8ce44203a8468aa 100644
--- a/Source/modules/webdatabase/DatabaseClient.cpp
+++ b/Source/modules/webdatabase/DatabaseClient.cpp
@@ -32,10 +32,17 @@
#include "DatabaseClient.h"
#include "core/dom/Document.h"
+#include "core/inspector/InspectorController.h"
#include "core/workers/WorkerGlobalScope.h"
+#include "modules/webdatabase/Database.h"
+#include "modules/webdatabase/InspectorDatabaseAgent.h"
namespace WebCore {
+DatabaseClient::DatabaseClient()
+ : m_inspectorAgent(0)
+{ }
+
DatabaseClient* DatabaseClient::from(ExecutionContext* context)
{
if (context->isDocument()) {
@@ -50,9 +57,25 @@ const char* DatabaseClient::supplementName()
return "DatabaseClient";
}
+void DatabaseClient::didOpenDatabase(PassRefPtr<Database> database, const String& domain, const String& name, const String& version)
+{
+ if (m_inspectorAgent)
+ m_inspectorAgent->didOpenDatabase(database, domain, name, version);
+}
+
+void DatabaseClient::createInspectorAgentFor(Page* page)
+{
+ ASSERT(!m_inspectorAgent);
+ OwnPtr<InspectorDatabaseAgent> inspectorAgent = InspectorDatabaseAgent::create();
+ m_inspectorAgent = inspectorAgent.get();
+ page->inspectorController().registerModuleAgent(inspectorAgent.release());
+}
+
void provideDatabaseClientTo(Page* page, PassOwnPtr<DatabaseClient> client)
{
+ DatabaseClient* clientPtr = client.get();
page->provideSupplement(DatabaseClient::supplementName(), client);
+ clientPtr->createInspectorAgentFor(page);
}
void provideDatabaseClientToWorker(WorkerClients* workerClients, PassOwnPtr<DatabaseClient> client)
« no previous file with comments | « Source/modules/webdatabase/DatabaseClient.h ('k') | Source/modules/webdatabase/DatabaseManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698