<!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>[213241] trunk</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/213241">213241</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2017-03-01 14:01:13 -0800 (Wed, 01 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add SPI to create WebsiteDataStore objects pointing to custom paths.
https://bugs.webkit.org/show_bug.cgi?id=169044

Reviewed by Tim Horton.

Source/WebKit2:

* UIProcess/API/APIWebsiteDataStore.h:

* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _initWithConfiguration:]):

* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:

* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h.
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h.

* UIProcess/WebsiteData/WebsiteDataStore.h:

* WebKit2.xcodeproj/project.pbxproj:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:

* TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.mm: Added.
(-[WebsiteDataStoreCustomPathsMessageHandler userContentController:didReceiveScriptMessage:]):
(getNextMessage):
(TEST):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIWebsiteDataStoreh">trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebsiteDataStoremm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStore.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebsiteDataStorePrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebsiteDataWebsiteDataStoreh">trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoa_WKWebsiteDataStoreConfigurationh">trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoa_WKWebsiteDataStoreConfigurationmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CocoaWebsiteDataStoreCustomPathshtml">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.html</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CocoaWebsiteDataStoreCustomPathsmm">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (213240 => 213241)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2017-03-01 21:55:51 UTC (rev 213240)
+++ trunk/Source/WebKit2/ChangeLog        2017-03-01 22:01:13 UTC (rev 213241)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2017-03-01  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Add SPI to create WebsiteDataStore objects pointing to custom paths.
+        https://bugs.webkit.org/show_bug.cgi?id=169044
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/API/APIWebsiteDataStore.h:
+
+        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
+        (-[WKWebsiteDataStore _initWithConfiguration:]):
+
+        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
+
+        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h.
+        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h.
+
+        * UIProcess/WebsiteData/WebsiteDataStore.h:
+
+        * WebKit2.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2017-03-01  Jon Lee  &lt;jonlee@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Update peer connection preference
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIWebsiteDataStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h (213240 => 213241)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h        2017-03-01 21:55:51 UTC (rev 213240)
+++ trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h        2017-03-01 22:01:13 UTC (rev 213241)
</span><span class="lines">@@ -38,6 +38,8 @@
</span><span class="cx">     static RefPtr&lt;WebsiteDataStore&gt; defaultDataStore();
</span><span class="cx">     static Ref&lt;WebsiteDataStore&gt; createNonPersistentDataStore();
</span><span class="cx">     static Ref&lt;WebsiteDataStore&gt; create(WebKit::WebsiteDataStore::Configuration);
</span><ins>+
+    explicit WebsiteDataStore(WebKit::WebsiteDataStore::Configuration);
</ins><span class="cx">     virtual ~WebsiteDataStore();
</span><span class="cx"> 
</span><span class="cx">     bool isPersistent();
</span><span class="lines">@@ -58,8 +60,9 @@
</span><span class="cx">     static String defaultWebSQLDatabaseDirectory();
</span><span class="cx">     static String defaultResourceLoadStatisticsDirectory();
</span><span class="cx"> 
</span><ins>+    static WebKit::WebsiteDataStore::Configuration defaultDataStoreConfiguration();
+
</ins><span class="cx"> private:
</span><del>-    WebsiteDataStore(WebKit::WebsiteDataStore::Configuration);
</del><span class="cx">     WebsiteDataStore();
</span><span class="cx"> 
</span><span class="cx">     static String tempDirectoryFileSystemRepresentation(const String&amp; directoryName);
</span><span class="lines">@@ -66,8 +69,6 @@
</span><span class="cx">     static String cacheDirectoryFileSystemRepresentation(const String&amp; directoryName);
</span><span class="cx">     static String websiteDataDirectoryFileSystemRepresentation(const String&amp; directoryName);
</span><span class="cx"> 
</span><del>-    static WebKit::WebsiteDataStore::Configuration defaultDataStoreConfiguration();
-
</del><span class="cx">     RefPtr&lt;WebKit::WebsiteDataStore&gt; m_websiteDataStore;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebsiteDataStoremm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStore.mm (213240 => 213241)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStore.mm        2017-03-01 21:55:51 UTC (rev 213240)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStore.mm        2017-03-01 22:01:13 UTC (rev 213241)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #import &quot;WKNSArray.h&quot;
</span><span class="cx"> #import &quot;WKWebsiteDataRecordInternal.h&quot;
</span><span class="cx"> #import &quot;WebsiteDataFetchOption.h&quot;
</span><ins>+#import &quot;_WKWebsiteDataStoreConfiguration.h&quot;
</ins><span class="cx"> #import &lt;wtf/BlockPtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> @implementation WKWebsiteDataStore
</span><span class="lines">@@ -145,6 +146,25 @@
</span><span class="cx"> 
</span><span class="cx"> @implementation WKWebsiteDataStore (WKPrivate)
</span><span class="cx"> 
</span><ins>+- (instancetype)_initWithConfiguration:(_WKWebsiteDataStoreConfiguration *)configuration
+{
+    if (!(self = [super init]))
+        return nil;
+
+    auto config = API::WebsiteDataStore::defaultDataStoreConfiguration();
+
+    if (configuration.webStorageDirectory)
+        config.localStorageDirectory = configuration.webStorageDirectory;
+    if (configuration.webSQLDatabaseDirectory)
+        config.webSQLDatabaseDirectory = configuration.webSQLDatabaseDirectory;
+    if (configuration.indexedDBDatabaseDirectory)
+        config.indexedDBDatabaseDirectory = configuration.indexedDBDatabaseDirectory;
+
+    API::Object::constructInWrapper&lt;API::WebsiteDataStore&gt;(self, config);
+
+    return self;
+}
+
</ins><span class="cx"> - (void)_fetchDataRecordsOfTypes:(NSSet&lt;NSString *&gt; *)dataTypes withOptions:(_WKWebsiteDataStoreFetchOptions)options completionHandler:(void (^)(NSArray&lt;WKWebsiteDataRecord *&gt; *))completionHandler
</span><span class="cx"> {
</span><span class="cx">     auto completionHandlerCopy = makeBlockPtr(completionHandler);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebsiteDataStorePrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h (213240 => 213241)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h        2017-03-01 21:55:51 UTC (rev 213240)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h        2017-03-01 22:01:13 UTC (rev 213241)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -29,6 +29,8 @@
</span><span class="cx"> 
</span><span class="cx"> NS_ASSUME_NONNULL_BEGIN
</span><span class="cx"> 
</span><ins>+@class _WKWebsiteDataStoreConfiguration;
+
</ins><span class="cx"> typedef NS_OPTIONS(NSUInteger, _WKWebsiteDataStoreFetchOptions) {
</span><span class="cx">     _WKWebsiteDataStoreFetchOptionComputeSizes = 1 &lt;&lt; 0,
</span><span class="cx"> } WK_API_AVAILABLE(macosx(10.12), ios(10.0));
</span><span class="lines">@@ -35,6 +37,8 @@
</span><span class="cx"> 
</span><span class="cx"> @interface WKWebsiteDataStore (WKPrivate)
</span><span class="cx"> 
</span><ins>+- (instancetype)_initWithConfiguration:(_WKWebsiteDataStoreConfiguration *)configuration;
+
</ins><span class="cx"> - (void)_fetchDataRecordsOfTypes:(NSSet&lt;NSString *&gt; *)dataTypes withOptions:(_WKWebsiteDataStoreFetchOptions)options completionHandler:(void (^)(NSArray&lt;WKWebsiteDataRecord *&gt; *))completionHandler;
</span><span class="cx"> 
</span><span class="cx"> @property (nonatomic, setter=_setResourceLoadStatisticsEnabled:) BOOL _resourceLoadStatisticsEnabled WK_API_AVAILABLE(macosx(10.12), ios(10.0));
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoa_WKWebsiteDataStoreConfigurationhfromrev213240trunkSourceWebKit2UIProcessAPICocoaWKWebsiteDataStorePrivateh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h (from rev 213240, trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h) (0 => 213241)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h        2017-03-01 22:01:13 UTC (rev 213241)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+/*
+ * Copyright (C) 2017 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.
+ */
+
+#import &lt;WebKit/WKFoundation.h&gt;
+
+#if WK_API_ENABLED
+
+#import &lt;Foundation/Foundation.h&gt;
+
+NS_ASSUME_NONNULL_BEGIN
+
+WK_CLASS_AVAILABLE(macosx(10.13), ios(11.0))
+@interface _WKWebsiteDataStoreConfiguration : NSObject
+
+@property (nonatomic, copy) NSString *webStorageDirectory;
+@property (nonatomic, copy) NSString *indexedDBDatabaseDirectory;
+@property (nonatomic, copy) NSString *webSQLDatabaseDirectory;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoa_WKWebsiteDataStoreConfigurationmmfromrev213240trunkSourceWebKit2UIProcessAPICocoaWKWebsiteDataStorePrivateh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm (from rev 213240, trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h) (0 => 213241)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm        2017-03-01 22:01:13 UTC (rev 213241)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+/*
+ * Copyright (C) 2017 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.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;_WKWebsiteDataStoreConfiguration.h&quot;
+
+#if WK_API_ENABLED
+
+@implementation _WKWebsiteDataStoreConfiguration
+
+@end
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebsiteDataWebsiteDataStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h (213240 => 213241)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h        2017-03-01 21:55:51 UTC (rev 213240)
+++ trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h        2017-03-01 22:01:13 UTC (rev 213241)
</span><span class="lines">@@ -63,6 +63,7 @@
</span><span class="cx">         String applicationCacheFlatFileSubdirectoryName;
</span><span class="cx"> 
</span><span class="cx">         String mediaCacheDirectory;
</span><ins>+        String indexedDBDatabaseDirectory;
</ins><span class="cx">         String webSQLDatabaseDirectory;
</span><span class="cx">         String localStorageDirectory;
</span><span class="cx">         String mediaKeysStorageDirectory;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (213240 => 213241)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2017-03-01 21:55:51 UTC (rev 213240)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2017-03-01 22:01:13 UTC (rev 213241)
</span><span class="lines">@@ -935,6 +935,8 @@
</span><span class="cx">                 511F8A7B138B460900A95F44 /* SecItemShimLibrary.h in Headers */ = {isa = PBXBuildFile; fileRef = 511F8A77138B460900A95F44 /* SecItemShimLibrary.h */; };
</span><span class="cx">                 511F8A81138B485D00A95F44 /* SecItemShimLibrary.mm in Sources */ = {isa = PBXBuildFile; fileRef = 511F8A78138B460900A95F44 /* SecItemShimLibrary.mm */; };
</span><span class="cx">                 5120C8311E54EDDE0025B250 /* LocalStorageDatabaseTrackerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5120C8301E54E2650025B250 /* LocalStorageDatabaseTrackerIOS.mm */; };
</span><ins>+                5120C8351E5B74B90025B250 /* _WKWebsiteDataStoreConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 5120C8331E5B71570025B250 /* _WKWebsiteDataStoreConfiguration.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                5120C8361E5B74BE0025B250 /* _WKWebsiteDataStoreConfiguration.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5120C8341E5B71570025B250 /* _WKWebsiteDataStoreConfiguration.mm */; };
</ins><span class="cx">                 512127C31908239A00DAF35C /* WebPasteboardOverrides.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512127C11908239A00DAF35C /* WebPasteboardOverrides.cpp */; };
</span><span class="cx">                 512127C41908239A00DAF35C /* WebPasteboardOverrides.h in Headers */ = {isa = PBXBuildFile; fileRef = 512127C21908239A00DAF35C /* WebPasteboardOverrides.h */; };
</span><span class="cx">                 51217460164C20E30037A5C1 /* ShareableResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5121745E164C20E30037A5C1 /* ShareableResource.cpp */; };
</span><span class="lines">@@ -3111,6 +3113,8 @@
</span><span class="cx">                 511F8A77138B460900A95F44 /* SecItemShimLibrary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SecItemShimLibrary.h; path = ../../WebProcess/mac/SecItemShimLibrary.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 511F8A78138B460900A95F44 /* SecItemShimLibrary.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SecItemShimLibrary.mm; path = ../../WebProcess/mac/SecItemShimLibrary.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5120C8301E54E2650025B250 /* LocalStorageDatabaseTrackerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LocalStorageDatabaseTrackerIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                5120C8331E5B71570025B250 /* _WKWebsiteDataStoreConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKWebsiteDataStoreConfiguration.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                5120C8341E5B71570025B250 /* _WKWebsiteDataStoreConfiguration.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKWebsiteDataStoreConfiguration.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 512127C11908239A00DAF35C /* WebPasteboardOverrides.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPasteboardOverrides.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 512127C21908239A00DAF35C /* WebPasteboardOverrides.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPasteboardOverrides.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5121745E164C20E30037A5C1 /* ShareableResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShareableResource.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5452,6 +5456,8 @@
</span><span class="cx">                                 1AE286761C7E76510069AC4F /* _WKWebsiteDataSize.h */,
</span><span class="cx">                                 1AE286751C7E76510069AC4F /* _WKWebsiteDataSize.mm */,
</span><span class="cx">                                 1AE2867F1C7F92BF0069AC4F /* _WKWebsiteDataSizeInternal.h */,
</span><ins>+                                5120C8331E5B71570025B250 /* _WKWebsiteDataStoreConfiguration.h */,
+                                5120C8341E5B71570025B250 /* _WKWebsiteDataStoreConfiguration.mm */,
</ins><span class="cx">                                 5CB237891DF0DD4300117AA3 /* _WKWebsitePolicies.h */,
</span><span class="cx">                                 5CB2378A1DF0DD4300117AA3 /* _WKWebsitePolicies.mm */,
</span><span class="cx">                                 5CB2378D1DF0E0C200117AA3 /* _WKWebsitePoliciesInternal.h */,
</span><span class="lines">@@ -8466,6 +8472,7 @@
</span><span class="cx">                                 1AB1F77E1D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyCocoa.h in Headers */,
</span><span class="cx">                                 1AB1F7991D1B3613007C9BD1 /* WebPaymentCoordinatorProxyMessages.h in Headers */,
</span><span class="cx">                                 1A3E736111CC2659007BD539 /* WebPlatformStrategies.h in Headers */,
</span><ins>+                                5120C8351E5B74B90025B250 /* _WKWebsiteDataStoreConfiguration.h in Headers */,
</ins><span class="cx">                                 CDA29A1B1CBDBF4100901CCF /* WebPlaybackSessionManager.h in Headers */,
</span><span class="cx">                                 CDA29A291CBEB67A00901CCF /* WebPlaybackSessionManagerMessages.h in Headers */,
</span><span class="cx">                                 CDA29A201CBEB5FB00901CCF /* WebPlaybackSessionManagerProxy.h in Headers */,
</span><span class="lines">@@ -9748,6 +9755,7 @@
</span><span class="cx">                                 1A6FB7D211E651E200DB1371 /* Plugin.cpp in Sources */,
</span><span class="cx">                                 31A67E0C165B2A99006CBA66 /* PlugInAutoStartProvider.cpp in Sources */,
</span><span class="cx">                                 1A8EF4CC1252403700F7067F /* PluginControllerProxy.cpp in Sources */,
</span><ins>+                                5120C8361E5B74BE0025B250 /* _WKWebsiteDataStoreConfiguration.mm in Sources */,
</ins><span class="cx">                                 1A2D91A61281D739001EB962 /* PluginControllerProxyMac.mm in Sources */,
</span><span class="cx">                                 1A8EF96E1252AF6B00F7067F /* PluginControllerProxyMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 1A17977F137EE82C00F97D45 /* PluginCreationParameters.cpp in Sources */,
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (213240 => 213241)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2017-03-01 21:55:51 UTC (rev 213240)
+++ trunk/Tools/ChangeLog        2017-03-01 22:01:13 UTC (rev 213241)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2017-03-01  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Add SPI to create WebsiteDataStore objects pointing to custom paths.
+        https://bugs.webkit.org/show_bug.cgi?id=169044
+
+        Reviewed by Tim Horton.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        
+        * TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.html: Added.
+        * TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.mm: Added.
+        (-[WebsiteDataStoreCustomPathsMessageHandler userContentController:didReceiveScriptMessage:]):
+        (getNextMessage):
+        (TEST):
+
</ins><span class="cx"> 2017-03-01  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add a way to watch the CSSProperties.json file, and add me and Dan Bates to watch it.
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (213240 => 213241)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2017-03-01 21:55:51 UTC (rev 213240)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2017-03-01 22:01:13 UTC (rev 213241)
</span><span class="lines">@@ -129,6 +129,8 @@
</span><span class="cx">                 5110FCF61E01CD83006F8D0B /* IndexUpgrade.sqlite3 in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5110FCF31E01CD77006F8D0B /* IndexUpgrade.sqlite3 */; };
</span><span class="cx">                 5110FCF91E01CD8A006F8D0B /* IndexUpgrade.blob in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5110FCF21E01CD77006F8D0B /* IndexUpgrade.blob */; };
</span><span class="cx">                 5110FCFA1E01CDB8006F8D0B /* IDBIndexUpgradeToV2.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5110FCEF1E01CBAA006F8D0B /* IDBIndexUpgradeToV2.mm */; };
</span><ins>+                5120C83D1E6751290025B250 /* WebsiteDataStoreCustomPaths.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5120C83C1E6750790025B250 /* WebsiteDataStoreCustomPaths.mm */; };
+                5120C83E1E67678F0025B250 /* WebsiteDataStoreCustomPaths.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5120C83B1E674E350025B250 /* WebsiteDataStoreCustomPaths.html */; };
</ins><span class="cx">                 51393E221523952D005F39C5 /* DOMWindowExtensionBasic_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51393E1D1523944A005F39C5 /* DOMWindowExtensionBasic_Bundle.cpp */; };
</span><span class="cx">                 5142B2731517C8C800C32B19 /* ContextMenuCanCopyURL.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5142B2721517C89100C32B19 /* ContextMenuCanCopyURL.html */; };
</span><span class="cx">                 515BE16F1D428BB100DD7C68 /* StoreBlobToBeDeleted.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 515BE16E1D4288FF00DD7C68 /* StoreBlobToBeDeleted.html */; };
</span><span class="lines">@@ -640,6 +642,7 @@
</span><span class="cx">                         dstPath = TestWebKitAPI.resources;
</span><span class="cx">                         dstSubfolderSpec = 7;
</span><span class="cx">                         files = (
</span><ins>+                                5120C83E1E67678F0025B250 /* WebsiteDataStoreCustomPaths.html in Copy Resources */,
</ins><span class="cx">                                 F4856CA31E649EA8009D7EE7 /* attachment-element.html in Copy Resources */,
</span><span class="cx">                                 8361F1781E610B4E00759B25 /* link-with-download-attribute-with-slashes.html in Copy Resources */,
</span><span class="cx">                                 F4FA91831E61857B007B8C1D /* double-click-does-not-select-trailing-space.html in Copy Resources */,
</span><span class="lines">@@ -1006,6 +1009,8 @@
</span><span class="cx">                 5110FCF01E01CD53006F8D0B /* IDBIndexUpgradeToV2.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = IDBIndexUpgradeToV2.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5110FCF21E01CD77006F8D0B /* IndexUpgrade.blob */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IndexUpgrade.blob; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5110FCF31E01CD77006F8D0B /* IndexUpgrade.sqlite3 */ = {isa = PBXFileReference; lastKnownFileType = file; path = IndexUpgrade.sqlite3; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                5120C83B1E674E350025B250 /* WebsiteDataStoreCustomPaths.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = WebsiteDataStoreCustomPaths.html; sourceTree = &quot;&lt;group&gt;&quot;; };
+                5120C83C1E6750790025B250 /* WebsiteDataStoreCustomPaths.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebsiteDataStoreCustomPaths.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 51393E1D1523944A005F39C5 /* DOMWindowExtensionBasic_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowExtensionBasic_Bundle.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51393E1E1523944A005F39C5 /* DOMWindowExtensionBasic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowExtensionBasic.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5142B2701517C88B00C32B19 /* ContextMenuCanCopyURL.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ContextMenuCanCopyURL.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -1627,6 +1632,7 @@
</span><span class="cx">                                 7CCB99201D3B41F6003922F6 /* UserInitiatedActionInNavigationAction.mm */,
</span><span class="cx">                                 93E943F11CD3E87E00AC08C2 /* VideoControlsManager.mm */,
</span><span class="cx">                                 51714EB61CF8C7A4004723C4 /* WebProcessKillIDBCleanup.mm */,
</span><ins>+                                5120C83C1E6750790025B250 /* WebsiteDataStoreCustomPaths.mm */,
</ins><span class="cx">                                 5C9E56841DF9143D00C9EE33 /* WebsitePolicies.mm */,
</span><span class="cx">                                 1F83571A1D3FFB0E00E3967B /* WKBackForwardList.mm */,
</span><span class="cx">                                 375E0E151D66674400EFEC2C /* WKNSNumber.mm */,
</span><span class="lines">@@ -1807,6 +1813,7 @@
</span><span class="cx">                                 515BE16E1D4288FF00DD7C68 /* StoreBlobToBeDeleted.html */,
</span><span class="cx">                                 51714EB21CF8C761004723C4 /* WebProcessKillIDBCleanup-1.html */,
</span><span class="cx">                                 51714EB31CF8C761004723C4 /* WebProcessKillIDBCleanup-2.html */,
</span><ins>+                                5120C83B1E674E350025B250 /* WebsiteDataStoreCustomPaths.html */,
</ins><span class="cx">                                 C25CCA0A1E513F490026CB8A /* LineBreaking.html */,
</span><span class="cx">                                 C25CCA0C1E5140E50026CB8A /* AllAhem.svg */,
</span><span class="cx">                                 F4856CA21E6498A8009D7EE7 /* attachment-element.html */,
</span><span class="lines">@@ -2848,6 +2855,7 @@
</span><span class="cx">                                 CDCFA7AA1E45183200C2433D /* SampleMap.cpp in Sources */,
</span><span class="cx">                                 7CCE7F1A1A411AE600447C4C /* WebCoreStatisticsWithNoWebProcess.cpp in Sources */,
</span><span class="cx">                                 7CCE7EAB1A411A2400447C4C /* WebKitAgnosticTest.mm in Sources */,
</span><ins>+                                5120C83D1E6751290025B250 /* WebsiteDataStoreCustomPaths.mm in Sources */,
</ins><span class="cx">                                 51714EB81CF8CA17004723C4 /* WebProcessKillIDBCleanup.mm in Sources */,
</span><span class="cx">                                 536770341CC8022800D425B1 /* WebScriptObjectDescription.mm in Sources */,
</span><span class="cx">                                 1CAD1F861E5CE7DA00AF2C2C /* FontCache.cpp in Sources */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaWebsiteDataStoreCustomPathshtml"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.html (0 => 213241)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.html                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.html        2017-03-01 22:01:13 UTC (rev 213241)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+&lt;script&gt;
+
+// This test opens an IndexedDB, a WebSQL db, and makes a localStorage write.
+
+function log(msg)
+{
+    window.webkit.messageHandlers.testHandler.postMessage(msg);
+    //alert(msg);
+}
+
+localStorage.foo = &quot;bar&quot;;
+log('localstorage written');
+
+var request = window.indexedDB.open(&quot;WebsiteDataStoreCustomPaths&quot;);
+
+request.onsuccess = function(event)
+{
+    log('Success opening indexed database');
+}
+
+request.onerror = function()
+{
+    log('Unexpected error opening indexed database');
+}
+
+try {
+openDatabase('WebsiteDataStoreCustomPathsSQL', '1.0', 'Test DB', 524288, function() {
+    log('WebSQL database created');
+});
+} catch(e) {
+    // An exception is fine, because the database tracker will still be installed at the expected path
+    log('Exception: ' + e);
+}
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaWebsiteDataStoreCustomPathsmm"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.mm (0 => 213241)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.mm                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.mm        2017-03-01 22:01:13 UTC (rev 213241)
</span><span class="lines">@@ -0,0 +1,115 @@
</span><ins>+/*
+ * Copyright (C) 2017 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.
+ */
+
+#import &quot;config.h&quot;
+
+#import &quot;PlatformUtilities.h&quot;
+#import &quot;Test.h&quot;
+#import &lt;WebKit/WebKit.h&gt;
+
+#import &lt;WebKit/WKProcessPoolPrivate.h&gt;
+#import &lt;WebKit/WKUserContentControllerPrivate.h&gt;
+#import &lt;WebKit/WKWebViewConfigurationPrivate.h&gt;
+#import &lt;WebKit/WKWebViewPrivate.h&gt;
+#import &lt;WebKit/WKWebsiteDataStorePrivate.h&gt;
+#import &lt;WebKit/_WKProcessPoolConfiguration.h&gt;
+#import &lt;WebKit/_WKUserStyleSheet.h&gt;
+#import &lt;WebKit/_WKWebsiteDataStoreConfiguration.h&gt;
+#import &lt;wtf/Deque.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+#if WK_API_ENABLED
+
+static bool receivedScriptMessage;
+static Deque&lt;RetainPtr&lt;WKScriptMessage&gt;&gt; scriptMessages;
+
+@interface WebsiteDataStoreCustomPathsMessageHandler : NSObject &lt;WKScriptMessageHandler&gt;
+@end
+
+@implementation WebsiteDataStoreCustomPathsMessageHandler
+
+- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message
+{
+    printf(&quot;Message!\n&quot;);
+    receivedScriptMessage = true;
+    scriptMessages.append(message);
+}
+
+@end
+
+static WKScriptMessage *getNextMessage()
+{
+    if (scriptMessages.isEmpty()) {
+        receivedScriptMessage = false;
+        TestWebKitAPI::Util::run(&amp;receivedScriptMessage);
+    }
+
+    return [[scriptMessages.takeFirst() retain] autorelease];
+}
+
+TEST(WebKit2, WebsiteDataStoreCustomPaths)
+{
+    RetainPtr&lt;WebsiteDataStoreCustomPathsMessageHandler&gt; handler = adoptNS([[WebsiteDataStoreCustomPathsMessageHandler alloc] init]);
+    RetainPtr&lt;WKWebViewConfiguration&gt; configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
+    [[configuration userContentController] addScriptMessageHandler:handler.get() name:@&quot;testHandler&quot;];
+
+    NSString *sqlPath = [@&quot;~/Library/WebKit/TestWebKitAPI/CustomWebsiteData/WebSQL/&quot; stringByExpandingTildeInPath];
+    NSString *idbPath = [@&quot;~/Library/WebKit/TestWebKitAPI/CustomWebsiteData/IndexedDB/&quot; stringByExpandingTildeInPath];
+    NSString *localStoragePath = [@&quot;~/Library/WebKit/TestWebKitAPI/CustomWebsiteData/LocalStorage/&quot; stringByExpandingTildeInPath];
+
+    [[NSFileManager defaultManager] removeItemAtURL:[NSURL fileURLWithPath:sqlPath] error:nil];
+    [[NSFileManager defaultManager] removeItemAtURL:[NSURL fileURLWithPath:idbPath] error:nil];
+    [[NSFileManager defaultManager] removeItemAtURL:[NSURL fileURLWithPath:localStoragePath] error:nil];
+
+    EXPECT_FALSE([[NSFileManager defaultManager] fileExistsAtPath:sqlPath]);
+    EXPECT_FALSE([[NSFileManager defaultManager] fileExistsAtPath:localStoragePath]);
+    EXPECT_FALSE([[NSFileManager defaultManager] fileExistsAtPath:idbPath]);
+
+    _WKWebsiteDataStoreConfiguration *websiteDataStoreConfiguration = [[_WKWebsiteDataStoreConfiguration alloc] init];
+    websiteDataStoreConfiguration.webSQLDatabaseDirectory = sqlPath;
+    websiteDataStoreConfiguration.indexedDBDatabaseDirectory = idbPath;
+    websiteDataStoreConfiguration.webStorageDirectory = localStoragePath;
+    
+    configuration.get().websiteDataStore = [[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration];
+    [websiteDataStoreConfiguration release];
+
+    RetainPtr&lt;WKWebView&gt; webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
+
+    NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@&quot;WebsiteDataStoreCustomPaths&quot; withExtension:@&quot;html&quot; subdirectory:@&quot;TestWebKitAPI.resources&quot;]];
+    [webView loadRequest:request];
+
+    // We expect 3 messages, 1 each for WebSQL, IndexedDB, and localStorage.
+    getNextMessage();
+    getNextMessage();
+    getNextMessage();
+
+    EXPECT_TRUE([[NSFileManager defaultManager] fileExistsAtPath:sqlPath]);
+    EXPECT_TRUE([[NSFileManager defaultManager] fileExistsAtPath:localStoragePath]);
+
+    // FIXME: &lt;rdar://problem/30785618&gt; - We don't yet support IDB database processes at custom paths per WebsiteDataStore
+    // EXPECT_TRUE([[NSFileManager defaultManager] fileExistsAtPath:idbPath]);
+}
+
+#endif
</ins></span></pre>
</div>
</div>

</body>
</html>