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

Unified Diff: third_party/WebKit/Source/modules/webdatabase/DatabaseTracker.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: 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/DatabaseTracker.cpp
diff --git a/third_party/WebKit/Source/modules/webdatabase/DatabaseTracker.cpp b/third_party/WebKit/Source/modules/webdatabase/DatabaseTracker.cpp
index 434a9c5e9cb03bf7e777a24367a39a585e4a079c..b5781883a54012878b0c3784dcc21603379c68e8 100644
--- a/third_party/WebKit/Source/modules/webdatabase/DatabaseTracker.cpp
+++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseTracker.cpp
@@ -35,6 +35,7 @@
#include "modules/webdatabase/Database.h"
#include "modules/webdatabase/DatabaseClient.h"
#include "modules/webdatabase/DatabaseContext.h"
+#include "modules/webdatabase/InspectorDatabaseAgent.h"
#include "modules/webdatabase/QuotaTracker.h"
#include "modules/webdatabase/sqlite/SQLiteFileSystem.h"
#include "platform/weborigin/SecurityOrigin.h"
@@ -209,6 +210,20 @@ void DatabaseTracker::closeDatabasesImmediately(SecurityOrigin* origin, const St
(*it)->getDatabaseContext()->getExecutionContext()->postTask(BLINK_FROM_HERE, CloseOneDatabaseImmediatelyTask::create(originString, name, *it));
}
+void DatabaseTracker::registerAllDatabasesInInspector(InspectorDatabaseAgent* agent)
+{
+ MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
+ if (!m_openDatabaseMap)
+ return;
+ for (auto& originMap : *m_openDatabaseMap) {
+ for (auto& nameDatabaseSet : *originMap.value) {
+ for (Database* database : *nameDatabaseSet.value) {
+ agent->didOpenDatabase(database, database->getSecurityOrigin()->host(), database->displayName(), database->version());
+ }
+ }
+ }
+}
+
void DatabaseTracker::closeOneDatabaseImmediately(const String& originString, const String& name, Database* database)
{
// First we have to confirm the 'database' is still in our collection.

Powered by Google App Engine
This is Rietveld 408576698