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

Unified Diff: third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp

Issue 1880273002: [DevTools] Create last agents on attach, modify InspectorDatabaseAgent to support it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: two databases in the test Created 4 years, 8 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
Index: third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp
diff --git a/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp b/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp
index 69ff657d1e883b53fbda75efd3337ccd340fc1a3..cf8cf300c734785e4ac1f56dceed78d67b79ff6c 100644
--- a/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp
+++ b/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp
@@ -35,6 +35,7 @@
#include "core/page/Page.h"
#include "modules/webdatabase/Database.h"
#include "modules/webdatabase/DatabaseClient.h"
+#include "modules/webdatabase/DatabaseTracker.h"
#include "modules/webdatabase/InspectorDatabaseResource.h"
#include "modules/webdatabase/SQLError.h"
#include "modules/webdatabase/SQLResultSet.h"
@@ -217,6 +218,11 @@ private:
} // namespace
+void InspectorDatabaseAgent::registerDatabaseOnCreation(blink::Database* database)
+{
+ didOpenDatabase(database, database->getSecurityOrigin()->host(), database->stringIdentifier(), database->version());
+}
+
void InspectorDatabaseAgent::didOpenDatabase(blink::Database* database, const String& domain, const String& name, const String& version)
{
if (InspectorDatabaseResource* resource = findByFileName(database->fileName())) {
@@ -246,6 +252,7 @@ InspectorDatabaseAgent::InspectorDatabaseAgent(Page* page)
, m_enabled(false)
{
DatabaseClient::fromPage(page)->setInspectorAgent(this);
+ DatabaseTracker::tracker().forEachOpenDatabaseInPage(m_page, bind<blink::Database*>(&InspectorDatabaseAgent::registerDatabaseOnCreation, this));
}
InspectorDatabaseAgent::~InspectorDatabaseAgent()

Powered by Google App Engine
This is Rietveld 408576698