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

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: 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..afe335b3911b2b44b418337b8e3dfd81179d8b6c 100644
--- a/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp
+++ b/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp
@@ -29,12 +29,14 @@
#include "modules/webdatabase/InspectorDatabaseAgent.h"
#include "bindings/core/v8/ExceptionStatePlaceholder.h"
+#include "core/dom/Document.h"
#include "core/frame/LocalFrame.h"
#include "core/html/VoidCallback.h"
#include "core/loader/DocumentLoader.h"
#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"
@@ -219,6 +221,12 @@ private:
void InspectorDatabaseAgent::didOpenDatabase(blink::Database* database, const String& domain, const String& name, const String& version)
{
+ ExecutionContext* context = database->getExecutionContext();
+ if (!context->isDocument())
michaeln 2016/04/13 22:18:18 you could ASSERT(isDocument()) since websql is no
+ return;
+ if (toDocument(context)->frame()->page() != m_page)
michaeln 2016/04/13 22:18:18 oh, you filter for this page only
+ return;
+
if (InspectorDatabaseResource* resource = findByFileName(database->fileName())) {
resource->setDatabase(database);
return;
@@ -246,6 +254,7 @@ InspectorDatabaseAgent::InspectorDatabaseAgent(Page* page)
, m_enabled(false)
{
DatabaseClient::fromPage(page)->setInspectorAgent(this);
+ DatabaseTracker::tracker().registerAllDatabasesInInspector(this);
michaeln 2016/04/13 22:18:18 From the looks of the didCommitLoadForLocalFrame()
dgozman 2016/04/13 22:26:04 That's why I've added filtering to didOpenDatabase
}
InspectorDatabaseAgent::~InspectorDatabaseAgent()

Powered by Google App Engine
This is Rietveld 408576698