summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/Modules')
-rw-r--r--Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp13
-rw-r--r--Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h2
-rw-r--r--Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.idl3
-rw-r--r--Source/WebCore/Modules/webdatabase/DatabaseContext.cpp4
4 files changed, 18 insertions, 4 deletions
diff --git a/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp b/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp
index f5bc6a8c3..9272dfc98 100644
--- a/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp
+++ b/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp
@@ -35,6 +35,10 @@
#include "Page.h"
#include "SecurityOrigin.h"
+#if PLATFORM(QT)
+#include "Settings.h"
+#endif
+
namespace WebCore {
DOMWindowIndexedDatabase::DOMWindowIndexedDatabase(DOMWindow* window)
@@ -93,9 +97,9 @@ void DOMWindowIndexedDatabase::willDetachGlobalObjectFromFrame()
DOMWindowProperty::willDetachGlobalObjectFromFrame();
}
-IDBFactory* DOMWindowIndexedDatabase::indexedDB(DOMWindow* window)
+IDBFactory* DOMWindowIndexedDatabase::indexedDB(DOMWindow& window)
{
- return from(window)->indexedDB();
+ return from(&window)->indexedDB();
}
IDBFactory* DOMWindowIndexedDatabase::indexedDB()
@@ -108,6 +112,11 @@ IDBFactory* DOMWindowIndexedDatabase::indexedDB()
if (!page)
return nullptr;
+#if PLATFORM(QT)
+ if (!page->settings().offlineStorageDatabaseEnabled())
+ return nullptr;
+#endif
+
if (!m_window->isCurrentlyDisplayedInFrame())
return nullptr;
diff --git a/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h b/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h
index 3ffb71c5c..7f3c193a9 100644
--- a/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h
+++ b/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h
@@ -44,7 +44,7 @@ public:
static DOMWindowIndexedDatabase* from(DOMWindow*);
- static IDBFactory* indexedDB(DOMWindow*);
+ static IDBFactory* indexedDB(DOMWindow&);
virtual void disconnectFrameForDocumentSuspension() override;
virtual void reconnectFrameFromDocumentSuspension(Frame*) override;
diff --git a/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.idl b/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.idl
index d1b02038f..72b7b2750 100644
--- a/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.idl
+++ b/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.idl
@@ -27,6 +27,7 @@
[
Conditional=INDEXED_DATABASE,
] partial interface DOMWindow {
- // This space is intentionally left blank.
+ [EnabledAtRuntime=IndexedDB] readonly attribute IDBFactory indexedDB;
+ [EnabledAtRuntime=IndexedDB, ImplementedAs=indexedDB] readonly attribute IDBFactory webkitIndexedDB;
};
diff --git a/Source/WebCore/Modules/webdatabase/DatabaseContext.cpp b/Source/WebCore/Modules/webdatabase/DatabaseContext.cpp
index 42be91b15..8f3ff3665 100644
--- a/Source/WebCore/Modules/webdatabase/DatabaseContext.cpp
+++ b/Source/WebCore/Modules/webdatabase/DatabaseContext.cpp
@@ -198,6 +198,10 @@ bool DatabaseContext::allowDatabaseAccess() const
{
if (is<Document>(*m_scriptExecutionContext)) {
Document& document = downcast<Document>(*m_scriptExecutionContext);
+#if PLATFORM(QT)
+ if (document.page() && !document.page()->settings().offlineStorageDatabaseEnabled())
+ return false;
+#endif
if (!document.page() || (document.page()->usesEphemeralSession() && !SchemeRegistry::allowsDatabaseAccessInPrivateBrowsing(document.securityOrigin()->protocol())))
return false;
return true;