<!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>[178524] trunk/Source/WebKit2</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/178524">178524</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2015-01-15 12:24:41 -0800 (Thu, 15 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Give WebsiteDataStore a StorageManager
https://bugs.webkit.org/show_bug.cgi?id=140505

Reviewed by Andreas Kling.

The process pool storage manager is still around but is only used for clearing data. It will be removed
completely in an upcoming commit.

* UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
(API::WebsiteDataStore::defaultDataStoreConfiguration):
Set up the local storage directory.

* UIProcess/API/Cocoa/WKProcessPool.mm:
(websiteDataDirectoryURL):
Export this so it can be called from APIWebsiteDataStoreCocoa.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::createNewPage):
Call WebsiteDataStore::cloneSessionData instead.

* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::websiteDataStore):
Add getter.

* UIProcess/WebProcessPool.cpp:
(WebKit::websiteDataStoreConfiguration):
Update this to take a WebProcessPoolConfiguration object and assign the local storage directory.

(WebKit::WebProcessPool::WebProcessPool):
Pass the configuration to websiteDataStoreConfiguration.

(WebKit::WebProcessPool::processWillOpenConnection):
(WebKit::WebProcessPool::processWillCloseConnection):
Remove storage manager calls.

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
When creating a persistent data store, also create a storage manager.

(WebKit::WebsiteDataStore::cloneSessionData):
Clone the session storage namespace.

(WebKit::WebsiteDataStore::webPageWasAdded):
Create a session storage namespace for this page.

(WebKit::WebsiteDataStore::webPageWasRemoved):
Destroy the session storage namespace.

(WebKit::WebsiteDataStore::webProcessWillOpenConnection):
Tell the storage manager about the new process connection.

(WebKit::WebsiteDataStore::webPageWillOpenConnection):
Set the allowed connection.

(WebKit::WebsiteDataStore::webPageDidCloseConnection):
Clear the allowed connection.

(WebKit::WebsiteDataStore::webProcessDidCloseConnection):
Tell the storage manager that the process connection has been closed.

* UIProcess/WebsiteData/WebsiteDataStore.h:
Add new members.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaAPIWebsiteDataStoreCocoamm">trunk/Source/WebKit2/UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKProcessPoolmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPool.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessPoolcpp">trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebsiteDataWebsiteDataStorecpp">trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebsiteDataWebsiteDataStoreh">trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (178523 => 178524)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-01-15 20:16:38 UTC (rev 178523)
+++ trunk/Source/WebKit2/ChangeLog        2015-01-15 20:24:41 UTC (rev 178524)
</span><span class="lines">@@ -1,5 +1,70 @@
</span><span class="cx"> 2015-01-15  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Give WebsiteDataStore a StorageManager
+        https://bugs.webkit.org/show_bug.cgi?id=140505
+
+        Reviewed by Andreas Kling.
+
+        The process pool storage manager is still around but is only used for clearing data. It will be removed
+        completely in an upcoming commit.
+
+        * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
+        (API::WebsiteDataStore::defaultDataStoreConfiguration):
+        Set up the local storage directory.
+
+        * UIProcess/API/Cocoa/WKProcessPool.mm:
+        (websiteDataDirectoryURL):
+        Export this so it can be called from APIWebsiteDataStoreCocoa.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::createNewPage):
+        Call WebsiteDataStore::cloneSessionData instead.
+
+        * UIProcess/WebPageProxy.h:
+        (WebKit::WebPageProxy::websiteDataStore):
+        Add getter.
+
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::websiteDataStoreConfiguration):
+        Update this to take a WebProcessPoolConfiguration object and assign the local storage directory.
+
+        (WebKit::WebProcessPool::WebProcessPool):
+        Pass the configuration to websiteDataStoreConfiguration.
+
+        (WebKit::WebProcessPool::processWillOpenConnection):
+        (WebKit::WebProcessPool::processWillCloseConnection):
+        Remove storage manager calls.
+
+        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+        (WebKit::WebsiteDataStore::WebsiteDataStore):
+        When creating a persistent data store, also create a storage manager.
+
+        (WebKit::WebsiteDataStore::cloneSessionData):
+        Clone the session storage namespace.
+
+        (WebKit::WebsiteDataStore::webPageWasAdded):
+        Create a session storage namespace for this page.
+
+        (WebKit::WebsiteDataStore::webPageWasRemoved):
+        Destroy the session storage namespace.
+
+        (WebKit::WebsiteDataStore::webProcessWillOpenConnection):
+        Tell the storage manager about the new process connection.
+
+        (WebKit::WebsiteDataStore::webPageWillOpenConnection):
+        Set the allowed connection.
+
+        (WebKit::WebsiteDataStore::webPageDidCloseConnection):
+        Clear the allowed connection.
+
+        (WebKit::WebsiteDataStore::webProcessDidCloseConnection):
+        Tell the storage manager that the process connection has been closed.
+
+        * UIProcess/WebsiteData/WebsiteDataStore.h:
+        Add new members.
+
+2015-01-15  Anders Carlsson  &lt;andersca@apple.com&gt;
+
</ins><span class="cx">         More work on the lifetime observer
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=140500
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaAPIWebsiteDataStoreCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm (178523 => 178524)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm        2015-01-15 20:16:38 UTC (rev 178523)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm        2015-01-15 20:24:41 UTC (rev 178524)
</span><span class="lines">@@ -26,6 +26,9 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;APIWebsiteDataStore.h&quot;
</span><span class="cx"> 
</span><ins>+// FIXME: This function is currently in WKProcessPool. It should be moved to this file instead.
+NSURL *websiteDataDirectoryURL(NSString *directoryName);
+
</ins><span class="cx"> namespace API {
</span><span class="cx"> 
</span><span class="cx"> WebKit::WebsiteDataStore::Configuration WebsiteDataStore::defaultDataStoreConfiguration()
</span><span class="lines">@@ -33,6 +36,8 @@
</span><span class="cx">     // FIXME: Fill everything in.
</span><span class="cx">     WebKit::WebsiteDataStore::Configuration configuration;
</span><span class="cx"> 
</span><ins>+    configuration.localStorageDirectory = websiteDataDirectoryURL(@&quot;LocalStorage&quot;).absoluteURL.path.fileSystemRepresentation;
+
</ins><span class="cx">     return configuration;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKProcessPoolmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPool.mm (178523 => 178524)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPool.mm        2015-01-15 20:16:38 UTC (rev 178523)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPool.mm        2015-01-15 20:24:41 UTC (rev 178524)
</span><span class="lines">@@ -49,6 +49,9 @@
</span><span class="cx"> #import &quot;WKGeolocationProviderIOS.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+// FIXME: Move this from WKProcessPool to APIWebsiteDataStoreCocoa.
+NSURL *websiteDataDirectoryURL(NSString *directoryName);
+
</ins><span class="cx"> @implementation WKProcessPool {
</span><span class="cx">     WebKit::WeakObjCPtr&lt;id &lt;_WKDownloadDelegate&gt;&gt; _downloadDelegate;
</span><span class="cx"> 
</span><span class="lines">@@ -113,7 +116,7 @@
</span><span class="cx">     return [url URLByAppendingPathComponent:@&quot;WebsiteData&quot; isDirectory:YES];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static NSURL *websiteDataDirectoryURL(NSString *directoryName)
</del><ins>+NSURL *websiteDataDirectoryURL(NSString *directoryName)
</ins><span class="cx"> {
</span><span class="cx">     static dispatch_once_t onceToken;
</span><span class="cx">     static NSURL *websiteDataURL;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (178523 => 178524)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-01-15 20:16:38 UTC (rev 178523)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-01-15 20:24:41 UTC (rev 178524)
</span><span class="lines">@@ -3093,7 +3093,8 @@
</span><span class="cx"> 
</span><span class="cx">     newPageID = newPage-&gt;pageID();
</span><span class="cx">     newPageParameters = newPage-&gt;creationParameters();
</span><del>-    process().processPool().storageManager().cloneSessionStorageNamespace(m_pageID, newPage-&gt;pageID());
</del><ins>+
+    WebsiteDataStore::cloneSessionData(*this, *newPage);
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> void WebPageProxy::showPage()
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (178523 => 178524)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-01-15 20:16:38 UTC (rev 178523)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-01-15 20:24:41 UTC (rev 178524)
</span><span class="lines">@@ -270,6 +270,8 @@
</span><span class="cx"> 
</span><span class="cx">     WebNavigationState&amp; navigationState() { return *m_navigationState.get(); }
</span><span class="cx"> 
</span><ins>+    WebsiteDataStore&amp; websiteDataStore() { return m_websiteDataStore; }
+
</ins><span class="cx"> #if ENABLE(ASYNC_SCROLLING)
</span><span class="cx">     RemoteScrollingCoordinatorProxy* scrollingCoordinatorProxy() const { return m_scrollingCoordinatorProxy.get(); }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp (178523 => 178524)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2015-01-15 20:16:38 UTC (rev 178523)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2015-01-15 20:24:41 UTC (rev 178524)
</span><span class="lines">@@ -150,11 +150,12 @@
</span><span class="cx">     return processPools();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static WebsiteDataStore::Configuration websiteDataStoreConfiguration()
</del><ins>+static WebsiteDataStore::Configuration websiteDataStoreConfiguration(const WebProcessPoolConfiguration&amp; processPoolConfiguration)
</ins><span class="cx"> {
</span><span class="cx">     WebsiteDataStore::Configuration configuration;
</span><span class="cx"> 
</span><del>-    // FIXME: Fill in the configuration.
</del><ins>+    configuration.localStorageDirectory = processPoolConfiguration.localStorageDirectory;
+
</ins><span class="cx">     return configuration;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -175,7 +176,7 @@
</span><span class="cx">     , m_cacheModel(CacheModelDocumentViewer)
</span><span class="cx">     , m_memorySamplerEnabled(false)
</span><span class="cx">     , m_memorySamplerInterval(1400.0)
</span><del>-    , m_websiteDataStore(WebsiteDataStore::create(websiteDataStoreConfiguration()))
</del><ins>+    , m_websiteDataStore(WebsiteDataStore::create(websiteDataStoreConfiguration(configuration)))
</ins><span class="cx">     , m_storageManager(StorageManager::create(configuration.localStorageDirectory))
</span><span class="cx"> #if USE(SOUP)
</span><span class="cx">     , m_initialHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain)
</span><span class="lines">@@ -777,12 +778,10 @@
</span><span class="cx"> 
</span><span class="cx"> void WebProcessPool::processWillOpenConnection(WebProcessProxy* process)
</span><span class="cx"> {
</span><del>-    m_storageManager-&gt;processWillOpenConnection(process);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebProcessPool::processWillCloseConnection(WebProcessProxy* process)
</span><span class="cx"> {
</span><del>-    m_storageManager-&gt;processWillCloseConnection(process);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebProcessPool::applicationWillTerminate()
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebsiteDataWebsiteDataStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp (178523 => 178524)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp        2015-01-15 20:16:38 UTC (rev 178523)
+++ trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp        2015-01-15 20:24:41 UTC (rev 178524)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WebsiteDataStore.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;StorageManager.h&quot;
</ins><span class="cx"> #include &quot;WebProcessPool.h&quot;
</span><span class="cx"> #include &lt;wtf/RunLoop.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -56,9 +57,10 @@
</span><span class="cx">     return adoptRef(new WebsiteDataStore(WTF::move(configuration)));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebsiteDataStore::WebsiteDataStore(Configuration)
</del><ins>+WebsiteDataStore::WebsiteDataStore(Configuration configuration)
</ins><span class="cx">     : m_identifier(generateIdentifier())
</span><span class="cx">     , m_sessionID(WebCore::SessionID::defaultSessionID())
</span><ins>+    , m_storageManager(StorageManager::create(WTF::move(configuration.localStorageDirectory)))
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -72,6 +74,21 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebsiteDataStore::cloneSessionData(WebPageProxy&amp; sourcePage, WebPageProxy&amp; newPage)
+{
+    auto&amp; sourceDataStore = sourcePage.websiteDataStore();
+    auto&amp; newDataStore = newPage.websiteDataStore();
+
+    // FIXME: Handle this.
+    if (&amp;sourceDataStore != &amp;newDataStore)
+        return;
+
+    if (!sourceDataStore.m_storageManager)
+        return;
+
+    sourceDataStore.m_storageManager-&gt;cloneSessionStorageNamespace(sourcePage.pageID(), newPage.pageID());
+}
+
</ins><span class="cx"> enum class ProcessAccessType {
</span><span class="cx">     None,
</span><span class="cx">     OnlyIfLaunched,
</span><span class="lines">@@ -160,4 +177,40 @@
</span><span class="cx">     callbackAggregator-&gt;callIfNeeded();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebsiteDataStore::webPageWasAdded(WebPageProxy&amp; webPageProxy)
+{
+    if (m_storageManager)
+        m_storageManager-&gt;createSessionStorageNamespace(webPageProxy.pageID(), std::numeric_limits&lt;unsigned&gt;::max());
</ins><span class="cx"> }
</span><ins>+
+void WebsiteDataStore::webPageWasRemoved(WebPageProxy&amp; webPageProxy)
+{
+    if (m_storageManager)
+        m_storageManager-&gt;destroySessionStorageNamespace(webPageProxy.pageID());
+}
+
+void WebsiteDataStore::webProcessWillOpenConnection(WebProcessProxy&amp; webProcessProxy, IPC::Connection&amp;)
+{
+    if (m_storageManager)
+        m_storageManager-&gt;processWillOpenConnection(&amp;webProcessProxy);
+}
+
+void WebsiteDataStore::webPageWillOpenConnection(WebPageProxy&amp; webPageProxy, IPC::Connection&amp; connection)
+{
+    if (m_storageManager)
+        m_storageManager-&gt;setAllowedSessionStorageNamespaceConnection(webPageProxy.pageID(), &amp;connection);
+}
+
+void WebsiteDataStore::webPageDidCloseConnection(WebPageProxy&amp; webPageProxy, IPC::Connection&amp;)
+{
+    if (m_storageManager)
+        m_storageManager-&gt;setAllowedSessionStorageNamespaceConnection(webPageProxy.pageID(), nullptr);
+}
+
+void WebsiteDataStore::webProcessDidCloseConnection(WebProcessProxy&amp; webProcessProxy, IPC::Connection&amp;)
+{
+    if (m_storageManager)
+        m_storageManager-&gt;processWillCloseConnection(&amp;webProcessProxy);
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebsiteDataWebsiteDataStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h (178523 => 178524)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h        2015-01-15 20:16:38 UTC (rev 178523)
+++ trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h        2015-01-15 20:24:41 UTC (rev 178524)
</span><span class="lines">@@ -33,14 +33,17 @@
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><ins>+#include &lt;wtf/text/WTFString.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><ins>+class StorageManager;
</ins><span class="cx"> class WebPageProxy;
</span><span class="cx"> 
</span><span class="cx"> class WebsiteDataStore : public RefCounted&lt;WebsiteDataStore&gt;, public WebProcessLifetimeObserver {
</span><span class="cx"> public:
</span><span class="cx">     struct Configuration {
</span><ins>+        String localStorageDirectory;
</ins><span class="cx">     };
</span><span class="cx">     static RefPtr&lt;WebsiteDataStore&gt; createNonPersistent();
</span><span class="cx">     static RefPtr&lt;WebsiteDataStore&gt; create(Configuration);
</span><span class="lines">@@ -51,14 +54,26 @@
</span><span class="cx">     bool isNonPersistent() const { return m_sessionID.isEphemeral(); }
</span><span class="cx">     WebCore::SessionID sessionID() const { return m_sessionID; }
</span><span class="cx"> 
</span><ins>+    static void cloneSessionData(WebPageProxy&amp; sourcePage, WebPageProxy&amp; newPage);
+
</ins><span class="cx">     void removeData(WebsiteDataTypes, std::chrono::system_clock::time_point modifiedSince, std::function&lt;void ()&gt; completionHandler);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     explicit WebsiteDataStore(WebCore::SessionID);
</span><span class="cx">     explicit WebsiteDataStore(Configuration);
</span><span class="cx"> 
</span><del>-    uint64_t m_identifier;
-    WebCore::SessionID m_sessionID;
</del><ins>+    // WebProcessLifetimeObserver.
+    virtual void webPageWasAdded(WebPageProxy&amp;) override;
+    virtual void webPageWasRemoved(WebPageProxy&amp;) override;
+    virtual void webProcessWillOpenConnection(WebProcessProxy&amp;, IPC::Connection&amp;) override;
+    virtual void webPageWillOpenConnection(WebPageProxy&amp;, IPC::Connection&amp;) override;
+    virtual void webPageDidCloseConnection(WebPageProxy&amp;, IPC::Connection&amp;) override;
+    virtual void webProcessDidCloseConnection(WebProcessProxy&amp;, IPC::Connection&amp;) override;
+
+    const uint64_t m_identifier;
+    const WebCore::SessionID m_sessionID;
+
+    const RefPtr&lt;StorageManager&gt; m_storageManager;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>