Source/WebCore: Use a platform strategy for local storage
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Jan 2013 03:07:08 +0000 (03:07 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Jan 2013 03:07:08 +0000 (03:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=107600

Reviewed by Andreas Kling.

* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.exp.in:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
Add new files.

* platform/PlatformStrategies.h:
Add a way to create/get the storage strategy.

* storage/StorageNamespace.cpp:
(WebCore::StorageNamespace::localStorageNamespace):
(WebCore::StorageNamespace::sessionStorageNamespace):
Call the storage strategy.

* storage/StorageNamespace.h:
* storage/StorageStrategy.cpp: Added.
(WebCore::StorageStrategy::localStorageNamespace):
(WebCore::StorageStrategy::sessionStorageNamespace):
Call through to StorageNamespaceImpl.

* storage/StorageStrategy.h: Added.

Source/WebKit/efl: Use a platforom strategy for local storage
https://bugs.webkit.org/show_bug.cgi?id=107600

Reviewed by Andreas Kling.

Update for new storage strategy.

* WebCoreSupport/PlatformStrategiesEfl.cpp:
(PlatformStrategiesEfl::createStorageStrategy):
* WebCoreSupport/PlatformStrategiesEfl.h:
(PlatformStrategiesEfl):

Source/WebKit/gtk: Use a platforom strategy for local storage
https://bugs.webkit.org/show_bug.cgi?id=107600

Reviewed by Andreas Kling.

Update for new storage strategy.

* WebCoreSupport/PlatformStrategiesGtk.cpp:
(PlatformStrategiesGtk::createStorageStrategy):
* WebCoreSupport/PlatformStrategiesGtk.h:
(PlatformStrategiesGtk):

Source/WebKit/mac: Use a platforom strategy for local storage
https://bugs.webkit.org/show_bug.cgi?id=107600

Reviewed by Andreas Kling.

Update for new storage strategy.

* WebCoreSupport/WebPlatformStrategies.h:
(WebPlatformStrategies):
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::createStorageStrategy):

Source/WebKit/qt: Use a platforom strategy for local storage
https://bugs.webkit.org/show_bug.cgi?id=107600

Reviewed by Andreas Kling.

Update for new storage strategy.

* WebCoreSupport/PlatformStrategiesQt.cpp:
(PlatformStrategiesQt::createStorageStrategy):
* WebCoreSupport/PlatformStrategiesQt.h:
(PlatformStrategiesQt):

Source/WebKit/win: Use a platforom strategy for local storage
https://bugs.webkit.org/show_bug.cgi?id=107600

Reviewed by Andreas Kling.

Update for new storage strategy.

* WebCoreSupport/WebPlatformStrategies.cpp:
(WebPlatformStrategies::createStorageStrategy):
* WebCoreSupport/WebPlatformStrategies.h:
(WebPlatformStrategies):

Source/WebKit/wince: Use a platforom strategy for local storage
https://bugs.webkit.org/show_bug.cgi?id=107600

Reviewed by Andreas Kling.

Update for new storage strategy.

* WebCoreSupport/PlatformStrategiesWinCE.cpp:
(PlatformStrategiesWinCE::createStorageStrategy):
* WebCoreSupport/PlatformStrategiesWinCE.h:
(PlatformStrategiesWinCE):

Source/WebKit2: Use a platforom strategy for local storage
https://bugs.webkit.org/show_bug.cgi?id=107600

Reviewed by Andreas Kling.

Update for new storage strategy.

* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::createStorageStrategy):
(WebKit):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
(WebPlatformStrategies):

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

34 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/PlatformStrategies.h
Source/WebCore/storage/StorageNamespace.cpp
Source/WebCore/storage/StorageNamespace.h
Source/WebCore/storage/StorageStrategy.cpp [new file with mode: 0644]
Source/WebCore/storage/StorageStrategy.h [new file with mode: 0644]
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.cpp
Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.h
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/PlatformStrategiesGtk.cpp
Source/WebKit/gtk/WebCoreSupport/PlatformStrategiesGtk.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h
Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.cpp
Source/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.h
Source/WebKit/wince/ChangeLog
Source/WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.cpp
Source/WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h

index cdc2808..0ba5f86 100644 (file)
@@ -2312,6 +2312,7 @@ set(WebCore_SOURCES
     storage/StorageMap.cpp
     storage/StorageNamespace.cpp
     storage/StorageNamespaceImpl.cpp
+    storage/StorageStrategy.cpp
     storage/StorageSyncManager.cpp
     storage/StorageTracker.cpp
 
index 9062543..5012d67 100644 (file)
@@ -1,3 +1,34 @@
+2013-01-22  Anders Carlsson  <andersca@apple.com>
+
+        Use a platform strategy for local storage
+        https://bugs.webkit.org/show_bug.cgi?id=107600
+
+        Reviewed by Andreas Kling.
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * WebCore.exp.in:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        Add new files.
+
+        * platform/PlatformStrategies.h:
+        Add a way to create/get the storage strategy.
+
+        * storage/StorageNamespace.cpp:
+        (WebCore::StorageNamespace::localStorageNamespace):
+        (WebCore::StorageNamespace::sessionStorageNamespace):
+        Call the storage strategy.
+
+        * storage/StorageNamespace.h:
+        * storage/StorageStrategy.cpp: Added.
+        (WebCore::StorageStrategy::localStorageNamespace):
+        (WebCore::StorageStrategy::sessionStorageNamespace):
+        Call through to StorageNamespaceImpl.
+
+        * storage/StorageStrategy.h: Added.
+
 2013-01-22  Jun Jiang  <jun.a.jiang@intel.com>
 
         Optimize the texture packing for texImage2D() and texSubImage2D() in WebGL
index ffa39aa..aa0ea82 100644 (file)
@@ -4621,6 +4621,8 @@ webcore_sources += \
        Source/WebCore/storage/StorageNamespace.h \
        Source/WebCore/storage/StorageNamespaceImpl.cpp \
        Source/WebCore/storage/StorageNamespaceImpl.h \
+       Source/WebCore/storage/StorageStrategy.cpp \
+       Source/WebCore/storage/StorageStrategy.h \
        Source/WebCore/storage/StorageSyncManager.cpp \
        Source/WebCore/storage/StorageSyncManager.h \
        Source/WebCore/storage/StorageTracker.cpp \
index 9a489e5..4071362 100644 (file)
@@ -1277,6 +1277,7 @@ SOURCES += \
     storage/StorageNamespace.cpp \
     storage/StorageNamespaceImpl.cpp \
     storage/StorageSyncManager.cpp \
+    storage/StorageStrategy.cpp \
     storage/StorageTracker.cpp \
     testing/Internals.cpp \
     testing/InternalSettings.cpp \
index c346e02..344abaa 100644 (file)
@@ -421,6 +421,7 @@ __ZN7WebCore15ResourceRequest21httpPipeliningEnabledEv
 __ZN7WebCore15ResourceRequest24setHTTPPipeliningEnabledEb
 __ZN7WebCore15ScrollAlignment17alignCenterAlwaysE
 __ZN7WebCore15ScrollAlignment19alignToEdgeIfNeededE
+__ZN7WebCore15StorageStrategy21localStorageNamespaceERKN3WTF6StringEj
 __ZN7WebCore15StringTruncator13rightTruncateERKN3WTF6StringEfRKNS_4FontENS0_24EnableRoundingHacksOrNotE
 __ZN7WebCore15StringTruncator14centerTruncateERKN3WTF6StringEfRKNS_4FontENS0_24EnableRoundingHacksOrNotE
 __ZN7WebCore15StringTruncator5widthERKN3WTF6StringERKNS_4FontENS0_24EnableRoundingHacksOrNotE
@@ -1498,6 +1499,7 @@ __ZNK7WebCore9PageCache10frameCountEv
 __ZNK7WebCore9PageCache21autoreleasedPageCountEv
 __ZTVN7WebCore12ChromeClientE
 __ZTVN7WebCore14LoaderStrategyE
+__ZTVN7WebCore15StorageStrategyE
 __ZTVN7WebCore16DatabaseStrategyE
 __ZTVN7WebCore16IconDatabaseBaseE
 __ZTVN7WebCore17FrameLoaderClientE
index ac2364c..921a58c 100644 (file)
             'storage/StorageNamespace.h',
             'storage/StorageNamespaceImpl.cpp',
             'storage/StorageNamespaceImpl.h',
+            'storage/StorageStrategy.cpp',
+            'storage/StorageStrategy.h',
             'storage/StorageSyncManager.cpp',
             'storage/StorageSyncManager.h',
             'storage/StorageTask.cpp',
index b797897..12c2565 100755 (executable)
                                >
                        </File>
                        <File
+                               RelativePath="..\storage\StorageStrategy.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\storage\StorageStrategy.h"
+                               >
+                       </File>
+                       <File
                                RelativePath="..\storage\StorageSyncManager.cpp"
                                >
                        </File>
index 8887395..dae84da 100644 (file)
                1AAADDA414DB409F00AF64B3 /* ScrollingTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAADDA214DB409F00AF64B3 /* ScrollingTree.h */; settings = {ATTRIBUTES = (Private, ); }; };
                1AAADDE314DC8C8F00AF64B3 /* ScrollingTreeNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAADDE114DC8C8F00AF64B3 /* ScrollingTreeNode.cpp */; };
                1AAADDE414DC8C8F00AF64B3 /* ScrollingTreeNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAADDE214DC8C8F00AF64B3 /* ScrollingTreeNode.h */; };
+               1AB09DB416AF5F6C008538E7 /* StorageStrategy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB09DB216AF5F6C008538E7 /* StorageStrategy.cpp */; };
+               1AB09DB516AF5F6C008538E7 /* StorageStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB09DB316AF5F6C008538E7 /* StorageStrategy.h */; settings = {ATTRIBUTES = (Private, ); }; };
                1AB1AE7A0C051FDE00139F4F /* zoomInCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AB1AE780C051FDE00139F4F /* zoomInCursor.png */; };
                1AB1AE7B0C051FDE00139F4F /* zoomOutCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AB1AE790C051FDE00139F4F /* zoomOutCursor.png */; };
                1AB33DA512551E320024457A /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AB33DA412551E320024457A /* IOKit.framework */; };
                1AAADDA214DB409F00AF64B3 /* ScrollingTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTree.h; sourceTree = "<group>"; };
                1AAADDE114DC8C8F00AF64B3 /* ScrollingTreeNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingTreeNode.cpp; sourceTree = "<group>"; };
                1AAADDE214DC8C8F00AF64B3 /* ScrollingTreeNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeNode.h; sourceTree = "<group>"; };
+               1AB09DB216AF5F6C008538E7 /* StorageStrategy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageStrategy.cpp; sourceTree = "<group>"; };
+               1AB09DB316AF5F6C008538E7 /* StorageStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageStrategy.h; sourceTree = "<group>"; };
                1AB1AE780C051FDE00139F4F /* zoomInCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = zoomInCursor.png; sourceTree = "<group>"; };
                1AB1AE790C051FDE00139F4F /* zoomOutCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = zoomOutCursor.png; sourceTree = "<group>"; };
                1AB33DA412551E320024457A /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
                97B38E23151C4264004622E9 /* DOMWindowNotifications.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DOMWindowNotifications.cpp; path = Modules/notifications/DOMWindowNotifications.cpp; sourceTree = "<group>"; };
                97B38E24151C4264004622E9 /* DOMWindowNotifications.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DOMWindowNotifications.h; path = Modules/notifications/DOMWindowNotifications.h; sourceTree = "<group>"; };
                97B38E25151C4264004622E9 /* DOMWindowNotifications.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DOMWindowNotifications.idl; path = Modules/notifications/DOMWindowNotifications.idl; sourceTree = "<group>"; };
-               97B8FFCF16AE7F920038388D /* CharacterReferenceParserInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CharacterReferenceParserInlines.h; path = CharacterReferenceParserInlines.h; sourceTree = "<group>"; };
+               97B8FFCF16AE7F920038388D /* CharacterReferenceParserInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharacterReferenceParserInlines.h; sourceTree = "<group>"; };
                97BC69D61505F076001B74AC /* AbstractDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AbstractDatabase.cpp; path = Modules/webdatabase/AbstractDatabase.cpp; sourceTree = "<group>"; };
                97BC69D71505F076001B74AC /* AbstractDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AbstractDatabase.h; path = Modules/webdatabase/AbstractDatabase.h; sourceTree = "<group>"; };
                97BC69D81505F076001B74AC /* ChangeVersionWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ChangeVersionWrapper.cpp; path = Modules/webdatabase/ChangeVersionWrapper.cpp; sourceTree = "<group>"; };
                                C50D0E810FF4272900AC2644 /* StorageNamespace.h */,
                                C55E38BC10040D5D00A56BDB /* StorageNamespaceImpl.cpp */,
                                C55E38BB10040D5D00A56BDB /* StorageNamespaceImpl.h */,
+                               1AB09DB216AF5F6C008538E7 /* StorageStrategy.cpp */,
+                               1AB09DB316AF5F6C008538E7 /* StorageStrategy.h */,
                                C5102D930FD9AA2D00FAFF04 /* StorageSyncManager.cpp */,
                                C5102D920FD9AA2D00FAFF04 /* StorageSyncManager.h */,
                                511F23130DC160DA004F0032 /* StorageTask.cpp */,
                                B27535760B053814002CE64F /* IntSizeHash.h in Headers */,
                                1C81BA0A0E97348300266E07 /* JavaScriptCallFrame.h in Headers */,
                                418F88050FF957AF0080F045 /* JSAbstractWorker.h in Headers */,
+                               1AB09DB516AF5F6C008538E7 /* StorageStrategy.h in Headers */,
                                FDA15ECA12B03F50003A583A /* JSAnalyserNode.h in Headers */,
                                49EECF01105070C400099FAB /* JSArrayBuffer.h in Headers */,
                                49EECF1C105072F300099FAB /* JSArrayBufferView.h in Headers */,
                                A9D247F70D757E3400FDF959 /* JSNavigator.cpp in Sources */,
                                14DC0D3709FED073007B0235 /* JSNode.cpp in Sources */,
                                BCD9C2640C17AA67005C90A2 /* JSNodeCustom.cpp in Sources */,
+                               1AB09DB416AF5F6C008538E7 /* StorageStrategy.cpp in Sources */,
                                14115B7209F84CD600CA4FC1 /* JSNodeFilter.cpp in Sources */,
                                BCB773610C17853D00132BA4 /* JSNodeFilterCondition.cpp in Sources */,
                                BCB773630C17853D00132BA4 /* JSNodeFilterCustom.cpp in Sources */,
index 0d16799..5b9e616 100644 (file)
@@ -36,6 +36,7 @@ class LoaderStrategy;
 class PasteboardStrategy;
 class PluginStrategy;
 class SharedWorkerStrategy;
+class StorageStrategy;
 class VisitedLinkStrategy;
 
 class PlatformStrategies {
@@ -89,6 +90,13 @@ public:
         return m_visitedLinkStrategy;
     }
 
+    StorageStrategy* storageStrategy()
+    {
+        if (!m_storageStrategy)
+            m_storageStrategy = createStorageStrategy();
+        return m_storageStrategy;
+    }
+
 protected:
     PlatformStrategies()
         : m_cookiesStrategy(0)
@@ -97,6 +105,7 @@ protected:
         , m_pasteboardStrategy(0)
         , m_pluginStrategy(0)
         , m_sharedWorkerStrategy(0)
+        , m_storageStrategy(0)
         , m_visitedLinkStrategy(0)
     {
     }
@@ -112,6 +121,7 @@ private:
     virtual PasteboardStrategy* createPasteboardStrategy() = 0;
     virtual PluginStrategy* createPluginStrategy() = 0;
     virtual SharedWorkerStrategy* createSharedWorkerStrategy() = 0;
+    virtual StorageStrategy* createStorageStrategy() = 0;
     virtual VisitedLinkStrategy* createVisitedLinkStrategy() = 0;
 
     CookiesStrategy* m_cookiesStrategy;
@@ -120,6 +130,7 @@ private:
     PasteboardStrategy* m_pasteboardStrategy;
     PluginStrategy* m_pluginStrategy;
     SharedWorkerStrategy* m_sharedWorkerStrategy;
+    StorageStrategy* m_storageStrategy;
     VisitedLinkStrategy* m_visitedLinkStrategy;
 };
 
index 1b589e5..f4f879f 100644 (file)
@@ -26,7 +26,8 @@
 #include "config.h"
 #include "StorageNamespace.h"
 
-#include "StorageNamespaceImpl.h"
+#include "PlatformStrategies.h"
+#include "StorageStrategy.h"
 
 #if PLATFORM(CHROMIUM)
 #error "Chromium should not compile this file and instead define its own version of these factories that navigate the multi-process boundry."
@@ -36,13 +37,12 @@ namespace WebCore {
 
 PassRefPtr<StorageNamespace> StorageNamespace::localStorageNamespace(const String& path, unsigned quota)
 {
-    return StorageNamespaceImpl::localStorageNamespace(path, quota);
+    return platformStrategies()->storageStrategy()->localStorageNamespace(path, quota);
 }
 
-// The page argument is only used by the Chromium port.
-PassRefPtr<StorageNamespace> StorageNamespace::sessionStorageNamespace(Page*, unsigned quota)
+PassRefPtr<StorageNamespace> StorageNamespace::sessionStorageNamespace(Page* page, unsigned quota)
 {
-    return StorageNamespaceImpl::sessionStorageNamespace(quota);
+    return platformStrategies()->storageStrategy()->sessionStorageNamespace(page, quota);
 }
 
 } // namespace WebCore
index cbd8733..0bc5116 100644 (file)
@@ -36,7 +36,6 @@ class Page;
 class SecurityOrigin;
 class StorageArea;
 
-// This interface is required for Chromium since these actions need to be proxied between processes.
 class StorageNamespace : public RefCounted<StorageNamespace> {
 public:
     static PassRefPtr<StorageNamespace> localStorageNamespace(const String& path, unsigned quota);
diff --git a/Source/WebCore/storage/StorageStrategy.cpp b/Source/WebCore/storage/StorageStrategy.cpp
new file mode 100644 (file)
index 0000000..82e6492
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "StorageStrategy.h"
+
+#include "StorageNamespaceImpl.h"
+
+#if USE(PLATFORM_STRATEGIES)
+
+namespace WebCore {
+
+PassRefPtr<StorageNamespace> StorageStrategy::localStorageNamespace(const String& path, unsigned quota)
+{
+    return StorageNamespaceImpl::localStorageNamespace(path, quota);
+}
+
+PassRefPtr<StorageNamespace> StorageStrategy::sessionStorageNamespace(Page*, unsigned quota)
+{
+    return StorageNamespaceImpl::sessionStorageNamespace(quota);
+}
+
+} // namespace WebCore
+
+#endif // USE(STORAGE_STRATEGIES)
diff --git a/Source/WebCore/storage/StorageStrategy.h b/Source/WebCore/storage/StorageStrategy.h
new file mode 100644 (file)
index 0000000..7642807
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef StorageStrategy_h
+#define StorageStrategy_h
+
+#if USE(PLATFORM_STRATEGIES)
+
+#include <wtf/Forward.h>
+
+namespace WebCore {
+
+class Page;
+class StorageNamespace;
+
+class StorageStrategy {
+public:
+    virtual PassRefPtr<StorageNamespace> localStorageNamespace(const String& path, unsigned quota);
+    static PassRefPtr<StorageNamespace> sessionStorageNamespace(Page*, unsigned quota);
+
+protected:
+    virtual ~StorageStrategy()
+    {
+    }
+};
+
+} // namespace WebCore
+
+#endif // USE(PLATFORM_STRATEGIES)
+
+#endif // StorageStrategy_h
index 13ceef1..1fbed43 100644 (file)
@@ -1,3 +1,17 @@
+2013-01-22  Anders Carlsson  <andersca@apple.com>
+
+        Use a platforom strategy for local storage
+        https://bugs.webkit.org/show_bug.cgi?id=107600
+
+        Reviewed by Andreas Kling.
+
+        Update for new storage strategy.
+
+        * WebCoreSupport/PlatformStrategiesEfl.cpp:
+        (PlatformStrategiesEfl::createStorageStrategy):
+        * WebCoreSupport/PlatformStrategiesEfl.h:
+        (PlatformStrategiesEfl):
+
 2013-01-22  Krzysztof Czech  <k.czech@samsung.com>
 
         [EFL] Adds Accessibility support to wk1.
index a783f50..49aa357 100644 (file)
@@ -81,6 +81,11 @@ VisitedLinkStrategy* PlatformStrategiesEfl::createVisitedLinkStrategy()
     return this;
 }
 
+StorageStrategy* PlatformStrategiesEfl::createStorageStrategy()
+{
+    return this;
+}
+
 // CookiesStrategy
 String PlatformStrategiesEfl::cookiesForDOM(const NetworkStorageSession& session, const KURL& firstParty, const KURL& url)
 {
index e7a9e8d..7470c2c 100644 (file)
 #include "PlatformStrategies.h"
 #include "PluginStrategy.h"
 #include "SharedWorkerStrategy.h"
+#include "StorageStrategy.h"
 #include "VisitedLinkStrategy.h"
 
-class PlatformStrategiesEfl : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::DatabaseStrategy, private WebCore::LoaderStrategy, private WebCore::PluginStrategy, private WebCore::SharedWorkerStrategy, private WebCore::VisitedLinkStrategy {
+class PlatformStrategiesEfl : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::DatabaseStrategy, private WebCore::LoaderStrategy, private WebCore::PluginStrategy, private WebCore::SharedWorkerStrategy, private WebCore::StorageStrategy, private WebCore::VisitedLinkStrategy {
 public:
     static void initialize();
 
@@ -43,6 +44,7 @@ private:
     virtual WebCore::PasteboardStrategy* createPasteboardStrategy();
     virtual WebCore::PluginStrategy* createPluginStrategy();
     virtual WebCore::SharedWorkerStrategy* createSharedWorkerStrategy();
+    virtual WebCore::StorageStrategy* createStorageStrategy();
     virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy();
 
     // WebCore::CookiesStrategy
index a5941ad..2164c44 100644 (file)
@@ -1,3 +1,17 @@
+2013-01-22  Anders Carlsson  <andersca@apple.com>
+
+        Use a platforom strategy for local storage
+        https://bugs.webkit.org/show_bug.cgi?id=107600
+
+        Reviewed by Andreas Kling.
+
+        Update for new storage strategy.
+
+        * WebCoreSupport/PlatformStrategiesGtk.cpp:
+        (PlatformStrategiesGtk::createStorageStrategy):
+        * WebCoreSupport/PlatformStrategiesGtk.h:
+        (PlatformStrategiesGtk):
+
 2013-01-22  Manuel Rego Casasnovas  <rego@igalia.com>
 
         [GTK] Add listener for direction-changed signal in WebKitWebView
index 014428b..f9ed5ad 100644 (file)
@@ -70,6 +70,11 @@ SharedWorkerStrategy* PlatformStrategiesGtk::createSharedWorkerStrategy()
     return this;
 }
 
+StorageStrategy* PlatformStrategiesGtk::createStorageStrategy()
+{
+    return this;
+}
+
 VisitedLinkStrategy* PlatformStrategiesGtk::createVisitedLinkStrategy()
 {
     return this;
index 1ddf465..b5f0762 100644 (file)
 #include "PlatformStrategies.h"
 #include "PluginStrategy.h"
 #include "SharedWorkerStrategy.h"
+#include "StorageStrategy.h"
 #include "VisitedLinkStrategy.h"
 
-class PlatformStrategiesGtk : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::DatabaseStrategy, private WebCore::LoaderStrategy, private WebCore::PluginStrategy, private WebCore::SharedWorkerStrategy, private WebCore::VisitedLinkStrategy {
+class PlatformStrategiesGtk : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::DatabaseStrategy, private WebCore::LoaderStrategy, private WebCore::PluginStrategy, private WebCore::SharedWorkerStrategy, private WebCore::StorageStrategy, private WebCore::VisitedLinkStrategy {
 public:
     static void initialize();
 
@@ -42,6 +43,7 @@ private:
     virtual WebCore::PasteboardStrategy* createPasteboardStrategy();
     virtual WebCore::PluginStrategy* createPluginStrategy();
     virtual WebCore::SharedWorkerStrategy* createSharedWorkerStrategy();
+    virtual WebCore::StorageStrategy* createStorageStrategy();
     virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy();
 
     // WebCore::CookiesStrategy
index 66322ce..4b15fca 100644 (file)
@@ -1,3 +1,17 @@
+2013-01-22  Anders Carlsson  <andersca@apple.com>
+
+        Use a platforom strategy for local storage
+        https://bugs.webkit.org/show_bug.cgi?id=107600
+
+        Reviewed by Andreas Kling.
+
+        Update for new storage strategy.
+
+        * WebCoreSupport/WebPlatformStrategies.h:
+        (WebPlatformStrategies):
+        * WebCoreSupport/WebPlatformStrategies.mm:
+        (WebPlatformStrategies::createStorageStrategy):
+
 2013-01-21  Kentaro Hara  <haraken@chromium.org>
 
         Implement UIEvent constructor
index 8a05211..8376ace 100644 (file)
 #include <WebCore/PlatformStrategies.h>
 #include <WebCore/PluginStrategy.h>
 #include <WebCore/SharedWorkerStrategy.h>
+#include <WebCore/StorageStrategy.h>
 #include <WebCore/VisitedLinkStrategy.h>
 
-class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::DatabaseStrategy, private WebCore::LoaderStrategy, private WebCore::PasteboardStrategy, private WebCore::PluginStrategy, private WebCore::SharedWorkerStrategy, private WebCore::VisitedLinkStrategy {
+class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::DatabaseStrategy, private WebCore::LoaderStrategy, private WebCore::PasteboardStrategy, private WebCore::PluginStrategy, private WebCore::SharedWorkerStrategy, private WebCore::StorageStrategy, private WebCore::VisitedLinkStrategy {
 public:
     static void initialize();
     
@@ -49,6 +50,7 @@ private:
     virtual WebCore::PasteboardStrategy* createPasteboardStrategy() OVERRIDE;
     virtual WebCore::PluginStrategy* createPluginStrategy() OVERRIDE;
     virtual WebCore::SharedWorkerStrategy* createSharedWorkerStrategy() OVERRIDE;
+    virtual WebCore::StorageStrategy* createStorageStrategy() override;
     virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy() OVERRIDE;
 
     // WebCore::CookiesStrategy
@@ -62,10 +64,16 @@ private:
     // WebCore::DatabaseStrategy
     // - Using default implementation.
 
+    // WebCore::LoaderStrategy
+    // - Using default implementation.
+
     // WebCore::PluginStrategy
     virtual void refreshPlugins() OVERRIDE;
     virtual void getPluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>&) OVERRIDE;
 
+    // WebCore::LoaderStrategy
+    // - Using default implementation.
+
     // WebCore::VisitedLinkStrategy
     virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash, const WebCore::KURL& baseURL, const WTF::AtomicString& attributeURL) OVERRIDE;
     virtual void addVisitedLink(WebCore::Page*, WebCore::LinkHash) OVERRIDE;
index 5eea7bb..8b36f11 100644 (file)
@@ -78,6 +78,11 @@ SharedWorkerStrategy* WebPlatformStrategies::createSharedWorkerStrategy()
     return this;
 }
 
+StorageStrategy* WebPlatformStrategies::createStorageStrategy()
+{
+    return this;
+}
+
 VisitedLinkStrategy* WebPlatformStrategies::createVisitedLinkStrategy()
 {
     return this;
index 647dbab..c3de8f8 100644 (file)
@@ -1,3 +1,17 @@
+2013-01-22  Anders Carlsson  <andersca@apple.com>
+
+        Use a platforom strategy for local storage
+        https://bugs.webkit.org/show_bug.cgi?id=107600
+
+        Reviewed by Andreas Kling.
+
+        Update for new storage strategy.
+
+        * WebCoreSupport/PlatformStrategiesQt.cpp:
+        (PlatformStrategiesQt::createStorageStrategy):
+        * WebCoreSupport/PlatformStrategiesQt.h:
+        (PlatformStrategiesQt):
+
 2013-01-21  Allan Sandfeld Jensen  <allan.jensen@digia.com>
 
         [Qt][WK1] Permission request callbacks for non-legacy notifications
index 30ca0db..70c8532 100644 (file)
@@ -90,6 +90,11 @@ SharedWorkerStrategy* PlatformStrategiesQt::createSharedWorkerStrategy()
     return this;
 }
 
+StorageStrategy* PlatformStrategiesQt::createStorageStrategy()
+{
+    return this;
+}
+
 VisitedLinkStrategy* PlatformStrategiesQt::createVisitedLinkStrategy()
 {
     return this;
index 51ef51b..daab259 100644 (file)
 #include <PlatformStrategies.h>
 #include <PluginStrategy.h>
 #include <SharedWorkerStrategy.h>
+#include <StorageStrategy.h>
 #include <VisitedLinkStrategy.h>
 
 namespace WebCore {
 class PasteboardStrategy;
 }
 
-class PlatformStrategiesQt : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::DatabaseStrategy, private WebCore::LoaderStrategy, private WebCore::PluginStrategy, private WebCore::SharedWorkerStrategy, private WebCore::VisitedLinkStrategy {
+class PlatformStrategiesQt : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::DatabaseStrategy, private WebCore::LoaderStrategy, private WebCore::PluginStrategy, private WebCore::SharedWorkerStrategy, private WebCore::StorageStrategy, private WebCore::VisitedLinkStrategy {
 public:
     static void initialize();
 
@@ -54,6 +55,7 @@ private:
     virtual WebCore::PasteboardStrategy* createPasteboardStrategy();
     virtual WebCore::PluginStrategy* createPluginStrategy();
     virtual WebCore::SharedWorkerStrategy* createSharedWorkerStrategy();
+    virtual WebCore::StorageStrategy* createStorageStrategy();
     virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy();
     
     // WebCore::CookiesStrategy
index 495ef2b..6b92aa6 100644 (file)
@@ -1,3 +1,17 @@
+2013-01-22  Anders Carlsson  <andersca@apple.com>
+
+        Use a platforom strategy for local storage
+        https://bugs.webkit.org/show_bug.cgi?id=107600
+
+        Reviewed by Andreas Kling.
+
+        Update for new storage strategy.
+
+        * WebCoreSupport/WebPlatformStrategies.cpp:
+        (WebPlatformStrategies::createStorageStrategy):
+        * WebCoreSupport/WebPlatformStrategies.h:
+        (WebPlatformStrategies):
+
 2013-01-18  Jer Noble  <jer.noble@apple.com>
 
         Unreviewed build fix. Remove deleted symbol from windows export list.
index a411e55..6367f18 100644 (file)
@@ -77,6 +77,11 @@ SharedWorkerStrategy* WebPlatformStrategies::createSharedWorkerStrategy()
     return this;
 }
 
+StorageStrategy* WebPlatformStrategies::createStorageStrategy()
+{
+    return this;
+}
+
 VisitedLinkStrategy* WebPlatformStrategies::createVisitedLinkStrategy()
 {
     return this;
index fb6f277..ab14afb 100644 (file)
 #include <WebCore/PlatformStrategies.h>
 #include <WebCore/PluginStrategy.h>
 #include <WebCore/SharedWorkerStrategy.h>
+#include <WebCore/StorageStrategy.h>
 #include <WebCore/VisitedLinkStrategy.h>
 
-class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::DatabaseStrategy, private WebCore::LoaderStrategy, private WebCore::PluginStrategy, private WebCore::SharedWorkerStrategy, private WebCore::VisitedLinkStrategy {
+class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::DatabaseStrategy, private WebCore::LoaderStrategy, private WebCore::PluginStrategy, private WebCore::SharedWorkerStrategy, private WebCore::StorageStrategy, private WebCore::VisitedLinkStrategy {
 public:
     static void initialize();
     
@@ -48,6 +49,7 @@ private:
     virtual WebCore::PasteboardStrategy* createPasteboardStrategy();
     virtual WebCore::PluginStrategy* createPluginStrategy();
     virtual WebCore::SharedWorkerStrategy* createSharedWorkerStrategy();
+    virtual WebCore::StorageStrategy* createStorageStrategy();
     virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy();
 
     // WebCore::CookiesStrategy
index ecf72f5..a2c6034 100644 (file)
@@ -1,3 +1,17 @@
+2013-01-22  Anders Carlsson  <andersca@apple.com>
+
+        Use a platforom strategy for local storage
+        https://bugs.webkit.org/show_bug.cgi?id=107600
+
+        Reviewed by Andreas Kling.
+
+        Update for new storage strategy.
+
+        * WebCoreSupport/PlatformStrategiesWinCE.cpp:
+        (PlatformStrategiesWinCE::createStorageStrategy):
+        * WebCoreSupport/PlatformStrategiesWinCE.h:
+        (PlatformStrategiesWinCE):
+
 2013-01-18  Seokju Kwon  <seokju.kwon@gmail.com>
 
         Add explicit keyword to constructors in platform-specific InspectorClient
index c86703e..733a4ee 100644 (file)
@@ -74,6 +74,11 @@ SharedWorkerStrategy* PlatformStrategiesWinCE::createSharedWorkerStrategy()
     return this;
 }
 
+StorageStrategy* PlatformStrategiesWinCE::createStorageStrategy()
+{
+    return this;
+}
+
 VisitedLinkStrategy* PlatformStrategiesWinCE::createVisitedLinkStrategy()
 {
     return this;
index aff8359..1208811 100644 (file)
 #include "PlatformStrategies.h"
 #include "PluginStrategy.h"
 #include "SharedWorkerStrategy.h"
+#include "StorageStrategy.h"
 #include "VisitedLinkStrategy.h"
 
-class PlatformStrategiesWinCE : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::DatabaseStrategy, private WebCore::LoaderStrategy, private WebCore::PluginStrategy, private WebCore::SharedWorkerStrategy, private WebCore::VisitedLinkStrategy {
+class PlatformStrategiesWinCE : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::DatabaseStrategy, private WebCore::LoaderStrategy, private WebCore::PluginStrategy, private WebCore::SharedWorkerStrategy, private WebCore::StorageStrategy, private WebCore::VisitedLinkStrategy {
 public:
     static void initialize();
 
@@ -47,6 +48,7 @@ private:
     virtual WebCore::PasteboardStrategy* createPasteboardStrategy();
     virtual WebCore::PluginStrategy* createPluginStrategy();
     virtual WebCore::SharedWorkerStrategy* createSharedWorkerStrategy();
+    virtual WebCore::StorageStrategy* createStorageStrategy();
     virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy();
 
     // WebCore::CookiesStrategy
index 9382e81..5d62d9f 100644 (file)
@@ -1,3 +1,18 @@
+2013-01-22  Anders Carlsson  <andersca@apple.com>
+
+        Use a platforom strategy for local storage
+        https://bugs.webkit.org/show_bug.cgi?id=107600
+
+        Reviewed by Andreas Kling.
+
+        Update for new storage strategy.
+
+        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
+        (WebKit::WebPlatformStrategies::createStorageStrategy):
+        (WebKit):
+        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
+        (WebPlatformStrategies):
+
 2013-01-21  Kentaro Hara  <haraken@chromium.org>
 
         Implement UIEvent constructor
index a5ca75a..d6b5bb3 100644 (file)
@@ -103,6 +103,11 @@ SharedWorkerStrategy* WebPlatformStrategies::createSharedWorkerStrategy()
     return this;
 }
 
+StorageStrategy* WebPlatformStrategies::createStorageStrategy()
+{
+    return this;
+}
+
 VisitedLinkStrategy* WebPlatformStrategies::createVisitedLinkStrategy()
 {
     return this;
index ea971e4..89f3961 100644 (file)
 #include <WebCore/PlatformStrategies.h>
 #include <WebCore/PluginStrategy.h>
 #include <WebCore/SharedWorkerStrategy.h>
+#include <WebCore/StorageStrategy.h>
 #include <WebCore/VisitedLinkStrategy.h>
 
 namespace WebKit {
 
-class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::DatabaseStrategy, private WebCore::LoaderStrategy, private WebCore::PasteboardStrategy, private WebCore::PluginStrategy, private WebCore::SharedWorkerStrategy, private WebCore::VisitedLinkStrategy {
+class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::DatabaseStrategy, private WebCore::LoaderStrategy, private WebCore::PasteboardStrategy, private WebCore::PluginStrategy, private WebCore::SharedWorkerStrategy, private WebCore::StorageStrategy, private WebCore::VisitedLinkStrategy {
 public:
     static void initialize();
     
@@ -53,6 +54,7 @@ private:
     virtual WebCore::PasteboardStrategy* createPasteboardStrategy() OVERRIDE;
     virtual WebCore::PluginStrategy* createPluginStrategy() OVERRIDE;
     virtual WebCore::SharedWorkerStrategy* createSharedWorkerStrategy() OVERRIDE;
+    virtual WebCore::StorageStrategy* createStorageStrategy() OVERRIDE;
     virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy() OVERRIDE;
 
     // WebCore::CookiesStrategy