Begin stubbing out a StorageNamespaceProvider class
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Dec 2014 00:30:17 +0000 (00:30 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Dec 2014 00:30:17 +0000 (00:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=139203

Reviewed by Tim Horton.

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Add new files.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::localStorage):
If the page has a storage namespace provider, get the local storage from it.

* page/Page.cpp:
(WebCore::Page::Page):
Move the storage namespace provider from the configuration.

(WebCore::Page::setStorageNamespaceProvider):
Add a setter. This will be used by setGroupName.

* page/Page.h:
(WebCore::Page::storageNamespaceProvider):
Add a getter.

* page/PageConfiguration.cpp:
* page/PageConfiguration.h:
Add a storage namespace provider member.

* storage/StorageNamespaceProvider.cpp:
(WebCore::StorageNamespaceProvider::StorageNamespaceProvider):
(WebCore::StorageNamespaceProvider::~StorageNamespaceProvider):
(WebCore::StorageNamespaceProvider::addPage):
(WebCore::StorageNamespaceProvider::removePage):
(WebCore::StorageNamespaceProvider::localStorageNamespace):
(WebCore::StorageNamespaceProvider::transientLocalStorageNamespace):
* storage/StorageNamespaceProvider.h:
Stub out a storage namespace provider class.

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

12 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/page/PageConfiguration.cpp
Source/WebCore/page/PageConfiguration.h
Source/WebCore/storage/StorageNamespaceProvider.cpp [new file with mode: 0644]
Source/WebCore/storage/StorageNamespaceProvider.h [new file with mode: 0644]

index fa2c06f..97c2329 100644 (file)
@@ -2482,6 +2482,7 @@ set(WebCore_SOURCES
     storage/StorageMap.cpp
     storage/StorageNamespace.cpp
     storage/StorageNamespaceImpl.cpp
+    storage/StorageNamespaceProvider.cpp
     storage/StorageStrategy.cpp
     storage/StorageSyncManager.cpp
     storage/StorageThread.cpp
index 9f45bf5..69e198a 100644 (file)
@@ -1,3 +1,45 @@
+2014-12-02  Anders Carlsson  <andersca@apple.com>
+
+        Begin stubbing out a StorageNamespaceProvider class
+        https://bugs.webkit.org/show_bug.cgi?id=139203
+
+        Reviewed by Tim Horton.
+
+        * CMakeLists.txt:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        Add new files.
+
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::localStorage):
+        If the page has a storage namespace provider, get the local storage from it.
+
+        * page/Page.cpp:
+        (WebCore::Page::Page):
+        Move the storage namespace provider from the configuration.
+
+        (WebCore::Page::setStorageNamespaceProvider):
+        Add a setter. This will be used by setGroupName.
+
+        * page/Page.h:
+        (WebCore::Page::storageNamespaceProvider):
+        Add a getter.
+
+        * page/PageConfiguration.cpp:
+        * page/PageConfiguration.h:
+        Add a storage namespace provider member.
+
+        * storage/StorageNamespaceProvider.cpp:
+        (WebCore::StorageNamespaceProvider::StorageNamespaceProvider):
+        (WebCore::StorageNamespaceProvider::~StorageNamespaceProvider):
+        (WebCore::StorageNamespaceProvider::addPage):
+        (WebCore::StorageNamespaceProvider::removePage):
+        (WebCore::StorageNamespaceProvider::localStorageNamespace):
+        (WebCore::StorageNamespaceProvider::transientLocalStorageNamespace):
+        * storage/StorageNamespaceProvider.h:
+        Stub out a storage namespace provider class.
+
 2014-12-02  Beth Dakin  <bdakin@apple.com>
 
         More build fixing.
index 9653d86..41527a0 100644 (file)
     <ClCompile Include="..\storage\StorageMap.cpp" />
     <ClCompile Include="..\storage\StorageNamespace.cpp" />
     <ClCompile Include="..\storage\StorageNamespaceImpl.cpp" />
+    <ClCompile Include="..\storage\StorageNamespaceProvider.cpp" />
     <ClCompile Include="..\storage\StorageSyncManager.cpp" />
     <ClCompile Include="..\storage\StorageThread.cpp" />
     <ClCompile Include="..\storage\StorageTracker.cpp" />
     <ClInclude Include="..\storage\StorageMap.h" />
     <ClInclude Include="..\storage\StorageNamespace.h" />
     <ClInclude Include="..\storage\StorageNamespaceImpl.h" />
+    <ClInclude Include="..\storage\StorageNamespaceProvider.h" />
     <ClInclude Include="..\storage\StorageSyncManager.h" />
     <ClInclude Include="..\storage\StorageThread.h" />
     <ClInclude Include="..\storage\StorageTracker.h" />
index e6d44ef..8c5a3fa 100644 (file)
     <ClCompile Include="..\storage\StorageNamespaceImpl.cpp">
       <Filter>storage</Filter>
     </ClCompile>
+    <ClCompile Include="..\storage\StorageNamespaceProvider.cpp">
+      <Filter>storage</Filter>
+    </ClCompile>
     <ClCompile Include="..\storage\StorageSyncManager.cpp">
       <Filter>storage</Filter>
     </ClCompile>
index 348fe83..13d0880 100644 (file)
                1A3586DF15264C450022A659 /* RenderMultiColumnFlowThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3586DD15264C450022A659 /* RenderMultiColumnFlowThread.cpp */; };
                1A3586E015264C450022A659 /* RenderMultiColumnFlowThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3586DE15264C450022A659 /* RenderMultiColumnFlowThread.h */; };
                1A3586E115264F950022A659 /* SVGAnimatedIntegerOptionalInteger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 71E623CE151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.cpp */; };
+               1A37636B1A2E68BB009A7EE2 /* StorageNamespaceProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3763691A2E68BB009A7EE2 /* StorageNamespaceProvider.cpp */; };
+               1A37636C1A2E68BB009A7EE2 /* StorageNamespaceProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A37636A1A2E68BB009A7EE2 /* StorageNamespaceProvider.h */; };
                1A3FF9C315265359002288A1 /* RenderNamedFlowThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC85F23E1519187300BC17BE /* RenderNamedFlowThread.cpp */; };
                1A494BFA0A122F4400FDAFC1 /* JSHTMLElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A494BF80A122F4400FDAFC1 /* JSHTMLElement.cpp */; };
                1A494BFB0A122F4400FDAFC1 /* JSHTMLElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A494BF90A122F4400FDAFC1 /* JSHTMLElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
                1A2E6E780CC556D5004A2062 /* SQLiteAuthorizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SQLiteAuthorizer.cpp; path = sql/SQLiteAuthorizer.cpp; sourceTree = "<group>"; };
                1A3586DD15264C450022A659 /* RenderMultiColumnFlowThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMultiColumnFlowThread.cpp; sourceTree = "<group>"; };
                1A3586DE15264C450022A659 /* RenderMultiColumnFlowThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMultiColumnFlowThread.h; sourceTree = "<group>"; };
+               1A3763691A2E68BB009A7EE2 /* StorageNamespaceProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageNamespaceProvider.cpp; sourceTree = "<group>"; };
+               1A37636A1A2E68BB009A7EE2 /* StorageNamespaceProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageNamespaceProvider.h; sourceTree = "<group>"; };
                1A494BBB0A122DCD00FDAFC1 /* HTMLElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLElement.idl; sourceTree = "<group>"; };
                1A494BF80A122F4400FDAFC1 /* JSHTMLElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLElement.cpp; sourceTree = "<group>"; };
                1A494BF90A122F4400FDAFC1 /* JSHTMLElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLElement.h; sourceTree = "<group>"; };
                                C50D0E810FF4272900AC2644 /* StorageNamespace.h */,
                                C55E38BC10040D5D00A56BDB /* StorageNamespaceImpl.cpp */,
                                C55E38BB10040D5D00A56BDB /* StorageNamespaceImpl.h */,
+                               1A3763691A2E68BB009A7EE2 /* StorageNamespaceProvider.cpp */,
+                               1A37636A1A2E68BB009A7EE2 /* StorageNamespaceProvider.h */,
                                1AB09DB216AF5F6C008538E7 /* StorageStrategy.cpp */,
                                1AB09DB316AF5F6C008538E7 /* StorageStrategy.h */,
                                C5102D930FD9AA2D00FAFF04 /* StorageSyncManager.cpp */,
                                FDF09DC91399B62200688E5B /* JSBiquadFilterNode.h in Headers */,
                                2E2D99CE10E2BBDA00496337 /* JSBlob.h in Headers */,
                                1449E24C107D4A8400B5793F /* JSCallbackData.h in Headers */,
+                               1A37636C1A2E68BB009A7EE2 /* StorageNamespaceProvider.h in Headers */,
                                65DF323A09D1DE65000BE325 /* JSCanvasGradient.h in Headers */,
                                65DF323C09D1DE65000BE325 /* JSCanvasPattern.h in Headers */,
                                65DF323C09D1DE65001BE325 /* JSCanvasProxy.h in Headers */,
                                1A750DD40A90E729000FF215 /* JSNodeIteratorCustom.cpp in Sources */,
                                BCD9C2C20C17B69E005C90A2 /* JSNodeList.cpp in Sources */,
                                BCD9C2650C17AA67005C90A2 /* JSNodeListCustom.cpp in Sources */,
+                               1A37636B1A2E68BB009A7EE2 /* StorageNamespaceProvider.cpp in Sources */,
                                65DF31FD09D1CC60000BE325 /* JSNotation.cpp in Sources */,
                                33503CA310179AD7003B47E1 /* JSNotification.cpp in Sources */,
                                33503CA510179AD7003B47E1 /* JSNotificationCenter.cpp in Sources */,
index 8a3e822..0fd32a2 100644 (file)
@@ -92,6 +92,7 @@
 #include "Storage.h"
 #include "StorageArea.h"
 #include "StorageNamespace.h"
+#include "StorageNamespaceProvider.h"
 #include "StyleMedia.h"
 #include "StyleResolver.h"
 #include "SuddenTermination.h"
@@ -856,10 +857,18 @@ Storage* DOMWindow::localStorage(ExceptionCode& ec) const
         return nullptr;
 
     RefPtr<StorageArea> storageArea;
-    if (!document->securityOrigin()->canAccessLocalStorage(document->topOrigin()))
-        storageArea = page->group().transientLocalStorage(document->topOrigin())->storageArea(document->securityOrigin());
-    else
-        storageArea = page->group().localStorage()->storageArea(document->securityOrigin());
+    if (auto* storageNamespaceProvider = page->storageNamespaceProvider()) {
+        if (document->securityOrigin()->canAccessLocalStorage(document->topOrigin()))
+            storageArea = storageNamespaceProvider->localStorageNamespace().storageArea(document->securityOrigin());
+        else
+            storageArea = storageNamespaceProvider->transientLocalStorageNamespace(*document->topOrigin()).storageArea(document->securityOrigin());
+    } else {
+        // FIXME: Remove this once everyone has transitioned away from using the page group local storage.
+        if (!document->securityOrigin()->canAccessLocalStorage(document->topOrigin()))
+            storageArea = page->group().transientLocalStorage(document->topOrigin())->storageArea(document->securityOrigin());
+        else
+            storageArea = page->group().localStorage()->storageArea(document->securityOrigin());
+    }
 
     if (!storageArea->canAccessStorage(m_frame)) {
         ec = SECURITY_ERR;
index 2653370..1520376 100644 (file)
@@ -79,6 +79,7 @@
 #include "SharedBuffer.h"
 #include "StorageArea.h"
 #include "StorageNamespace.h"
+#include "StorageNamespaceProvider.h"
 #include "StyleResolver.h"
 #include "SubframeLoader.h"
 #include "TextResourceDecoder.h"
@@ -201,6 +202,7 @@ Page::Page(PageConfiguration& pageConfiguration)
 #endif
     , m_lastSpatialNavigationCandidatesCount(0) // NOTE: Only called from Internals for Spatial Navigation testing.
     , m_framesHandlingBeforeUnloadEvent(0)
+    , m_storageNamespaceProvider(WTF::move(pageConfiguration.storageNamespaceProvider))
     , m_userContentController(WTF::move(pageConfiguration.userContentController))
     , m_visitedLinkStore(*WTF::move(pageConfiguration.visitedLinkStore))
     , m_sessionID(SessionID::defaultSessionID())
@@ -211,6 +213,8 @@ Page::Page(PageConfiguration& pageConfiguration)
     
     setTimerThrottlingEnabled(m_viewState & ViewState::IsVisuallyIdle);
 
+    if (m_storageNamespaceProvider)
+        m_storageNamespaceProvider->addPage(*this);
     if (m_userContentController)
         m_userContentController->addPage(*this);
 
@@ -1611,6 +1615,17 @@ void Page::setUserContentController(UserContentController* userContentController
     }
 }
 
+void Page::setStorageNamespaceProvider(PassRef<StorageNamespaceProvider> storageNamespaceProvider)
+{
+    if (m_storageNamespaceProvider)
+        m_storageNamespaceProvider->removePage(*this);
+
+    m_storageNamespaceProvider = WTF::move(storageNamespaceProvider);
+    m_storageNamespaceProvider->addPage(*this);
+
+    // This needs to reset all the local storage namespaces of all the pages.
+}
+
 VisitedLinkStore& Page::visitedLinkStore()
 {
     return m_visitedLinkStore;
index f4d7b8f..65bd862 100644 (file)
@@ -100,6 +100,7 @@ class ScrollableArea;
 class ScrollingCoordinator;
 class Settings;
 class StorageNamespace;
+class StorageNamespaceProvider;
 class UserContentController;
 class ValidationMessageClient;
 class ViewStateChangeObserver;
@@ -398,6 +399,9 @@ public:
     void setLastSpatialNavigationCandidateCount(unsigned count) { m_lastSpatialNavigationCandidatesCount = count; }
     unsigned lastSpatialNavigationCandidateCount() const { return m_lastSpatialNavigationCandidatesCount; }
 
+    StorageNamespaceProvider* storageNamespaceProvider() { return m_storageNamespaceProvider.get(); }
+    void setStorageNamespaceProvider(PassRef<StorageNamespaceProvider>);
+
     UserContentController* userContentController() { return m_userContentController.get(); }
     void setUserContentController(UserContentController*);
 
@@ -566,6 +570,7 @@ private:
     unsigned m_lastSpatialNavigationCandidatesCount;
     unsigned m_framesHandlingBeforeUnloadEvent;
 
+    RefPtr<StorageNamespaceProvider> m_storageNamespaceProvider;
     RefPtr<UserContentController> m_userContentController;
     Ref<VisitedLinkStore> m_visitedLinkStore;
 
index 7270b7e..f26bece 100644 (file)
@@ -27,6 +27,7 @@
 #include "PageConfiguration.h"
 
 #include "BackForwardClient.h"
+#include "StorageNamespaceProvider.h"
 #include "UserContentController.h"
 #include "VisitedLinkStore.h"
 
index 909b723..d3ab694 100644 (file)
@@ -44,6 +44,7 @@ class FrameLoaderClient;
 class InspectorClient;
 class PlugInClient;
 class ProgressTrackerClient;
+class StorageNamespaceProvider;
 class UserContentController;
 class ValidationMessageClient;
 class VisitedLinkStore;
@@ -69,6 +70,7 @@ public:
     FrameLoaderClient* loaderClientForMainFrame;
     DiagnosticLoggingClient* diagnosticLoggingClient;
 
+    RefPtr<StorageNamespaceProvider> storageNamespaceProvider;
     RefPtr<UserContentController> userContentController;
     RefPtr<VisitedLinkStore> visitedLinkStore;
 };
diff --git a/Source/WebCore/storage/StorageNamespaceProvider.cpp b/Source/WebCore/storage/StorageNamespaceProvider.cpp
new file mode 100644 (file)
index 0000000..90cc1c7
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2014 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 "StorageNamespaceProvider.h"
+
+#include "StorageNamespace.h"
+
+namespace WebCore {
+
+StorageNamespaceProvider::StorageNamespaceProvider()
+{
+}
+
+StorageNamespaceProvider::~StorageNamespaceProvider()
+{
+    ASSERT(m_pages.isEmpty());
+}
+
+void StorageNamespaceProvider::addPage(Page& page)
+{
+    ASSERT(!m_pages.contains(&page));
+
+    m_pages.add(&page);
+}
+
+void StorageNamespaceProvider::removePage(Page& page)
+{
+    ASSERT(m_pages.contains(&page));
+
+    m_pages.remove(&page);
+}
+
+StorageNamespace& StorageNamespaceProvider::localStorageNamespace()
+{
+    if (!m_localStorageNamespace)
+        m_localStorageNamespace = createLocalStorageNamespace();
+
+    return *m_localStorageNamespace;
+}
+
+StorageNamespace& StorageNamespaceProvider::transientLocalStorageNamespace(SecurityOrigin& securityOrigin)
+{
+    auto& slot = m_transientLocalStorageMap.add(&securityOrigin, nullptr).iterator->value;
+    if (!slot)
+        slot = createTransientLocalStorageNamespace(securityOrigin);
+
+    return *slot;
+}
+
+}
diff --git a/Source/WebCore/storage/StorageNamespaceProvider.h b/Source/WebCore/storage/StorageNamespaceProvider.h
new file mode 100644 (file)
index 0000000..746de67
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2014 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 StorageNamespaceProvider_h
+#define StorageNamespaceProvider_h
+
+#include <WebCore/SecurityOriginHash.h>
+#include <wtf/Forward.h>
+#include <wtf/HashMap.h>
+#include <wtf/HashSet.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class Page;
+class SecurityOrigin;
+class StorageNamespace;
+
+class StorageNamespaceProvider : public RefCounted<StorageNamespaceProvider> {
+public:
+    StorageNamespaceProvider();
+    virtual ~StorageNamespaceProvider();
+
+    StorageNamespace& localStorageNamespace();
+    StorageNamespace& transientLocalStorageNamespace(SecurityOrigin&);
+    virtual RefPtr<StorageNamespace> createSessionStorageNamespace(Page&) = 0;
+
+    void addPage(Page&);
+    void removePage(Page&);
+
+private:
+    virtual RefPtr<StorageNamespace> createLocalStorageNamespace() = 0;
+    virtual RefPtr<StorageNamespace> createTransientLocalStorageNamespace(SecurityOrigin&) = 0;
+
+    HashSet<Page*> m_pages;
+
+    RefPtr<StorageNamespace> m_localStorageNamespace;
+    HashMap<RefPtr<SecurityOrigin>, RefPtr<StorageNamespace>> m_transientLocalStorageMap;
+};
+
+}
+
+#endif // StorageNamespaceProvider_h