WebKit2: Expose the preference to enable or disable HTML5 Databases.
authorjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Dec 2010 00:18:44 +0000 (00:18 +0000)
committerjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Dec 2010 00:18:44 +0000 (00:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=50411

Reviewed by Dan Bernstein.

* Shared/WebPreferencesStore.h:
Make the preference to enable HTML5 Databases default ot true.

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetDatabasesEnabled):
(WKPreferencesGetDatabasesEnabled):
* UIProcess/API/C/WKPreferences.h:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
Set AbstractDatabase::isAvailable (mimicking how the preference is set in WebKit1).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@73410 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit2/ChangeLog
WebKit2/Shared/WebPreferencesStore.h
WebKit2/UIProcess/API/C/WKPreferences.cpp
WebKit2/UIProcess/API/C/WKPreferences.h
WebKit2/WebProcess/WebPage/WebPage.cpp

index 2599a3e..f369ff7 100644 (file)
@@ -1,3 +1,22 @@
+2010-12-06  Jessie Berlin  <jberlin@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        WebKit2: Expose the preference to enable or disable HTML5 Databases.
+        https://bugs.webkit.org/show_bug.cgi?id=50411
+
+        * Shared/WebPreferencesStore.h:
+        Make the preference to enable HTML5 Databases default ot true.
+
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetDatabasesEnabled):
+        (WKPreferencesGetDatabasesEnabled):
+        * UIProcess/API/C/WKPreferences.h:
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+        Set AbstractDatabase::isAvailable (mimicking how the preference is set in WebKit1).
+
 2010-12-06  Mark Rowe  <mrowe@apple.com>
 
         Build fix.
index 7a634b9..6cfb290 100644 (file)
@@ -43,6 +43,7 @@ namespace WebKit {
     macro(JavaEnabled, javaEnabled, Bool, bool, true) \
     macro(OfflineWebApplicationCacheEnabled, offlineWebApplicationCacheEnabled, Bool, bool, false) \
     macro(LocalStorageEnabled, localStorageEnabled, Bool, bool, true) \
+    macro(DatabasesEnabled, databasesEnabled, Bool, bool, true) \
     macro(XSSAuditorEnabled, xssAuditorEnabled, Bool, bool, true) \
     macro(FrameFlatteningEnabled, frameFlatteningEnabled, Bool, bool, false) \
     macro(DeveloperExtrasEnabled, developerExtrasEnabled, Bool, bool, false) \
index ce579af..6324461 100644 (file)
@@ -90,6 +90,16 @@ bool WKPreferencesGetLocalStorageEnabled(WKPreferencesRef preferencesRef)
     return toImpl(preferencesRef)->localStorageEnabled();
 }
 
+void WKPreferencesSetDatabasesEnabled(WKPreferencesRef preferencesRef, bool databasesEnabled)
+{
+    toImpl(preferencesRef)->setDatabasesEnabled(databasesEnabled);
+}
+
+bool WKPreferencesGetDatabasesEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->databasesEnabled();
+}
+
 void WKPreferencesSetXSSAuditorEnabled(WKPreferencesRef preferencesRef, bool xssAuditorEnabled)
 {
     toImpl(preferencesRef)->setXSSAuditorEnabled(xssAuditorEnabled);
index 8a44527..47c9156 100644 (file)
@@ -58,6 +58,10 @@ WK_EXPORT void WKPreferencesSetLocalStorageEnabled(WKPreferencesRef preferences,
 WK_EXPORT bool WKPreferencesGetLocalStorageEnabled(WKPreferencesRef preferences);
 
 // Defaults to true.
+WK_EXPORT void WKPreferencesSetDatabasesEnabled(WKPreferencesRef preferences, bool databasesEnabled);
+WK_EXPORT bool WKPreferencesGetDatabasesEnabled(WKPreferencesRef preferences);
+
+// Defaults to true.
 WK_EXPORT void WKPreferencesSetXSSAuditorEnabled(WKPreferencesRef preferences, bool xssAuditorEnabled);
 WK_EXPORT bool WKPreferencesGetXSSAuditorEnabled(WKPreferencesRef preferences);
 
index d5468cb..b131187 100644 (file)
@@ -57,6 +57,7 @@
 #include "WebProcess.h"
 #include "WebProcessProxyMessageKinds.h"
 #include "WebProcessProxyMessages.h"
+#include <WebCore/AbstractDatabase.h>
 #include <WebCore/Chrome.h>
 #include <WebCore/ContextMenuController.h>
 #include <WebCore/EventHandler.h>
@@ -916,6 +917,10 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
 #endif
     settings->setShowDebugBorders(store.getBoolValueForKey(WebPreferencesKey::compositingBordersVisibleKey()));
     settings->setShowRepaintCounter(store.getBoolValueForKey(WebPreferencesKey::compositingRepaintCountersVisibleKey()));
+
+#if ENABLE(DATABASE)
+    AbstractDatabase::setIsAvailable(store.getBoolValueForKey(WebPreferencesKey::databasesEnabledKey()));
+#endif
     
     platformPreferencesDidChange(store);
 }