[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

jorlow at chromium.org jorlow at chromium.org
Thu Oct 29 20:49:24 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 49a1d2882e27df94515e19c68d31fde1ea8e190b
Author: jorlow at chromium.org <jorlow at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 21 00:40:55 2009 +0000

    DOM Storage runtime flag changes
    https://bugs.webkit.org/show_bug.cgi?id=30602
    
    Patch by Jeremy Orlow <jorlow at chromium.org> on 2009-10-20
    Reviewed by Adam Barth.
    
    Part 1/2.  Removing sessionStorageEnabled in next patch after the
    Chromium side of the changes lands.
    
    Revert my changes to Settings and instead implement DOM Storage enabling via
    the methods agreed upon in https://bugs.webkit.org/show_bug.cgi?id=30240
    
    This stuff was (intentionally) never exposed to web pages or DRT, so there's no
    LayoutTest visible changes and thus no tests.
    
    * bindings/v8/custom/V8CustomBinding.h:
    * bindings/v8/custom/V8DOMWindowCustom.cpp:
    (WebCore::ACCESSOR_RUNTIME_ENABLER):
    * page/DOMWindow.idl:
    * storage/Storage.cpp:
    (WebCore::Storage::setLocalStorageAvailable):
    (WebCore::Storage::localStorageAvailable):
    (WebCore::Storage::setSessionStorageAvailable):
    (WebCore::Storage::sessionStorageAvailable):
    * storage/Storage.h:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49894 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9ec1aa6..4a9a628 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,30 @@
+2009-10-20  Jeremy Orlow  <jorlow at chromium.org>
+
+        Reviewed by Adam Barth.
+
+        DOM Storage runtime flag changes
+        https://bugs.webkit.org/show_bug.cgi?id=30602
+
+        Part 1/2.  Removing sessionStorageEnabled in next patch after the
+        Chromium side of the changes lands.
+
+        Revert my changes to Settings and instead implement DOM Storage enabling via
+        the methods agreed upon in https://bugs.webkit.org/show_bug.cgi?id=30240
+
+        This stuff was (intentionally) never exposed to web pages or DRT, so there's no
+        LayoutTest visible changes and thus no tests.
+
+        * bindings/v8/custom/V8CustomBinding.h:
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        (WebCore::ACCESSOR_RUNTIME_ENABLER):
+        * page/DOMWindow.idl:
+        * storage/Storage.cpp:
+        (WebCore::Storage::setLocalStorageAvailable):
+        (WebCore::Storage::localStorageAvailable):
+        (WebCore::Storage::setSessionStorageAvailable):
+        (WebCore::Storage::sessionStorageAvailable):
+        * storage/Storage.h:
+
 2009-10-20  John Gregg  <johnnyg at google.com>
 
         Reviewed by David Levin.
diff --git a/WebCore/bindings/v8/custom/V8CustomBinding.h b/WebCore/bindings/v8/custom/V8CustomBinding.h
index 0f29e6d..126392d 100644
--- a/WebCore/bindings/v8/custom/V8CustomBinding.h
+++ b/WebCore/bindings/v8/custom/V8CustomBinding.h
@@ -577,6 +577,8 @@ namespace WebCore {
 #endif      
 
 #if ENABLE(DOM_STORAGE)
+        DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowLocalStorage);
+        DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowSessionStorage);
         DECLARE_INDEXED_PROPERTY_GETTER(Storage);
         DECLARE_INDEXED_PROPERTY_SETTER(Storage);
         DECLARE_INDEXED_PROPERTY_DELETER(Storage);
diff --git a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
index 2a4f77d..6dc8b54 100644
--- a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
@@ -54,6 +54,7 @@
 #include "SerializedScriptValue.h"
 #include "Settings.h"
 #include "SharedWorkerRepository.h"
+#include "Storage.h"
 #include "WebSocket.h"
 #include "WindowFeatures.h"
 
@@ -280,6 +281,18 @@ ACCESSOR_RUNTIME_ENABLER(DOMWindowWebSocket)
 }
 #endif
 
+#if ENABLE(DOM_STORAGE)
+ACCESSOR_RUNTIME_ENABLER(DOMWindowLocalStorage)
+{
+    return Storage::localStorageAvailable();
+}
+
+ACCESSOR_RUNTIME_ENABLER(DOMWindowSessionStorage)
+{
+    return Storage::sessionStorageAvailable();
+}
+#endif
+
 #if ENABLE(NOTIFICATIONS)
 ACCESSOR_RUNTIME_ENABLER(DOMWindowWebkitNotifications)
 {
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index 5606d91..7dfc7d0 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -164,8 +164,8 @@ module window {
             raises(DOMException);
 #endif
 #if defined(ENABLE_DOM_STORAGE) && ENABLE_DOM_STORAGE
-        readonly attribute Storage sessionStorage;
-        readonly attribute Storage localStorage;
+        readonly attribute [EnabledAtRuntime] Storage sessionStorage;
+        readonly attribute [EnabledAtRuntime] Storage localStorage;
 #endif
 #if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS
         readonly attribute [EnabledAtRuntime] NotificationCenter webkitNotifications;
diff --git a/WebCore/storage/Storage.cpp b/WebCore/storage/Storage.cpp
index 0a8eed7..28a55ad 100644
--- a/WebCore/storage/Storage.cpp
+++ b/WebCore/storage/Storage.cpp
@@ -34,6 +34,32 @@
 
 namespace WebCore {
 
+#if USE(V8)
+// FIXME: Remove once these features are turned on by default in Chromium.
+static bool s_localStorageAvailable = true;
+static bool s_sessionStorageAvailable = true;
+
+void Storage::setLocalStorageAvailable(bool available)
+{
+    s_localStorageAvailable = available;
+}
+
+bool Storage::localStorageAvailable()
+{
+    return s_localStorageAvailable;
+}
+
+void Storage::setSessionStorageAvailable(bool available)
+{
+    s_sessionStorageAvailable = available;
+}
+
+bool Storage::sessionStorageAvailable()
+{
+    return s_sessionStorageAvailable;
+}
+#endif
+
 PassRefPtr<Storage> Storage::create(Frame* frame, PassRefPtr<StorageArea> storageArea)
 {
     return adoptRef(new Storage(frame, storageArea));
diff --git a/WebCore/storage/Storage.h b/WebCore/storage/Storage.h
index 06cc97b..762688f 100644
--- a/WebCore/storage/Storage.h
+++ b/WebCore/storage/Storage.h
@@ -44,6 +44,13 @@ namespace WebCore {
         static PassRefPtr<Storage> create(Frame*, PassRefPtr<StorageArea>);
         ~Storage();
 
+#if USE(V8)
+        static void setLocalStorageAvailable(bool);
+        static bool localStorageAvailable();
+        static void setSessionStorageAvailable(bool);
+        static bool sessionStorageAvailable();
+#endif
+
         unsigned length() const;
         String key(unsigned index) const;
         String getItem(const String&) const;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list