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

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

Issue 2786673002: Separate ContentSettingsClient out from LocalFrameClient (Closed)
Patch Set: added class-level comment Created 3 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/DatabaseClient.cpp
diff --git a/third_party/WebKit/Source/modules/webdatabase/DatabaseClient.cpp b/third_party/WebKit/Source/modules/webdatabase/DatabaseClient.cpp
index 19719bb4ff904291123dddb35362a554894a69be..375541c8c382404faa3b57af1d4eb979a93b1743 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,20 @@ 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);
+ DCHECK(document->frame());
+ if (document->frame()->contentSettingsClient()) {
+ return document->frame()->contentSettingsClient()->allowDatabase(
+ name, displayName, estimatedSize);
+ }
+ return true;
+}
+
void DatabaseClient::didOpenDatabase(blink::Database* database,
const String& domain,
const String& name,
« no previous file with comments | « third_party/WebKit/Source/modules/webdatabase/DatabaseClient.h ('k') | third_party/WebKit/Source/web/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698