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

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

Issue 2786673002: Separate ContentSettingsClient out from LocalFrameClient (Closed)
Patch Set: fix Created 3 years, 9 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/DatabaseClient.cpp
diff --git a/third_party/WebKit/Source/modules/webdatabase/DatabaseClient.cpp b/third_party/WebKit/Source/modules/webdatabase/DatabaseClient.cpp
index 19719bb4ff904291123dddb35362a554894a69be..242e6d58024d6dc43094a0010ee0bab1d77b8504 100644
--- a/third_party/WebKit/Source/modules/webdatabase/DatabaseClient.cpp
+++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseClient.cpp
@@ -31,6 +31,8 @@
#include "modules/webdatabase/DatabaseClient.h"
#include "core/dom/Document.h"
+#include "core/frame/ContentSettingsClient.h"
+#include "core/frame/LocalFrame.h"
#include "core/page/Page.h"
#include "modules/webdatabase/Database.h"
#include "modules/webdatabase/InspectorDatabaseAgent.h"
@@ -57,6 +59,19 @@ const char* DatabaseClient::supplementName() {
return "DatabaseClient";
}
+bool DatabaseClient::allowDatabase(ExecutionContext* context,
+ const String& name,
+ const String& displayName,
+ unsigned estimatedSize) {
+ DCHECK(context->isContextThread());
+ Document* document = toDocument(context);
+ if (document->frame()->contentSettingsClient()) {
dcheng 2017/04/02 05:26:19 Do we need to null-check that frame is not null?
kinuko 2017/04/03 15:15:06 I think we do, done.
dcheng 2017/04/03 19:28:23 Btw, I didn't trace this back far enough: the only
kinuko 2017/04/04 03:26:23 Thanks for looking! I turned this into DCHECK.
+ return document->frame()->contentSettingsClient()->allowDatabase(
+ name, displayName, estimatedSize);
+ }
+ return true;
+}
kinuko 2017/03/31 16:13:12 Moved the impl from DatabaseClientImpl and removed
+
void DatabaseClient::didOpenDatabase(blink::Database* database,
const String& domain,
const String& name,

Powered by Google App Engine
This is Rietveld 408576698