<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[176696] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/176696">176696</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2014-12-02 16:30:17 -0800 (Tue, 02 Dec 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>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.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowcpp">trunk/Source/WebCore/page/DOMWindow.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageh">trunk/Source/WebCore/page/Page.h</a></li>
<li><a href="#trunkSourceWebCorepagePageConfigurationcpp">trunk/Source/WebCore/page/PageConfiguration.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageConfigurationh">trunk/Source/WebCore/page/PageConfiguration.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorestorageStorageNamespaceProvidercpp">trunk/Source/WebCore/storage/StorageNamespaceProvider.cpp</a></li>
<li><a href="#trunkSourceWebCorestorageStorageNamespaceProviderh">trunk/Source/WebCore/storage/StorageNamespaceProvider.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (176695 => 176696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-12-02 23:41:23 UTC (rev 176695)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-12-03 00:30:17 UTC (rev 176696)
</span><span class="lines">@@ -2482,6 +2482,7 @@
</span><span class="cx"> storage/StorageMap.cpp
</span><span class="cx"> storage/StorageNamespace.cpp
</span><span class="cx"> storage/StorageNamespaceImpl.cpp
</span><ins>+ storage/StorageNamespaceProvider.cpp
</ins><span class="cx"> storage/StorageStrategy.cpp
</span><span class="cx"> storage/StorageSyncManager.cpp
</span><span class="cx"> storage/StorageThread.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (176695 => 176696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-12-02 23:41:23 UTC (rev 176695)
+++ trunk/Source/WebCore/ChangeLog        2014-12-03 00:30:17 UTC (rev 176696)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+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.
+
</ins><span class="cx"> 2014-12-02 Beth Dakin <bdakin@apple.com>
</span><span class="cx">
</span><span class="cx"> More build fixing.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (176695 => 176696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-12-02 23:41:23 UTC (rev 176695)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-12-03 00:30:17 UTC (rev 176696)
</span><span class="lines">@@ -17858,6 +17858,7 @@
</span><span class="cx"> <ClCompile Include="..\storage\StorageMap.cpp" />
</span><span class="cx"> <ClCompile Include="..\storage\StorageNamespace.cpp" />
</span><span class="cx"> <ClCompile Include="..\storage\StorageNamespaceImpl.cpp" />
</span><ins>+ <ClCompile Include="..\storage\StorageNamespaceProvider.cpp" />
</ins><span class="cx"> <ClCompile Include="..\storage\StorageSyncManager.cpp" />
</span><span class="cx"> <ClCompile Include="..\storage\StorageThread.cpp" />
</span><span class="cx"> <ClCompile Include="..\storage\StorageTracker.cpp" />
</span><span class="lines">@@ -21259,6 +21260,7 @@
</span><span class="cx"> <ClInclude Include="..\storage\StorageMap.h" />
</span><span class="cx"> <ClInclude Include="..\storage\StorageNamespace.h" />
</span><span class="cx"> <ClInclude Include="..\storage\StorageNamespaceImpl.h" />
</span><ins>+ <ClInclude Include="..\storage\StorageNamespaceProvider.h" />
</ins><span class="cx"> <ClInclude Include="..\storage\StorageSyncManager.h" />
</span><span class="cx"> <ClInclude Include="..\storage\StorageThread.h" />
</span><span class="cx"> <ClInclude Include="..\storage\StorageTracker.h" />
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (176695 => 176696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-12-02 23:41:23 UTC (rev 176695)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-12-03 00:30:17 UTC (rev 176696)
</span><span class="lines">@@ -4704,6 +4704,9 @@
</span><span class="cx"> <ClCompile Include="..\storage\StorageNamespaceImpl.cpp">
</span><span class="cx"> <Filter>storage</Filter>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\storage\StorageNamespaceProvider.cpp">
+ <Filter>storage</Filter>
+ </ClCompile>
</ins><span class="cx"> <ClCompile Include="..\storage\StorageSyncManager.cpp">
</span><span class="cx"> <Filter>storage</Filter>
</span><span class="cx"> </ClCompile>
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (176695 => 176696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-12-02 23:41:23 UTC (rev 176695)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-12-03 00:30:17 UTC (rev 176696)
</span><span class="lines">@@ -699,6 +699,8 @@
</span><span class="cx">                 1A3586DF15264C450022A659 /* RenderMultiColumnFlowThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3586DD15264C450022A659 /* RenderMultiColumnFlowThread.cpp */; };
</span><span class="cx">                 1A3586E015264C450022A659 /* RenderMultiColumnFlowThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3586DE15264C450022A659 /* RenderMultiColumnFlowThread.h */; };
</span><span class="cx">                 1A3586E115264F950022A659 /* SVGAnimatedIntegerOptionalInteger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 71E623CE151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.cpp */; };
</span><ins>+                1A37636B1A2E68BB009A7EE2 /* StorageNamespaceProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3763691A2E68BB009A7EE2 /* StorageNamespaceProvider.cpp */; };
+                1A37636C1A2E68BB009A7EE2 /* StorageNamespaceProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A37636A1A2E68BB009A7EE2 /* StorageNamespaceProvider.h */; };
</ins><span class="cx">                 1A3FF9C315265359002288A1 /* RenderNamedFlowThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC85F23E1519187300BC17BE /* RenderNamedFlowThread.cpp */; };
</span><span class="cx">                 1A494BFA0A122F4400FDAFC1 /* JSHTMLElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A494BF80A122F4400FDAFC1 /* JSHTMLElement.cpp */; };
</span><span class="cx">                 1A494BFB0A122F4400FDAFC1 /* JSHTMLElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A494BF90A122F4400FDAFC1 /* JSHTMLElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -7683,6 +7685,8 @@
</span><span class="cx">                 1A2E6E780CC556D5004A2062 /* SQLiteAuthorizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SQLiteAuthorizer.cpp; path = sql/SQLiteAuthorizer.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 1A3586DD15264C450022A659 /* RenderMultiColumnFlowThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMultiColumnFlowThread.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 1A3586DE15264C450022A659 /* RenderMultiColumnFlowThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMultiColumnFlowThread.h; sourceTree = "<group>"; };
</span><ins>+                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>"; };
</ins><span class="cx">                 1A494BBB0A122DCD00FDAFC1 /* HTMLElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLElement.idl; sourceTree = "<group>"; };
</span><span class="cx">                 1A494BF80A122F4400FDAFC1 /* JSHTMLElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLElement.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 1A494BF90A122F4400FDAFC1 /* JSHTMLElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLElement.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -15130,6 +15134,8 @@
</span><span class="cx">                                 C50D0E810FF4272900AC2644 /* StorageNamespace.h */,
</span><span class="cx">                                 C55E38BC10040D5D00A56BDB /* StorageNamespaceImpl.cpp */,
</span><span class="cx">                                 C55E38BB10040D5D00A56BDB /* StorageNamespaceImpl.h */,
</span><ins>+                                1A3763691A2E68BB009A7EE2 /* StorageNamespaceProvider.cpp */,
+                                1A37636A1A2E68BB009A7EE2 /* StorageNamespaceProvider.h */,
</ins><span class="cx">                                 1AB09DB216AF5F6C008538E7 /* StorageStrategy.cpp */,
</span><span class="cx">                                 1AB09DB316AF5F6C008538E7 /* StorageStrategy.h */,
</span><span class="cx">                                 C5102D930FD9AA2D00FAFF04 /* StorageSyncManager.cpp */,
</span><span class="lines">@@ -24779,6 +24785,7 @@
</span><span class="cx">                                 FDF09DC91399B62200688E5B /* JSBiquadFilterNode.h in Headers */,
</span><span class="cx">                                 2E2D99CE10E2BBDA00496337 /* JSBlob.h in Headers */,
</span><span class="cx">                                 1449E24C107D4A8400B5793F /* JSCallbackData.h in Headers */,
</span><ins>+                                1A37636C1A2E68BB009A7EE2 /* StorageNamespaceProvider.h in Headers */,
</ins><span class="cx">                                 65DF323A09D1DE65000BE325 /* JSCanvasGradient.h in Headers */,
</span><span class="cx">                                 65DF323C09D1DE65000BE325 /* JSCanvasPattern.h in Headers */,
</span><span class="cx">                                 65DF323C09D1DE65001BE325 /* JSCanvasProxy.h in Headers */,
</span><span class="lines">@@ -28558,6 +28565,7 @@
</span><span class="cx">                                 1A750DD40A90E729000FF215 /* JSNodeIteratorCustom.cpp in Sources */,
</span><span class="cx">                                 BCD9C2C20C17B69E005C90A2 /* JSNodeList.cpp in Sources */,
</span><span class="cx">                                 BCD9C2650C17AA67005C90A2 /* JSNodeListCustom.cpp in Sources */,
</span><ins>+                                1A37636B1A2E68BB009A7EE2 /* StorageNamespaceProvider.cpp in Sources */,
</ins><span class="cx">                                 65DF31FD09D1CC60000BE325 /* JSNotation.cpp in Sources */,
</span><span class="cx">                                 33503CA310179AD7003B47E1 /* JSNotification.cpp in Sources */,
</span><span class="cx">                                 33503CA510179AD7003B47E1 /* JSNotificationCenter.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.cpp (176695 => 176696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.cpp        2014-12-02 23:41:23 UTC (rev 176695)
+++ trunk/Source/WebCore/page/DOMWindow.cpp        2014-12-03 00:30:17 UTC (rev 176696)
</span><span class="lines">@@ -92,6 +92,7 @@
</span><span class="cx"> #include "Storage.h"
</span><span class="cx"> #include "StorageArea.h"
</span><span class="cx"> #include "StorageNamespace.h"
</span><ins>+#include "StorageNamespaceProvider.h"
</ins><span class="cx"> #include "StyleMedia.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><span class="cx"> #include "SuddenTermination.h"
</span><span class="lines">@@ -856,10 +857,18 @@
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="cx"> RefPtr<StorageArea> storageArea;
</span><del>- if (!document->securityOrigin()->canAccessLocalStorage(document->topOrigin()))
- storageArea = page->group().transientLocalStorage(document->topOrigin())->storageArea(document->securityOrigin());
- else
- storageArea = page->group().localStorage()->storageArea(document->securityOrigin());
</del><ins>+ 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());
+ }
</ins><span class="cx">
</span><span class="cx"> if (!storageArea->canAccessStorage(m_frame)) {
</span><span class="cx"> ec = SECURITY_ERR;
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (176695 => 176696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2014-12-02 23:41:23 UTC (rev 176695)
+++ trunk/Source/WebCore/page/Page.cpp        2014-12-03 00:30:17 UTC (rev 176696)
</span><span class="lines">@@ -79,6 +79,7 @@
</span><span class="cx"> #include "SharedBuffer.h"
</span><span class="cx"> #include "StorageArea.h"
</span><span class="cx"> #include "StorageNamespace.h"
</span><ins>+#include "StorageNamespaceProvider.h"
</ins><span class="cx"> #include "StyleResolver.h"
</span><span class="cx"> #include "SubframeLoader.h"
</span><span class="cx"> #include "TextResourceDecoder.h"
</span><span class="lines">@@ -201,6 +202,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> , m_lastSpatialNavigationCandidatesCount(0) // NOTE: Only called from Internals for Spatial Navigation testing.
</span><span class="cx"> , m_framesHandlingBeforeUnloadEvent(0)
</span><ins>+ , m_storageNamespaceProvider(WTF::move(pageConfiguration.storageNamespaceProvider))
</ins><span class="cx"> , m_userContentController(WTF::move(pageConfiguration.userContentController))
</span><span class="cx"> , m_visitedLinkStore(*WTF::move(pageConfiguration.visitedLinkStore))
</span><span class="cx"> , m_sessionID(SessionID::defaultSessionID())
</span><span class="lines">@@ -211,6 +213,8 @@
</span><span class="cx">
</span><span class="cx"> setTimerThrottlingEnabled(m_viewState & ViewState::IsVisuallyIdle);
</span><span class="cx">
</span><ins>+ if (m_storageNamespaceProvider)
+ m_storageNamespaceProvider->addPage(*this);
</ins><span class="cx"> if (m_userContentController)
</span><span class="cx"> m_userContentController->addPage(*this);
</span><span class="cx">
</span><span class="lines">@@ -1611,6 +1615,17 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+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.
+}
+
</ins><span class="cx"> VisitedLinkStore& Page::visitedLinkStore()
</span><span class="cx"> {
</span><span class="cx"> return m_visitedLinkStore;
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.h (176695 => 176696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.h        2014-12-02 23:41:23 UTC (rev 176695)
+++ trunk/Source/WebCore/page/Page.h        2014-12-03 00:30:17 UTC (rev 176696)
</span><span class="lines">@@ -100,6 +100,7 @@
</span><span class="cx"> class ScrollingCoordinator;
</span><span class="cx"> class Settings;
</span><span class="cx"> class StorageNamespace;
</span><ins>+class StorageNamespaceProvider;
</ins><span class="cx"> class UserContentController;
</span><span class="cx"> class ValidationMessageClient;
</span><span class="cx"> class ViewStateChangeObserver;
</span><span class="lines">@@ -398,6 +399,9 @@
</span><span class="cx"> void setLastSpatialNavigationCandidateCount(unsigned count) { m_lastSpatialNavigationCandidatesCount = count; }
</span><span class="cx"> unsigned lastSpatialNavigationCandidateCount() const { return m_lastSpatialNavigationCandidatesCount; }
</span><span class="cx">
</span><ins>+ StorageNamespaceProvider* storageNamespaceProvider() { return m_storageNamespaceProvider.get(); }
+ void setStorageNamespaceProvider(PassRef<StorageNamespaceProvider>);
+
</ins><span class="cx"> UserContentController* userContentController() { return m_userContentController.get(); }
</span><span class="cx"> void setUserContentController(UserContentController*);
</span><span class="cx">
</span><span class="lines">@@ -566,6 +570,7 @@
</span><span class="cx"> unsigned m_lastSpatialNavigationCandidatesCount;
</span><span class="cx"> unsigned m_framesHandlingBeforeUnloadEvent;
</span><span class="cx">
</span><ins>+ RefPtr<StorageNamespaceProvider> m_storageNamespaceProvider;
</ins><span class="cx"> RefPtr<UserContentController> m_userContentController;
</span><span class="cx"> Ref<VisitedLinkStore> m_visitedLinkStore;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageConfigurationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageConfiguration.cpp (176695 => 176696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageConfiguration.cpp        2014-12-02 23:41:23 UTC (rev 176695)
+++ trunk/Source/WebCore/page/PageConfiguration.cpp        2014-12-03 00:30:17 UTC (rev 176696)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include "PageConfiguration.h"
</span><span class="cx">
</span><span class="cx"> #include "BackForwardClient.h"
</span><ins>+#include "StorageNamespaceProvider.h"
</ins><span class="cx"> #include "UserContentController.h"
</span><span class="cx"> #include "VisitedLinkStore.h"
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageConfigurationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageConfiguration.h (176695 => 176696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageConfiguration.h        2014-12-02 23:41:23 UTC (rev 176695)
+++ trunk/Source/WebCore/page/PageConfiguration.h        2014-12-03 00:30:17 UTC (rev 176696)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> class InspectorClient;
</span><span class="cx"> class PlugInClient;
</span><span class="cx"> class ProgressTrackerClient;
</span><ins>+class StorageNamespaceProvider;
</ins><span class="cx"> class UserContentController;
</span><span class="cx"> class ValidationMessageClient;
</span><span class="cx"> class VisitedLinkStore;
</span><span class="lines">@@ -69,6 +70,7 @@
</span><span class="cx"> FrameLoaderClient* loaderClientForMainFrame;
</span><span class="cx"> DiagnosticLoggingClient* diagnosticLoggingClient;
</span><span class="cx">
</span><ins>+ RefPtr<StorageNamespaceProvider> storageNamespaceProvider;
</ins><span class="cx"> RefPtr<UserContentController> userContentController;
</span><span class="cx"> RefPtr<VisitedLinkStore> visitedLinkStore;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorestorageStorageNamespaceProvidercpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/storage/StorageNamespaceProvider.cpp (0 => 176696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/storage/StorageNamespaceProvider.cpp         (rev 0)
+++ trunk/Source/WebCore/storage/StorageNamespaceProvider.cpp        2014-12-03 00:30:17 UTC (rev 176696)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+/*
+ * 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;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorestorageStorageNamespaceProviderh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/storage/StorageNamespaceProvider.h (0 => 176696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/storage/StorageNamespaceProvider.h         (rev 0)
+++ trunk/Source/WebCore/storage/StorageNamespaceProvider.h        2014-12-03 00:30:17 UTC (rev 176696)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+/*
+ * 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
</ins></span></pre>
</div>
</div>
</body>
</html>