summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/WebCore/Target.pri1
-rw-r--r--Source/WebCore/platform/leveldb/LevelDBDatabase.cpp2
-rw-r--r--Source/WebKit/qt/Api/qwebsettings.cpp36
-rw-r--r--Source/WebKit/qt/Api/qwebsettings.h3
-rw-r--r--Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp2
-rw-r--r--Tools/qmake/config.tests/leveldb/leveldb.cpp28
-rw-r--r--Tools/qmake/config.tests/leveldb/leveldb.pro3
-rw-r--r--Tools/qmake/mkspecs/features/features.prf11
8 files changed, 65 insertions, 21 deletions
diff --git a/Source/WebCore/Target.pri b/Source/WebCore/Target.pri
index bf34ea8fa..fc717b348 100644
--- a/Source/WebCore/Target.pri
+++ b/Source/WebCore/Target.pri
@@ -3087,6 +3087,7 @@ enable?(INDEXED_DATABASE) {
Modules/indexeddb/IDBKey.h \
Modules/indexeddb/IDBKeyPath.h \
Modules/indexeddb/IDBKeyRange.h \
+ Modules/indexeddb/IDBLevelDBCoding.h \
Modules/indexeddb/IDBObjectStore.h \
Modules/indexeddb/IDBObjectStoreBackendImpl.h \
Modules/indexeddb/IDBOpenDBRequest.h \
diff --git a/Source/WebCore/platform/leveldb/LevelDBDatabase.cpp b/Source/WebCore/platform/leveldb/LevelDBDatabase.cpp
index 33688e290..994d2c568 100644
--- a/Source/WebCore/platform/leveldb/LevelDBDatabase.cpp
+++ b/Source/WebCore/platform/leveldb/LevelDBDatabase.cpp
@@ -35,10 +35,10 @@
#include "LevelDBWriteBatch.h"
#include "Logging.h"
#include "NotImplemented.h"
-#include <helpers/memenv/memenv.h>
#include <leveldb/comparator.h>
#include <leveldb/db.h>
#include <leveldb/env.h>
+#include <leveldb/helpers/memenv.h>
#include <leveldb/slice.h>
#include <string>
#include <wtf/PassOwnPtr.h>
diff --git a/Source/WebKit/qt/Api/qwebsettings.cpp b/Source/WebKit/qt/Api/qwebsettings.cpp
index 242404055..f8e4d42ed 100644
--- a/Source/WebKit/qt/Api/qwebsettings.cpp
+++ b/Source/WebKit/qt/Api/qwebsettings.cpp
@@ -28,6 +28,7 @@
#include "FileSystem.h"
#include "FontCache.h"
#include "GCController.h"
+#include "GroupSettings.h"
#include "IconDatabase.h"
#include "Image.h"
#if ENABLE(ICONDATABASE)
@@ -67,8 +68,10 @@ QWEBKIT_EXPORT void qt_networkAccessAllowed(bool isAllowed)
class QWebSettingsPrivate {
public:
- QWebSettingsPrivate(WebCore::Settings* wcSettings = 0)
- : settings(wcSettings)
+ QWebSettingsPrivate(WebCore::Settings* wcSettings = 0, WebCore::GroupSettings* wcGroupSettings = 0)
+ : offlineStorageDefaultQuota(0)
+ , settings(wcSettings)
+ , groupSettings(wcGroupSettings)
{
}
@@ -79,11 +82,13 @@ public:
QString defaultTextEncoding;
QString localStoragePath;
QString offlineWebApplicationCachePath;
+ QString offlineDatabasePath;
QString mediaType;
qint64 offlineStorageDefaultQuota;
QWebSettings::ThirdPartyCookiePolicy thirdPartyCookiePolicy;
void apply();
WebCore::Settings* settings;
+ WebCore::GroupSettings* groupSettings;
};
Q_GLOBAL_STATIC(QList<QWebSettingsPrivate*>, allSettings);
@@ -237,12 +242,23 @@ void QWebSettingsPrivate::apply()
global->attributes.value(QWebSettings::PrintElementBackgrounds));
settings->setShouldPrintBackgrounds(value);
-#if ENABLE(SQL_DATABASE)
value = attributes.value(QWebSettings::OfflineStorageDatabaseEnabled,
global->attributes.value(QWebSettings::OfflineStorageDatabaseEnabled));
+#if ENABLE(SQL_DATABASE)
WebCore::DatabaseManager::manager().setIsAvailable(value);
#endif
+#if ENABLE(INDEXED_DATABASE)
+ QString path = !offlineDatabasePath.isEmpty() ? offlineDatabasePath : global->offlineDatabasePath;
+ Q_ASSERT(groupSettings);
+ // Setting the path to empty string disables persistent storage of the indexed database.
+ if (!value)
+ path = QString();
+ groupSettings->setIndexedDBDatabasePath(path);
+ qint64 quota = offlineStorageDefaultQuota ? offlineStorageDefaultQuota : global->offlineStorageDefaultQuota;
+ groupSettings->setIndexedDBQuotaBytes(quota);
+#endif
+
value = attributes.value(QWebSettings::OfflineWebApplicationCacheEnabled,
global->attributes.value(QWebSettings::OfflineWebApplicationCacheEnabled));
settings->setOfflineWebApplicationCacheEnabled(value);
@@ -564,10 +580,9 @@ QWebSettings::QWebSettings()
/*!
\internal
*/
-QWebSettings::QWebSettings(WebCore::Settings* settings)
- : d(new QWebSettingsPrivate(settings))
+QWebSettings::QWebSettings(WebCore::Settings* settings, WebCore::GroupSettings* groupSettings)
+ : d(new QWebSettingsPrivate(settings, groupSettings))
{
- d->settings = settings;
d->apply();
allSettings()->append(d);
}
@@ -1050,6 +1065,7 @@ void QWebSettings::resetAttribute(WebAttribute attr)
void QWebSettings::setOfflineStoragePath(const QString& path)
{
WebCore::initializeWebCoreQt();
+ QWebSettings::globalSettings()->d->offlineDatabasePath = path;
#if ENABLE(SQL_DATABASE)
WebCore::DatabaseManager::manager().setDatabaseDirectoryPath(path);
#endif
@@ -1066,11 +1082,7 @@ void QWebSettings::setOfflineStoragePath(const QString& path)
QString QWebSettings::offlineStoragePath()
{
WebCore::initializeWebCoreQt();
-#if ENABLE(SQL_DATABASE)
- return WebCore::DatabaseManager::manager().databaseDirectoryPath();
-#else
- return QString();
-#endif
+ return QWebSettings::globalSettings()->d->offlineDatabasePath;
}
/*!
@@ -1184,7 +1196,7 @@ void QWebSettings::setLocalStoragePath(const QString& path)
\since 4.6
Returns the path for HTML5 local storage.
-
+
\sa setLocalStoragePath()
*/
QString QWebSettings::localStoragePath() const
diff --git a/Source/WebKit/qt/Api/qwebsettings.h b/Source/WebKit/qt/Api/qwebsettings.h
index afffb2aec..cfc5bd542 100644
--- a/Source/WebKit/qt/Api/qwebsettings.h
+++ b/Source/WebKit/qt/Api/qwebsettings.h
@@ -28,6 +28,7 @@
#include <QtCore/qshareddata.h>
namespace WebCore {
+ class GroupSettings;
class Settings;
}
@@ -176,7 +177,7 @@ private:
Q_DISABLE_COPY(QWebSettings)
QWebSettings();
- QWebSettings(WebCore::Settings *settings);
+ QWebSettings(WebCore::Settings *settings, WebCore::GroupSettings *groupSettings);
~QWebSettings();
QWebSettingsPrivate *d;
diff --git a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
index 039c23218..96b1ac072 100644
--- a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
@@ -270,7 +270,7 @@ void QWebPageAdapter::initializeWebCorePage()
page->addLayoutMilestones(DidFirstVisuallyNonEmptyLayout);
- settings = new QWebSettings(page->settings());
+ settings = new QWebSettings(page->settings(), page->group().groupSettings());
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
WebCore::provideNotification(page, NotificationPresenterClientQt::notificationPresenter());
diff --git a/Tools/qmake/config.tests/leveldb/leveldb.cpp b/Tools/qmake/config.tests/leveldb/leveldb.cpp
new file mode 100644
index 000000000..84a52beb7
--- /dev/null
+++ b/Tools/qmake/config.tests/leveldb/leveldb.cpp
@@ -0,0 +1,28 @@
+/*
+ Copyright (C) 2014 Digia Plc. and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <leveldb/db.h>
+#include <leveldb/env.h>
+#include <leveldb/helpers/memenv.h>
+
+int main(int, char**)
+{
+ leveldb::Env* inMemoryEnv = leveldb::NewMemEnv(leveldb::Env::Default());
+ return !inMemoryEnv;
+}
diff --git a/Tools/qmake/config.tests/leveldb/leveldb.pro b/Tools/qmake/config.tests/leveldb/leveldb.pro
new file mode 100644
index 000000000..2d64eeba9
--- /dev/null
+++ b/Tools/qmake/config.tests/leveldb/leveldb.pro
@@ -0,0 +1,3 @@
+SOURCES = leveldb.cpp
+OBJECTS_DIR = obj
+LIBS += -lleveldb -lmemenv
diff --git a/Tools/qmake/mkspecs/features/features.prf b/Tools/qmake/mkspecs/features/features.prf
index 56f043af5..d8da581c6 100644
--- a/Tools/qmake/mkspecs/features/features.prf
+++ b/Tools/qmake/mkspecs/features/features.prf
@@ -44,6 +44,7 @@ defineTest(detectFeatures) {
config_libxslt: WEBKIT_CONFIG += xslt
config_libzlib: WEBKIT_CONFIG += use_zlib
config_libwebp: WEBKIT_CONFIG += use_webp
+ config_leveldb: WEBKIT_CONFIG += use_leveldb
# We can't use Qt's 3rdparty sources for libjpeg and libpng outside of qtbase, but if Qt
# is using the system libraries, use them to take advantage of the WebCore image decoders as well.
@@ -137,14 +138,12 @@ defineTest(detectFeatures) {
# Slider Touch is sensible to use when compiling WebKit2
enable?(touch_events): WEBKIT_CONFIG += touch_slider
-
-
- # ---------------- Sanitize features -------------------
-
export(WEBKIT_CONFIG)
export(CONFIGURE_WARNINGS)
}
+# ---------------- Sanitize features -------------------
+
defineTest(santizeFeatures) {
# If we are doing a production_build we should only enable Geolocation support if QtPositioning exists. In developer builds we can use Mock implementations.
production_build:!have?(qtpositioning): WEBKIT_CONFIG -= geolocation
@@ -170,8 +169,8 @@ defineTest(santizeFeatures) {
# GStreamer uses Glib
use?(gstreamer): WEBKIT_CONFIG += use_glib
- # IndexedDB used leveldb.
- enable?(indexed_database): WEBKIT_CONFIG += use_leveldb
+ # IndexedDB requires leveldb
+ !use?(leveldb): WEBKIT_CONFIG -= indexed_database
# VideoTrack requires video
!enable?(video): WEBKIT_CONFIG -= video_track