Chromium Code Reviews| 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() |