<!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>[199842] 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/199842">199842</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2016-04-21 16:06:41 -0700 (Thu, 21 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Get rid of the last uses of ApplicationCacheStorage::singleton() from WebKit2
https://bugs.webkit.org/show_bug.cgi?id=156876

Reviewed by Tim Horton.

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
Add and encode and decode a applicationCacheFlatFileSubdirectoryName.

* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithLegacyOptions):
Set m_applicationCacheFlatFileSubdirectoryName to &quot;ApplicationCache&quot;.

(API::ProcessPoolConfiguration::ProcessPoolConfiguration):
Set m_applicationCacheFlatFileSubdirectoryName to &quot;Files&quot;.

(API::ProcessPoolConfiguration::copy):
Copy m_applicationCacheFlatFileSubdirectoryName.

* UIProcess/API/APIProcessPoolConfiguration.h:
Add getter for applicationCacheFlatFileSubdirectoryName.

* UIProcess/WebProcessPool.cpp:
(WebKit::legacyWebsiteDataStoreConfiguration):
Initialize applicationCacheFlatFileSubdirectoryName from the process pool configuration.

(WebKit::WebProcessPool::createNewWebProcess):
Initialize parameters.applicationCacheFlatFileSubdirectoryName. Remove a call to
ApplicationCacheStorage::singleton().setDefaultOriginQuota since it had no effect (it was called in the UI process).

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
Initialize m_applicationCacheFlatFileSubdirectoryName.

(WebKit::WebsiteDataStore::fetchData):
(WebKit::WebsiteDataStore::removeData):
Pass m_applicationCacheFlatFileSubdirectoryName when creating the application cache storage.

* UIProcess/WebsiteData/WebsiteDataStore.h:
Add new members.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
Set the application cache storage.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
Initialize the application cache storage.

* WebProcess/WebProcess.h:
(WebKit::WebProcess::applicationCacheStorage):
Add new getter.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebProcessCreationParameterscpp">trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebProcessCreationParametersh">trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIProcessPoolConfigurationcpp">trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIProcessPoolConfigurationh">trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.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>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcessh">trunk/Source/WebKit2/WebProcess/WebProcess.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (199841 => 199842)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-04-21 23:03:27 UTC (rev 199841)
+++ trunk/Source/WebKit2/ChangeLog        2016-04-21 23:06:41 UTC (rev 199842)
</span><span class="lines">@@ -1,5 +1,62 @@
</span><span class="cx"> 2016-04-21  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Get rid of the last uses of ApplicationCacheStorage::singleton() from WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=156876
+
+        Reviewed by Tim Horton.
+
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::encode):
+        (WebKit::WebProcessCreationParameters::decode):
+        * Shared/WebProcessCreationParameters.h:
+        Add and encode and decode a applicationCacheFlatFileSubdirectoryName.
+
+        * UIProcess/API/APIProcessPoolConfiguration.cpp:
+        (API::ProcessPoolConfiguration::createWithLegacyOptions):
+        Set m_applicationCacheFlatFileSubdirectoryName to &quot;ApplicationCache&quot;.
+
+        (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
+        Set m_applicationCacheFlatFileSubdirectoryName to &quot;Files&quot;.
+
+        (API::ProcessPoolConfiguration::copy):
+        Copy m_applicationCacheFlatFileSubdirectoryName.
+
+        * UIProcess/API/APIProcessPoolConfiguration.h:
+        Add getter for applicationCacheFlatFileSubdirectoryName.
+
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::legacyWebsiteDataStoreConfiguration):
+        Initialize applicationCacheFlatFileSubdirectoryName from the process pool configuration.
+
+        (WebKit::WebProcessPool::createNewWebProcess):
+        Initialize parameters.applicationCacheFlatFileSubdirectoryName. Remove a call to 
+        ApplicationCacheStorage::singleton().setDefaultOriginQuota since it had no effect (it was called in the UI process).
+
+        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+        (WebKit::WebsiteDataStore::WebsiteDataStore):
+        Initialize m_applicationCacheFlatFileSubdirectoryName.
+
+        (WebKit::WebsiteDataStore::fetchData):
+        (WebKit::WebsiteDataStore::removeData):
+        Pass m_applicationCacheFlatFileSubdirectoryName when creating the application cache storage.
+
+        * UIProcess/WebsiteData/WebsiteDataStore.h:
+        Add new members.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage):
+        Set the application cache storage.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeWebProcess):
+        Initialize the application cache storage.
+
+        * WebProcess/WebProcess.h:
+        (WebKit::WebProcess::applicationCacheStorage):
+        Add new getter.
+
+2016-04-21  Anders Carlsson  &lt;andersca@apple.com&gt;
+
</ins><span class="cx">         Remove two uses of ApplicationCacheStorage::singleton() from WebKit2
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=156873
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebProcessCreationParameterscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp (199841 => 199842)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp        2016-04-21 23:03:27 UTC (rev 199841)
+++ trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp        2016-04-21 23:06:41 UTC (rev 199842)
</span><span class="lines">@@ -62,6 +62,7 @@
</span><span class="cx">     encoder &lt;&lt; injectedBundlePathExtensionHandle;
</span><span class="cx">     encoder &lt;&lt; initializationUserData;
</span><span class="cx">     encoder &lt;&lt; applicationCacheDirectory;
</span><ins>+    encoder &lt;&lt; applicationCacheFlatFileSubdirectoryName;
</ins><span class="cx">     encoder &lt;&lt; applicationCacheDirectoryExtensionHandle;
</span><span class="cx">     encoder &lt;&lt; webSQLDatabaseDirectory;
</span><span class="cx">     encoder &lt;&lt; webSQLDatabaseDirectoryExtensionHandle;
</span><span class="lines">@@ -156,6 +157,8 @@
</span><span class="cx">         return false;
</span><span class="cx">     if (!decoder.decode(parameters.applicationCacheDirectory))
</span><span class="cx">         return false;
</span><ins>+    if (!decoder.decode(parameters.applicationCacheFlatFileSubdirectoryName))
+        return false;
</ins><span class="cx">     if (!decoder.decode(parameters.applicationCacheDirectoryExtensionHandle))
</span><span class="cx">         return false;
</span><span class="cx">     if (!decoder.decode(parameters.webSQLDatabaseDirectory))
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebProcessCreationParametersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h (199841 => 199842)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h        2016-04-21 23:03:27 UTC (rev 199841)
+++ trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h        2016-04-21 23:06:41 UTC (rev 199842)
</span><span class="lines">@@ -68,7 +68,8 @@
</span><span class="cx"> 
</span><span class="cx">     UserData initializationUserData;
</span><span class="cx"> 
</span><del>-    String applicationCacheDirectory;    
</del><ins>+    String applicationCacheDirectory;
+    String applicationCacheFlatFileSubdirectoryName;
</ins><span class="cx">     SandboxExtension::Handle applicationCacheDirectoryExtensionHandle;
</span><span class="cx">     String webSQLDatabaseDirectory;
</span><span class="cx">     SandboxExtension::Handle webSQLDatabaseDirectoryExtensionHandle;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIProcessPoolConfigurationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.cpp (199841 => 199842)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.cpp        2016-04-21 23:03:27 UTC (rev 199841)
+++ trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.cpp        2016-04-21 23:06:41 UTC (rev 199842)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx">     configuration-&gt;m_cacheModel = WebKit::CacheModelDocumentViewer;
</span><span class="cx"> 
</span><span class="cx">     configuration-&gt;m_applicationCacheDirectory = WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory();
</span><ins>+    configuration-&gt;m_applicationCacheFlatFileSubdirectoryName = &quot;ApplicationCache&quot;;
</ins><span class="cx">     configuration-&gt;m_diskCacheDirectory = WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory();
</span><span class="cx">     configuration-&gt;m_mediaCacheDirectory = WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory();
</span><span class="cx">     configuration-&gt;m_indexedDBDatabaseDirectory = WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory();
</span><span class="lines">@@ -57,6 +58,7 @@
</span><span class="cx"> 
</span><span class="cx"> ProcessPoolConfiguration::ProcessPoolConfiguration()
</span><span class="cx">     : m_applicationCacheDirectory(WebsiteDataStore::defaultApplicationCacheDirectory())
</span><ins>+    , m_applicationCacheFlatFileSubdirectoryName(&quot;Files&quot;)
</ins><span class="cx">     , m_diskCacheDirectory(WebsiteDataStore::defaultNetworkCacheDirectory())
</span><span class="cx">     , m_mediaCacheDirectory(WebsiteDataStore::defaultMediaCacheDirectory())
</span><span class="cx">     , m_indexedDBDatabaseDirectory(WebsiteDataStore::defaultIndexedDBDatabaseDirectory())
</span><span class="lines">@@ -80,6 +82,7 @@
</span><span class="cx">     copy-&gt;m_diskCacheSpeculativeValidationEnabled = this-&gt;m_diskCacheSpeculativeValidationEnabled;
</span><span class="cx">     copy-&gt;m_diskCacheSizeOverride = this-&gt;m_diskCacheSizeOverride;
</span><span class="cx">     copy-&gt;m_applicationCacheDirectory = this-&gt;m_applicationCacheDirectory;
</span><ins>+    copy-&gt;m_applicationCacheFlatFileSubdirectoryName = this-&gt;m_applicationCacheFlatFileSubdirectoryName;
</ins><span class="cx">     copy-&gt;m_diskCacheDirectory = this-&gt;m_diskCacheDirectory;
</span><span class="cx">     copy-&gt;m_mediaCacheDirectory = this-&gt;m_mediaCacheDirectory;
</span><span class="cx">     copy-&gt;m_indexedDBDatabaseDirectory = this-&gt;m_indexedDBDatabaseDirectory;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIProcessPoolConfigurationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.h (199841 => 199842)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.h        2016-04-21 23:03:27 UTC (rev 199841)
+++ trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.h        2016-04-21 23:06:41 UTC (rev 199842)
</span><span class="lines">@@ -62,6 +62,8 @@
</span><span class="cx">     const WTF::String&amp; applicationCacheDirectory() const { return m_applicationCacheDirectory; }
</span><span class="cx">     void setApplicationCacheDirectory(const WTF::String&amp; applicationCacheDirectory) { m_applicationCacheDirectory = applicationCacheDirectory; }
</span><span class="cx"> 
</span><ins>+    const WTF::String&amp; applicationCacheFlatFileSubdirectoryName() const { return m_applicationCacheFlatFileSubdirectoryName; }
+
</ins><span class="cx">     const WTF::String&amp; diskCacheDirectory() const { return m_diskCacheDirectory; }
</span><span class="cx">     void setDiskCacheDirectory(const WTF::String&amp; diskCacheDirectory) { m_diskCacheDirectory = diskCacheDirectory; }
</span><span class="cx"> 
</span><span class="lines">@@ -104,6 +106,7 @@
</span><span class="cx">     int64_t m_diskCacheSizeOverride { -1 };
</span><span class="cx"> 
</span><span class="cx">     WTF::String m_applicationCacheDirectory;
</span><ins>+    WTF::String m_applicationCacheFlatFileSubdirectoryName;
</ins><span class="cx">     WTF::String m_diskCacheDirectory;
</span><span class="cx">     WTF::String m_mediaCacheDirectory;
</span><span class="cx">     WTF::String m_indexedDBDatabaseDirectory;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp (199841 => 199842)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2016-04-21 23:03:27 UTC (rev 199841)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2016-04-21 23:06:41 UTC (rev 199842)
</span><span class="lines">@@ -128,6 +128,7 @@
</span><span class="cx">     configuration.localStorageDirectory = processPoolConfiguration.localStorageDirectory();
</span><span class="cx">     configuration.webSQLDatabaseDirectory = processPoolConfiguration.webSQLDatabaseDirectory();
</span><span class="cx">     configuration.applicationCacheDirectory = processPoolConfiguration.applicationCacheDirectory();
</span><ins>+    configuration.applicationCacheFlatFileSubdirectoryName = processPoolConfiguration.applicationCacheFlatFileSubdirectoryName();
</ins><span class="cx">     configuration.mediaCacheDirectory = processPoolConfiguration.mediaCacheDirectory();
</span><span class="cx">     configuration.mediaKeysStorageDirectory = processPoolConfiguration.mediaKeysStorageDirectory();
</span><span class="cx">     configuration.networkCacheDirectory = processPoolConfiguration.diskCacheDirectory();
</span><span class="lines">@@ -538,6 +539,8 @@
</span><span class="cx">         SandboxExtension::createHandle(parameters.injectedBundlePath, SandboxExtension::ReadOnly, parameters.injectedBundlePathExtensionHandle);
</span><span class="cx"> 
</span><span class="cx">     parameters.applicationCacheDirectory = m_configuration-&gt;applicationCacheDirectory();
</span><ins>+    parameters.applicationCacheFlatFileSubdirectoryName = m_configuration-&gt;applicationCacheFlatFileSubdirectoryName();
+
</ins><span class="cx">     if (!parameters.applicationCacheDirectory.isEmpty())
</span><span class="cx">         SandboxExtension::createHandleForReadWriteDirectory(parameters.applicationCacheDirectory, parameters.applicationCacheDirectoryExtensionHandle);
</span><span class="cx"> 
</span><span class="lines">@@ -646,9 +649,6 @@
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     process-&gt;send(Messages::WebProcess::SetQOS(webProcessLatencyQOS(), webProcessThroughputQOS()), 0);
</span><span class="cx"> #endif
</span><del>-#if PLATFORM(IOS)
-    ApplicationCacheStorage::singleton().setDefaultOriginQuota(25ULL * 1024 * 1024);
-#endif
</del><span class="cx"> 
</span><span class="cx">     if (WebPreferences::anyPagesAreUsingPrivateBrowsing())
</span><span class="cx">         process-&gt;send(Messages::WebProcess::EnsurePrivateBrowsingSession(SessionID::legacyPrivateSessionID()), 0);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebsiteDataWebsiteDataStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp (199841 => 199842)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp        2016-04-21 23:03:27 UTC (rev 199841)
+++ trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp        2016-04-21 23:06:41 UTC (rev 199842)
</span><span class="lines">@@ -78,6 +78,7 @@
</span><span class="cx">     , m_sessionID(WebCore::SessionID::defaultSessionID())
</span><span class="cx">     , m_networkCacheDirectory(WTFMove(configuration.networkCacheDirectory))
</span><span class="cx">     , m_applicationCacheDirectory(WTFMove(configuration.applicationCacheDirectory))
</span><ins>+    , m_applicationCacheFlatFileSubdirectoryName(WTFMove(configuration.applicationCacheFlatFileSubdirectoryName))
</ins><span class="cx">     , m_mediaCacheDirectory(WTFMove(configuration.mediaCacheDirectory))
</span><span class="cx">     , m_webSQLDatabaseDirectory(WTFMove(configuration.webSQLDatabaseDirectory))
</span><span class="cx">     , m_mediaKeysStorageDirectory(WTFMove(configuration.mediaKeysStorageDirectory))
</span><span class="lines">@@ -355,11 +356,12 @@
</span><span class="cx"> 
</span><span class="cx">     if (dataTypes.contains(WebsiteDataType::OfflineWebApplicationCache) &amp;&amp; isPersistent()) {
</span><span class="cx">         StringCapture applicationCacheDirectory { m_applicationCacheDirectory };
</span><ins>+        StringCapture applicationCacheFlatFileSubdirectoryName { m_applicationCacheFlatFileSubdirectoryName };
</ins><span class="cx"> 
</span><span class="cx">         callbackAggregator-&gt;addPendingCallback();
</span><span class="cx"> 
</span><del>-        m_queue-&gt;dispatch([fetchOptions, applicationCacheDirectory, callbackAggregator] {
-            auto storage = WebCore::ApplicationCacheStorage::create(applicationCacheDirectory.string(), &quot;ApplicationCache&quot;);
</del><ins>+        m_queue-&gt;dispatch([fetchOptions, applicationCacheDirectory, applicationCacheFlatFileSubdirectoryName, callbackAggregator] {
+            auto storage = WebCore::ApplicationCacheStorage::create(applicationCacheDirectory.string(), applicationCacheFlatFileSubdirectoryName.string());
</ins><span class="cx"> 
</span><span class="cx">             WebsiteData* websiteData = new WebsiteData;
</span><span class="cx"> 
</span><span class="lines">@@ -632,11 +634,12 @@
</span><span class="cx"> 
</span><span class="cx">     if (dataTypes.contains(WebsiteDataType::OfflineWebApplicationCache) &amp;&amp; isPersistent()) {
</span><span class="cx">         StringCapture applicationCacheDirectory { m_applicationCacheDirectory };
</span><ins>+        StringCapture applicationCacheFlatFileSubdirectoryName { m_applicationCacheFlatFileSubdirectoryName };
</ins><span class="cx"> 
</span><span class="cx">         callbackAggregator-&gt;addPendingCallback();
</span><span class="cx"> 
</span><del>-        m_queue-&gt;dispatch([applicationCacheDirectory, callbackAggregator] {
-            auto storage = WebCore::ApplicationCacheStorage::create(applicationCacheDirectory.string(), &quot;ApplicationCache&quot;);
</del><ins>+        m_queue-&gt;dispatch([applicationCacheDirectory, applicationCacheFlatFileSubdirectoryName, callbackAggregator] {
+            auto storage = WebCore::ApplicationCacheStorage::create(applicationCacheDirectory.string(), applicationCacheFlatFileSubdirectoryName.string());
</ins><span class="cx"> 
</span><span class="cx">             storage-&gt;deleteAllCaches();
</span><span class="cx"> 
</span><span class="lines">@@ -884,6 +887,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (dataTypes.contains(WebsiteDataType::OfflineWebApplicationCache) &amp;&amp; isPersistent()) {
</span><span class="cx">         StringCapture applicationCacheDirectory { m_applicationCacheDirectory };
</span><ins>+        StringCapture applicationCacheFlatFileSubdirectoryName { m_applicationCacheFlatFileSubdirectoryName };
</ins><span class="cx"> 
</span><span class="cx">         HashSet&lt;RefPtr&lt;WebCore::SecurityOrigin&gt;&gt; origins;
</span><span class="cx">         for (const auto&amp; dataRecord : dataRecords) {
</span><span class="lines">@@ -892,8 +896,8 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         callbackAggregator-&gt;addPendingCallback();
</span><del>-        m_queue-&gt;dispatch([origins, applicationCacheDirectory, callbackAggregator] {
-            auto storage = WebCore::ApplicationCacheStorage::create(applicationCacheDirectory.string(), &quot;ApplicationCache&quot;);
</del><ins>+        m_queue-&gt;dispatch([origins, applicationCacheDirectory, applicationCacheFlatFileSubdirectoryName, callbackAggregator] {
+            auto storage = WebCore::ApplicationCacheStorage::create(applicationCacheDirectory.string(), applicationCacheFlatFileSubdirectoryName.string());
</ins><span class="cx"> 
</span><span class="cx">             for (const auto&amp; origin : origins)
</span><span class="cx">                 storage-&gt;deleteCacheForOrigin(*origin);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebsiteDataWebsiteDataStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h (199841 => 199842)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h        2016-04-21 23:03:27 UTC (rev 199841)
+++ trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h        2016-04-21 23:06:41 UTC (rev 199842)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx">     struct Configuration {
</span><span class="cx">         String networkCacheDirectory;
</span><span class="cx">         String applicationCacheDirectory;
</span><ins>+        String applicationCacheFlatFileSubdirectoryName;
</ins><span class="cx"> 
</span><span class="cx">         String mediaCacheDirectory;
</span><span class="cx">         String webSQLDatabaseDirectory;
</span><span class="lines">@@ -118,6 +119,7 @@
</span><span class="cx"> 
</span><span class="cx">     const String m_networkCacheDirectory;
</span><span class="cx">     const String m_applicationCacheDirectory;
</span><ins>+    const String m_applicationCacheFlatFileSubdirectoryName;
</ins><span class="cx">     const String m_mediaCacheDirectory;
</span><span class="cx"> 
</span><span class="cx">     const String m_webSQLDatabaseDirectory;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (199841 => 199842)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-04-21 23:03:27 UTC (rev 199841)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-04-21 23:06:41 UTC (rev 199842)
</span><span class="lines">@@ -106,6 +106,7 @@
</span><span class="cx"> #include &quot;WebUserContentController.h&quot;
</span><span class="cx"> #include &quot;WebUserMediaClient.h&quot;
</span><span class="cx"> #include &lt;JavaScriptCore/APICast.h&gt;
</span><ins>+#include &lt;WebCore/ApplicationCacheStorage.h&gt;
</ins><span class="cx"> #include &lt;WebCore/ArchiveResource.h&gt;
</span><span class="cx"> #include &lt;WebCore/Chrome.h&gt;
</span><span class="cx"> #include &lt;WebCore/ContextMenuController.h&gt;
</span><span class="lines">@@ -402,6 +403,7 @@
</span><span class="cx">     pageConfiguration.progressTrackerClient = new WebProgressTrackerClient(*this);
</span><span class="cx">     pageConfiguration.diagnosticLoggingClient = new WebDiagnosticLoggingClient(*this);
</span><span class="cx"> 
</span><ins>+    pageConfiguration.applicationCacheStorage = &amp;WebProcess::singleton().applicationCacheStorage();
</ins><span class="cx">     pageConfiguration.databaseProvider = WebDatabaseProvider::getOrCreate(m_pageGroup-&gt;pageGroupID());
</span><span class="cx">     pageConfiguration.storageNamespaceProvider = WebStorageNamespaceProvider::getOrCreate(m_pageGroup-&gt;pageGroupID());
</span><span class="cx">     pageConfiguration.userContentProvider = m_userContentController.ptr();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (199841 => 199842)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2016-04-21 23:03:27 UTC (rev 199841)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2016-04-21 23:06:41 UTC (rev 199842)
</span><span class="lines">@@ -291,8 +291,11 @@
</span><span class="cx">     m_iconDatabaseProxy.setEnabled(parameters.iconDatabaseEnabled);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    if (!parameters.applicationCacheDirectory.isEmpty())
-        ApplicationCacheStorage::singleton().setCacheDirectory(parameters.applicationCacheDirectory);
</del><ins>+    // FIXME: This should be constructed per data store, not per process.
+    m_applicationCacheStorage = ApplicationCacheStorage::create(parameters.applicationCacheDirectory, parameters.applicationCacheFlatFileSubdirectoryName);
+#if PLATFORM(IOS)
+    m_applicationCacheStorage-&gt;setDefaultOriginQuota(25ULL * 1024 * 1024);
+#endif
</ins><span class="cx"> 
</span><span class="cx">     if (!parameters.mediaCacheDirectory.isEmpty())
</span><span class="cx">         WebCore::HTMLMediaElement::setMediaCacheDirectory(parameters.mediaCacheDirectory);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (199841 => 199842)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.h        2016-04-21 23:03:27 UTC (rev 199841)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h        2016-04-21 23:06:41 UTC (rev 199842)
</span><span class="lines">@@ -61,6 +61,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><ins>+class ApplicationCacheStorage;
</ins><span class="cx"> class CertificateInfo;
</span><span class="cx"> class PageGroup;
</span><span class="cx"> class ResourceRequest;
</span><span class="lines">@@ -207,6 +208,8 @@
</span><span class="cx">     bool hasRichContentServices() const { return m_hasRichContentServices; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    WebCore::ApplicationCacheStorage&amp; applicationCacheStorage() { return *m_applicationCacheStorage; }
+
</ins><span class="cx">     void prefetchDNS(const String&amp;);
</span><span class="cx"> 
</span><span class="cx">     WebAutomationSessionProxy* automationSessionProxy() { return m_automationSessionProxy.get(); }
</span><span class="lines">@@ -385,6 +388,8 @@
</span><span class="cx">     WebCore::Timer m_nonVisibleProcessCleanupTimer;
</span><span class="cx">     WebCore::Timer m_statisticsChangedTimer;
</span><span class="cx"> 
</span><ins>+    RefPtr&lt;WebCore::ApplicationCacheStorage&gt; m_applicationCacheStorage;
+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     WebSQLiteDatabaseTracker m_webSQLiteDatabaseTracker;
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>

</body>
</html>