<!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>[185949] 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/185949">185949</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-06-25 00:15:56 -0700 (Thu, 25 Jun 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK] Do not use legacy data store options in WebKit2 GTK+ API
https://bugs.webkit.org/show_bug.cgi?id=146145

Reviewed by Gustavo Noronha Silva.

Use a custom WebsiteDataStore in WebKitWebContext, configured with
the context options, and passed to every page created. This is in
preparation for exposing WebsiteDataStore in the public API.

* PlatformGTK.cmake: Add APIWebsiteDataStore.cpp to compilation.
* UIProcess/API/APIWebsiteDataStore.cpp:
* UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp:
(API::WebsiteDataStore::defaultApplicationCacheDirectory):
(API::WebsiteDataStore::defaultNetworkCacheDirectory):
(API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
(API::WebsiteDataStore::defaultLocalStorageDirectory):
(API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
(API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
(API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
(API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
(API::WebsiteDataStore::defaultDataStoreConfiguration):
* UIProcess/API/gtk/WebKitWebContext.cpp:
(websiteDataStoreConfigurationForWebProcessPoolConfiguration):
Helper function to create the WebsiteDataStore configuration with
the WebProcessPool configuration options.
(webkitWebContextConstructed): Do not create a
WebProcessPoolConfiguration with legacy options and create a WebsiteDataStore.
(webkitWebContextCreatePageForWebView): Set the WebsiteDataStore
and session ID in web page configuration.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseCreate): Create a WebPageConfiguration for the
given options and pass it to webkitWebViewBaseCreateWebPage.
(webkitWebViewBaseCreateWebPage): It receives now a
WebPageConfiguration, instead of creating it based on the given parameters.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/gtk/WebProcessPoolGtk.cpp: Use WebsiteDataStore default configuration.
(WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory):
(WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
(WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
(WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
(WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
(WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2PlatformGTKcmake">trunk/Source/WebKit2/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIWebsiteDataStorecpp">trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebContextcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewBasecpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewBasePrivateh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessgtkWebProcessPoolGtkcpp">trunk/Source/WebKit2/UIProcess/gtk/WebProcessPoolGtk.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkAPIWebsiteDataStoreGtkcpp">trunk/Source/WebKit2/UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (185948 => 185949)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-06-25 07:13:46 UTC (rev 185948)
+++ trunk/Source/WebKit2/ChangeLog        2015-06-25 07:15:56 UTC (rev 185949)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2015-06-25  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Do not use legacy data store options in WebKit2 GTK+ API
+        https://bugs.webkit.org/show_bug.cgi?id=146145
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Use a custom WebsiteDataStore in WebKitWebContext, configured with
+        the context options, and passed to every page created. This is in
+        preparation for exposing WebsiteDataStore in the public API.
+
+        * PlatformGTK.cmake: Add APIWebsiteDataStore.cpp to compilation.
+        * UIProcess/API/APIWebsiteDataStore.cpp:
+        * UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp:
+        (API::WebsiteDataStore::defaultApplicationCacheDirectory):
+        (API::WebsiteDataStore::defaultNetworkCacheDirectory):
+        (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
+        (API::WebsiteDataStore::defaultLocalStorageDirectory):
+        (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
+        (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
+        (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
+        (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
+        (API::WebsiteDataStore::defaultDataStoreConfiguration):
+        * UIProcess/API/gtk/WebKitWebContext.cpp:
+        (websiteDataStoreConfigurationForWebProcessPoolConfiguration):
+        Helper function to create the WebsiteDataStore configuration with
+        the WebProcessPool configuration options.
+        (webkitWebContextConstructed): Do not create a
+        WebProcessPoolConfiguration with legacy options and create a WebsiteDataStore.
+        (webkitWebContextCreatePageForWebView): Set the WebsiteDataStore
+        and session ID in web page configuration.
+        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+        (webkitWebViewBaseCreate): Create a WebPageConfiguration for the
+        given options and pass it to webkitWebViewBaseCreateWebPage.
+        (webkitWebViewBaseCreateWebPage): It receives now a
+        WebPageConfiguration, instead of creating it based on the given parameters.
+        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
+        * UIProcess/gtk/WebProcessPoolGtk.cpp: Use WebsiteDataStore default configuration.
+        (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory):
+        (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
+        (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
+        (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
+        (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
+        (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
+
</ins><span class="cx"> 2015-06-24  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Detect view services by using the &quot;com.apple.UIKit.vends-view-services&quot; entitlement
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PlatformGTK.cmake (185948 => 185949)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PlatformGTK.cmake        2015-06-25 07:13:46 UTC (rev 185948)
+++ trunk/Source/WebKit2/PlatformGTK.cmake        2015-06-25 07:15:56 UTC (rev 185949)
</span><span class="lines">@@ -96,6 +96,7 @@
</span><span class="cx">     UIProcess/API/C/soup/WKCookieManagerSoup.cpp
</span><span class="cx">     UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp
</span><span class="cx"> 
</span><ins>+    UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp
</ins><span class="cx">     UIProcess/API/gtk/PageClientImpl.cpp
</span><span class="cx">     UIProcess/API/gtk/PageClientImpl.h
</span><span class="cx">     UIProcess/API/gtk/WebKitAuthenticationDialog.cpp
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIWebsiteDataStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.cpp (185948 => 185949)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.cpp        2015-06-25 07:13:46 UTC (rev 185948)
+++ trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.cpp        2015-06-25 07:15:56 UTC (rev 185949)
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx">     return m_websiteDataStore-&gt;isPersistent();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if !PLATFORM(COCOA)
</del><ins>+#if !PLATFORM(COCOA) &amp;&amp; !PLATFORM(GTK)
</ins><span class="cx"> WebKit::WebsiteDataStore::Configuration WebsiteDataStore::defaultDataStoreConfiguration()
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Fill everything in.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkAPIWebsiteDataStoreGtkcppfromrev185948trunkSourceWebKit2UIProcessAPIAPIWebsiteDataStorecpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp (from rev 185948, trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.cpp) (0 => 185949)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp        2015-06-25 07:15:56 UTC (rev 185949)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+/*
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * 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 &quot;config.h&quot;
+#include &quot;APIWebsiteDataStore.h&quot;
+
+#include &lt;WebCore/FileSystem.h&gt;
+
+namespace API {
+
+String WebsiteDataStore::defaultApplicationCacheDirectory()
+{
+    return cacheDirectoryFileSystemRepresentation(&quot;webkitgtk&quot; G_DIR_SEPARATOR_S &quot;applications&quot;);
+}
+
+String WebsiteDataStore::defaultNetworkCacheDirectory()
+{
+#if ENABLE(NETWORK_CACHE)
+    static const char networkCacheSubdirectory[] = &quot;WebKitCache&quot;;
+#else
+    static const char networkCacheSubdirectory[] = &quot;webkit&quot;;
+#endif
+    return cacheDirectoryFileSystemRepresentation(WebCore::pathByAppendingComponent(WebCore::filenameToString(g_get_prgname()), networkCacheSubdirectory));
+}
+
+String WebsiteDataStore::defaultIndexedDBDatabaseDirectory()
+{
+    return websiteDataDirectoryFileSystemRepresentation(&quot;webkitgtk&quot; G_DIR_SEPARATOR_S &quot;databases&quot; G_DIR_SEPARATOR_S &quot;indexeddb&quot;);
+}
+
+String WebsiteDataStore::defaultLocalStorageDirectory()
+{
+    return websiteDataDirectoryFileSystemRepresentation(&quot;webkitgtk&quot; G_DIR_SEPARATOR_S &quot;localstorage&quot;);
+}
+
+String WebsiteDataStore::defaultMediaKeysStorageDirectory()
+{
+    return websiteDataDirectoryFileSystemRepresentation(&quot;webkitgtk&quot; G_DIR_SEPARATOR_S &quot;mediakeys&quot;);
+}
+
+String WebsiteDataStore::defaultWebSQLDatabaseDirectory()
+{
+    return websiteDataDirectoryFileSystemRepresentation(&quot;webkitgtk&quot; G_DIR_SEPARATOR_S &quot;databases&quot;);
+}
+
+String WebsiteDataStore::cacheDirectoryFileSystemRepresentation(const String&amp; directoryName)
+{
+    return WebCore::pathByAppendingComponent(WebCore::filenameToString(g_get_user_cache_dir()), directoryName);
+}
+
+String WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation(const String&amp; directoryName)
+{
+    return WebCore::pathByAppendingComponent(WebCore::filenameToString(g_get_user_data_dir()), directoryName);
+}
+
+WebKit::WebsiteDataStore::Configuration WebsiteDataStore::defaultDataStoreConfiguration()
+{
+    WebKit::WebsiteDataStore::Configuration configuration;
+
+    configuration.applicationCacheDirectory = defaultApplicationCacheDirectory();
+    configuration.networkCacheDirectory = defaultNetworkCacheDirectory();
+
+    configuration.webSQLDatabaseDirectory = defaultWebSQLDatabaseDirectory();
+    configuration.localStorageDirectory = defaultLocalStorageDirectory();
+    configuration.mediaKeysStorageDirectory = defaultMediaKeysStorageDirectory();
+
+    return configuration;
+}
+
+} // namespace API
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp (185948 => 185949)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp        2015-06-25 07:13:46 UTC (rev 185948)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp        2015-06-25 07:15:56 UTC (rev 185949)
</span><span class="lines">@@ -173,6 +173,8 @@
</span><span class="cx"> #if ENABLE(NOTIFICATIONS)
</span><span class="cx">     RefPtr&lt;WebKitNotificationProvider&gt; notificationProvider;
</span><span class="cx"> #endif
</span><ins>+    RefPtr&lt;WebsiteDataStore&gt; websiteDataStore;
+
</ins><span class="cx">     CString faviconDatabaseDirectory;
</span><span class="cx">     WebKitTLSErrorsPolicy tlsErrorsPolicy;
</span><span class="cx"> 
</span><span class="lines">@@ -260,26 +262,39 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline WebsiteDataStore::Configuration websiteDataStoreConfigurationForWebProcessPoolConfiguration(const API::ProcessPoolConfiguration&amp; processPoolconfigurarion)
+{
+    WebsiteDataStore::Configuration configuration;
+    configuration.applicationCacheDirectory = processPoolconfigurarion.applicationCacheDirectory();
+    configuration.networkCacheDirectory = processPoolconfigurarion.diskCacheDirectory();
+    configuration.webSQLDatabaseDirectory = processPoolconfigurarion.webSQLDatabaseDirectory();
+    configuration.localStorageDirectory = processPoolconfigurarion.localStorageDirectory();
+    configuration.mediaKeysStorageDirectory = processPoolconfigurarion.mediaKeysStorageDirectory();
+    return configuration;
+}
+
</ins><span class="cx"> static void webkitWebContextConstructed(GObject* object)
</span><span class="cx"> {
</span><span class="cx">     G_OBJECT_CLASS(webkit_web_context_parent_class)-&gt;constructed(object);
</span><span class="cx"> 
</span><span class="cx">     GUniquePtr&lt;char&gt; bundleFilename(g_build_filename(injectedBundleDirectory(), &quot;libwebkit2gtkinjectedbundle.so&quot;, nullptr));
</span><span class="cx"> 
</span><del>-    auto configuration = API::ProcessPoolConfiguration::createWithLegacyOptions();
-    configuration-&gt;setInjectedBundlePath(WebCore::filenameToString(bundleFilename.get()));
</del><ins>+    API::ProcessPoolConfiguration configuration;
+    configuration.setInjectedBundlePath(WebCore::filenameToString(bundleFilename.get()));
+    configuration.setProcessModel(ProcessModelSharedSecondaryProcess);
+    configuration.setUseNetworkProcess(false);
</ins><span class="cx"> 
</span><span class="cx">     WebKitWebContext* webContext = WEBKIT_WEB_CONTEXT(object);
</span><span class="cx">     WebKitWebContextPrivate* priv = webContext-&gt;priv;
</span><span class="cx">     if (!priv-&gt;localStorageDirectory.isNull())
</span><del>-        configuration-&gt;setLocalStorageDirectory(WebCore::filenameToString(priv-&gt;localStorageDirectory.data()));
</del><ins>+        configuration.setLocalStorageDirectory(WebCore::filenameToString(priv-&gt;localStorageDirectory.data()));
</ins><span class="cx">     if (!priv-&gt;indexedDBDirectory.isNull())
</span><del>-        configuration-&gt;setIndexedDBDatabaseDirectory(WebCore::filenameToString(priv-&gt;indexedDBDirectory.data()));
</del><ins>+        configuration.setIndexedDBDatabaseDirectory(WebCore::filenameToString(priv-&gt;indexedDBDirectory.data()));
</ins><span class="cx"> 
</span><del>-    priv-&gt;context = WebProcessPool::create(configuration.get());
</del><ins>+    priv-&gt;context = WebProcessPool::create(configuration);
</ins><span class="cx"> 
</span><ins>+    priv-&gt;websiteDataStore = WebsiteDataStore::create(websiteDataStoreConfigurationForWebProcessPoolConfiguration(configuration));
</ins><span class="cx">     priv-&gt;requestManager = priv-&gt;context-&gt;supplement&lt;WebSoupCustomProtocolRequestManager&gt;();
</span><del>-    priv-&gt;context-&gt;setCacheModel(CacheModelPrimaryWebBrowser);
</del><span class="cx"> 
</span><span class="cx">     priv-&gt;tlsErrorsPolicy = WEBKIT_TLS_ERRORS_POLICY_FAIL;
</span><span class="cx">     priv-&gt;context-&gt;setIgnoreTLSErrors(false);
</span><span class="lines">@@ -1213,10 +1228,13 @@
</span><span class="cx"> void webkitWebContextCreatePageForWebView(WebKitWebContext* context, WebKitWebView* webView, WebKitUserContentManager* userContentManager, WebKitWebView* relatedView)
</span><span class="cx"> {
</span><span class="cx">     WebKitWebViewBase* webViewBase = WEBKIT_WEB_VIEW_BASE(webView);
</span><del>-    WebPageProxy* relatedPage = relatedView ? webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(relatedView)) : nullptr;
-    WebPreferences* preferences = webkitSettingsGetPreferences(webkit_web_view_get_settings(webView));
-    WebUserContentControllerProxy* userContentControllerProxy = userContentManager ? webkitUserContentManagerGetUserContentControllerProxy(userContentManager) : nullptr;
-    webkitWebViewBaseCreateWebPage(webViewBase, context-&gt;priv-&gt;context.get(), preferences, nullptr, userContentControllerProxy, relatedPage);
</del><ins>+    WebPageConfiguration webPageConfiguration;
+    webPageConfiguration.preferences = webkitSettingsGetPreferences(webkit_web_view_get_settings(webView));
+    webPageConfiguration.relatedPage = relatedView ? webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(relatedView)) : nullptr;
+    webPageConfiguration.userContentController = userContentManager ? webkitUserContentManagerGetUserContentControllerProxy(userContentManager) : nullptr;
+    webPageConfiguration.websiteDataStore = context-&gt;priv-&gt;websiteDataStore.get();
+    webPageConfiguration.sessionID = context-&gt;priv-&gt;websiteDataStore-&gt;sessionID();
+    webkitWebViewBaseCreateWebPage(webViewBase, context-&gt;priv-&gt;context.get(), WTF::move(webPageConfiguration));
</ins><span class="cx"> 
</span><span class="cx">     WebPageProxy* page = webkitWebViewBaseGetPage(webViewBase);
</span><span class="cx">     context-&gt;priv-&gt;webViews.set(page-&gt;pageID(), webView);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp (185948 => 185949)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp        2015-06-25 07:13:46 UTC (rev 185948)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp        2015-06-25 07:15:56 UTC (rev 185949)
</span><span class="lines">@@ -1065,8 +1065,13 @@
</span><span class="cx"> 
</span><span class="cx"> WebKitWebViewBase* webkitWebViewBaseCreate(WebProcessPool* context, WebPreferences* preferences, WebPageGroup* pageGroup, WebUserContentControllerProxy* userContentController, WebPageProxy* relatedPage)
</span><span class="cx"> {
</span><del>-    WebKitWebViewBase* webkitWebViewBase = WEBKIT_WEB_VIEW_BASE(g_object_new(WEBKIT_TYPE_WEB_VIEW_BASE, NULL));
-    webkitWebViewBaseCreateWebPage(webkitWebViewBase, context, preferences, pageGroup, userContentController, relatedPage);
</del><ins>+    WebKitWebViewBase* webkitWebViewBase = WEBKIT_WEB_VIEW_BASE(g_object_new(WEBKIT_TYPE_WEB_VIEW_BASE, nullptr));
+    WebPageConfiguration webPageConfiguration;
+    webPageConfiguration.preferences = preferences;
+    webPageConfiguration.pageGroup = pageGroup;
+    webPageConfiguration.relatedPage = relatedPage;
+    webPageConfiguration.userContentController = userContentController;
+    webkitWebViewBaseCreateWebPage(webkitWebViewBase, context, WTF::move(webPageConfiguration));
</ins><span class="cx">     return webkitWebViewBase;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1087,7 +1092,7 @@
</span><span class="cx"> }
</span><span class="cx"> #endif // HAVE(GTK_SCALE_FACTOR)
</span><span class="cx"> 
</span><del>-void webkitWebViewBaseCreateWebPage(WebKitWebViewBase* webkitWebViewBase, WebProcessPool* context, WebPreferences* preferences, WebPageGroup* pageGroup, WebUserContentControllerProxy* userContentController, WebPageProxy* relatedPage)
</del><ins>+void webkitWebViewBaseCreateWebPage(WebKitWebViewBase* webkitWebViewBase, WebProcessPool* context, WebPageConfiguration&amp;&amp; configuration)
</ins><span class="cx"> {
</span><span class="cx">     WebKitWebViewBasePrivate* priv = webkitWebViewBase-&gt;priv;
</span><span class="cx"> 
</span><span class="lines">@@ -1098,12 +1103,7 @@
</span><span class="cx">         preferences-&gt;setAcceleratedCompositingEnabled(false);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    WebPageConfiguration webPageConfiguration;
-    webPageConfiguration.preferences = preferences;
-    webPageConfiguration.pageGroup = pageGroup;
-    webPageConfiguration.relatedPage = relatedPage;
-    webPageConfiguration.userContentController = userContentController;
-    priv-&gt;pageProxy = context-&gt;createWebPage(*priv-&gt;pageClient, WTF::move(webPageConfiguration));
</del><ins>+    priv-&gt;pageProxy = context-&gt;createWebPage(*priv-&gt;pageClient, WTF::move(configuration));
</ins><span class="cx">     priv-&gt;pageProxy-&gt;initializeWebPage();
</span><span class="cx"> 
</span><span class="cx">     priv-&gt;inputMethodFilter.setPage(priv-&gt;pageProxy.get());
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewBasePrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h (185948 => 185949)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h        2015-06-25 07:13:46 UTC (rev 185948)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h        2015-06-25 07:15:56 UTC (rev 185949)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx"> WebKitWebViewBase* webkitWebViewBaseCreate(WebKit::WebProcessPool*, WebKit::WebPreferences*, WebKit::WebPageGroup*, WebKit::WebUserContentControllerProxy*, WebKit::WebPageProxy*);
</span><span class="cx"> GtkIMContext* webkitWebViewBaseGetIMContext(WebKitWebViewBase*);
</span><span class="cx"> WebKit::WebPageProxy* webkitWebViewBaseGetPage(WebKitWebViewBase*);
</span><del>-void webkitWebViewBaseCreateWebPage(WebKitWebViewBase*, WebKit::WebProcessPool*, WebKit::WebPreferences*, WebKit::WebPageGroup*, WebKit::WebUserContentControllerProxy*, WebKit::WebPageProxy*);
</del><ins>+void webkitWebViewBaseCreateWebPage(WebKitWebViewBase*, WebKit::WebProcessPool*, WebKit::WebPageConfiguration&amp;&amp;);
</ins><span class="cx"> void webkitWebViewBaseSetTooltipText(WebKitWebViewBase*, const char*);
</span><span class="cx"> void webkitWebViewBaseSetTooltipArea(WebKitWebViewBase*, const WebCore::IntRect&amp;);
</span><span class="cx"> void webkitWebViewBaseForwardNextKeyEvent(WebKitWebViewBase*);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessgtkWebProcessPoolGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/gtk/WebProcessPoolGtk.cpp (185948 => 185949)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/gtk/WebProcessPoolGtk.cpp        2015-06-25 07:13:46 UTC (rev 185948)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebProcessPoolGtk.cpp        2015-06-25 07:15:56 UTC (rev 185949)
</span><span class="lines">@@ -86,8 +86,7 @@
</span><span class="cx"> 
</span><span class="cx"> WTF::String WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory()
</span><span class="cx"> {
</span><del>-    GUniquePtr&lt;gchar&gt; cacheDirectory(g_build_filename(g_get_user_cache_dir(), &quot;webkitgtk&quot;, &quot;applications&quot;, nullptr));
-    return WebCore::filenameToString(cacheDirectory.get());
</del><ins>+    return API::WebsiteDataStore::defaultApplicationCacheDirectory();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters&amp; parameters)
</span><span class="lines">@@ -118,14 +117,12 @@
</span><span class="cx"> 
</span><span class="cx"> String WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory()
</span><span class="cx"> {
</span><del>-    GUniquePtr&lt;gchar&gt; databaseDirectory(g_build_filename(g_get_user_data_dir(), &quot;webkitgtk&quot;, &quot;databases&quot;, nullptr));
-    return WebCore::filenameToString(databaseDirectory.get());
</del><ins>+    return API::WebsiteDataStore::defaultWebSQLDatabaseDirectory();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory()
</span><span class="cx"> {
</span><del>-    GUniquePtr&lt;gchar&gt; indexedDBDatabaseDirectory(g_build_filename(g_get_user_data_dir(), &quot;webkitgtk&quot;, &quot;databases&quot;, &quot;indexeddb&quot;, nullptr));
-    return WebCore::filenameToString(indexedDBDatabaseDirectory.get());
</del><ins>+    return API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String WebProcessPool::platformDefaultIconDatabasePath() const
</span><span class="lines">@@ -136,25 +133,17 @@
</span><span class="cx"> 
</span><span class="cx"> String WebProcessPool::legacyPlatformDefaultLocalStorageDirectory()
</span><span class="cx"> {
</span><del>-    GUniquePtr&lt;gchar&gt; storageDirectory(g_build_filename(g_get_user_data_dir(), &quot;webkitgtk&quot;, &quot;localstorage&quot;, nullptr));
-    return WebCore::filenameToString(storageDirectory.get());
</del><ins>+    return API::WebsiteDataStore::defaultLocalStorageDirectory();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory()
</span><span class="cx"> {
</span><del>-    GUniquePtr&lt;gchar&gt; mediaKeysStorageDirectory(g_build_filename(g_get_user_data_dir(), &quot;webkitgtk&quot;, &quot;mediakeys&quot;, nullptr));
-    return WebCore::filenameToString(mediaKeysStorageDirectory.get());
</del><ins>+    return API::WebsiteDataStore::defaultMediaKeysStorageDirectory();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory()
</span><span class="cx"> {
</span><del>-#if ENABLE(NETWORK_CACHE)
-    static const char networkCacheSubdirectory[] = &quot;WebKitCache&quot;;
-#else
-    static const char networkCacheSubdirectory[] = &quot;webkit&quot;;
-#endif
-    GUniquePtr&lt;char&gt; diskCacheDirectory(g_build_filename(g_get_user_cache_dir(), g_get_prgname(), networkCacheSubdirectory, nullptr));
-    return WebCore::filenameToString(diskCacheDirectory.get());
</del><ins>+    return API::WebsiteDataStore::defaultNetworkCacheDirectory();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebProcessPool::setIgnoreTLSErrors(bool ignoreTLSErrors)
</span></span></pre>
</div>
</div>

</body>
</html>