<!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>[202984] 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/202984">202984</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-07-08 10:03:12 -0700 (Fri, 08 Jul 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Clearing LocalStorage doesn't also delete -wal and -shm files.
&lt;rdar://problem/27206772&gt; and https://bugs.webkit.org/show_bug.cgi?id=159566

Reviewed by Brent Fulgham.
Also helpfully picked over by Andy &quot;Never Forgets&quot; Estes.

Source/WebCore:

Covered by new API test.

* WebCore.xcodeproj/project.pbxproj:

* platform/sql/SQLiteFileSystem.h:

Source/WebKit2:

* UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.mm: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformsqlSQLiteFileSystemh">trunk/Source/WebCore/platform/sql/SQLiteFileSystem.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessStorageLocalStorageDatabaseTrackercpp">trunk/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp</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="#trunkToolsTestWebKitAPITestsWebKit2CocoaLocalStorageClearhtml">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.html</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CocoaLocalStorageClearmm">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (202983 => 202984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-08 16:42:20 UTC (rev 202983)
+++ trunk/Source/WebCore/ChangeLog        2016-07-08 17:03:12 UTC (rev 202984)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-07-08  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Clearing LocalStorage doesn't also delete -wal and -shm files.
+        &lt;rdar://problem/27206772&gt; and https://bugs.webkit.org/show_bug.cgi?id=159566
+
+        Reviewed by Brent Fulgham.
+        Also helpfully picked over by Andy &quot;Never Forgets&quot; Estes.
+
+        Covered by new API test.
+
+        * WebCore.xcodeproj/project.pbxproj:
+
+        * platform/sql/SQLiteFileSystem.h:
+
</ins><span class="cx"> 2016-07-08  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r202945.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (202983 => 202984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-07-08 16:42:20 UTC (rev 202983)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-07-08 17:03:12 UTC (rev 202984)
</span><span class="lines">@@ -5415,7 +5415,7 @@
</span><span class="cx">                 B59DD6A911902A71007E9684 /* JSSQLStatementErrorCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = B59DD6A711902A71007E9684 /* JSSQLStatementErrorCallback.h */; };
</span><span class="cx">                 B59DD6AA11902A71007E9684 /* JSSQLStatementErrorCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B59DD6A811902A71007E9684 /* JSSQLStatementErrorCallback.cpp */; };
</span><span class="cx">                 B59ED23B18272679006D564C /* RenderAncestorIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = B59ED23A18272679006D564C /* RenderAncestorIterator.h */; };
</span><del>-                B5A684220FFABE9800D24689 /* SQLiteFileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = B5A684210FFABE9800D24689 /* SQLiteFileSystem.h */; };
</del><ins>+                B5A684220FFABE9800D24689 /* SQLiteFileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = B5A684210FFABE9800D24689 /* SQLiteFileSystem.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 B5A684240FFABEAA00D24689 /* SQLiteFileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5A684230FFABEAA00D24689 /* SQLiteFileSystem.cpp */; };
</span><span class="cx">                 B5B65874186FDE4C009C26E8 /* RenderPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = ADE16736181050C300463A2E /* RenderPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 B5B7A17017C10AA800E4AA0A /* ElementData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5B7A16F17C1080600E4AA0A /* ElementData.cpp */; };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformsqlSQLiteFileSystemh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/sql/SQLiteFileSystem.h (202983 => 202984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/sql/SQLiteFileSystem.h        2016-07-08 16:42:20 UTC (rev 202983)
+++ trunk/Source/WebCore/platform/sql/SQLiteFileSystem.h        2016-07-08 17:03:12 UTC (rev 202984)
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx">     // Deletes a database file.
</span><span class="cx">     //
</span><span class="cx">     // fileName - The file name.
</span><del>-    static bool deleteDatabaseFile(const String&amp; fileName);
</del><ins>+    WEBCORE_EXPORT static bool deleteDatabaseFile(const String&amp; fileName);
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     // Truncates a database file. Used when MobileSafariSettings deletes a database file,
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (202983 => 202984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-07-08 16:42:20 UTC (rev 202983)
+++ trunk/Source/WebKit2/ChangeLog        2016-07-08 17:03:12 UTC (rev 202984)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-07-08  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Clearing LocalStorage doesn't also delete -wal and -shm files.
+        &lt;rdar://problem/27206772&gt; and https://bugs.webkit.org/show_bug.cgi?id=159566
+
+        Reviewed by Brent Fulgham.
+        Also helpfully picked over by Andy &quot;Never Forgets&quot; Estes.
+
+        * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
+        (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier):
+
</ins><span class="cx"> 2016-07-07  Andy Estes  &lt;aestes@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Content Filtering] Load blocked pages more like other error pages are loaded
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessStorageLocalStorageDatabaseTrackercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp (202983 => 202984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp        2016-07-08 16:42:20 UTC (rev 202983)
+++ trunk/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp        2016-07-08 17:03:12 UTC (rev 202984)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include &quot;LocalStorageDatabaseTracker.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &lt;WebCore/FileSystem.h&gt;
</span><ins>+#include &lt;WebCore/SQLiteFilesystem.h&gt;
</ins><span class="cx"> #include &lt;WebCore/SQLiteStatement.h&gt;
</span><span class="cx"> #include &lt;WebCore/SecurityOrigin.h&gt;
</span><span class="cx"> #include &lt;WebCore/TextEncoding.h&gt;
</span><span class="lines">@@ -336,13 +337,13 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    deleteFile(path);
</del><ins>+    SQLiteFileSystem::deleteDatabaseFile(path);
</ins><span class="cx"> 
</span><span class="cx">     m_origins.remove(originIdentifier);
</span><span class="cx">     if (m_origins.isEmpty()) {
</span><span class="cx">         // There are no origins left; delete the tracker database.
</span><span class="cx">         m_database.close();
</span><del>-        deleteFile(trackerDatabasePath());
</del><ins>+        SQLiteFileSystem::deleteDatabaseFile(trackerDatabasePath());
</ins><span class="cx">         deleteEmptyDirectory(m_localStorageDirectory);
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (202983 => 202984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-07-08 16:42:20 UTC (rev 202983)
+++ trunk/Tools/ChangeLog        2016-07-08 17:03:12 UTC (rev 202984)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-07-08  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Clearing LocalStorage doesn't also delete -wal and -shm files.
+        &lt;rdar://problem/27206772&gt; and https://bugs.webkit.org/show_bug.cgi?id=159566
+
+        Reviewed by Brent Fulgham.
+        Also helpfully picked over by Andy &quot;Never Forgets&quot; Estes.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.html: Added.
+        * TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.mm: Added.
+
</ins><span class="cx"> 2016-07-08  Konstantin Tokarev  &lt;annulen@yandex.ru&gt;
</span><span class="cx"> 
</span><span class="cx">         Removed Qt leftovers from Tools.
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (202983 => 202984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-07-08 16:42:20 UTC (rev 202983)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-07-08 17:03:12 UTC (rev 202984)
</span><span class="lines">@@ -87,6 +87,8 @@
</span><span class="cx">                 51CD1C721B38D48400142CA5 /* modal-alerts-in-new-about-blank-window.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 51CD1C711B38D48400142CA5 /* modal-alerts-in-new-about-blank-window.html */; };
</span><span class="cx">                 51E5C7021919C3B200D8B3E1 /* simple2.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 51E780361919AFF8001829A2 /* simple2.html */; };
</span><span class="cx">                 51E5C7031919C3B200D8B3E1 /* simple3.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 51E780371919AFF8001829A2 /* simple3.html */; };
</span><ins>+                51E6A8941D2F1C0A00C004B6 /* LocalStorageClear.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51E6A8921D2F1BEC00C004B6 /* LocalStorageClear.mm */; };
+                51E6A8961D2F1CA700C004B6 /* LocalStorageClear.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 51E6A8951D2F1C7700C004B6 /* LocalStorageClear.html */; };
</ins><span class="cx">                 51FCF7A11534B2A000104491 /* ShouldGoToBackForwardListItem_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FCF7971534AC6D00104491 /* ShouldGoToBackForwardListItem_Bundle.cpp */; };
</span><span class="cx">                 520BCF4C141EB09E00937EA8 /* WebArchive_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 520BCF4A141EB09E00937EA8 /* WebArchive_Bundle.cpp */; };
</span><span class="cx">                 524BBC9E19DF72C0002F1AF1 /* file-with-video.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 524BBC9B19DF3714002F1AF1 /* file-with-video.html */; };
</span><span class="lines">@@ -479,6 +481,7 @@
</span><span class="cx">                         dstPath = TestWebKitAPI.resources;
</span><span class="cx">                         dstSubfolderSpec = 7;
</span><span class="cx">                         files = (
</span><ins>+                                51E6A8961D2F1CA700C004B6 /* LocalStorageClear.html in Copy Resources */,
</ins><span class="cx">                                 51A587851D2739E3004BA9AF /* IndexedDBDatabaseProcessKill-1.html in Copy Resources */,
</span><span class="cx">                                 510477771D298E72009747EB /* IDBDeleteRecovery.html in Copy Resources */,
</span><span class="cx">                                 510477721D298DDD009747EB /* IDBDeleteRecovery.sqlite3 in Copy Resources */,
</span><span class="lines">@@ -733,6 +736,8 @@
</span><span class="cx">                 51CD1C6A1B38CE3600142CA5 /* ModalAlerts.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ModalAlerts.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51CD1C711B38D48400142CA5 /* modal-alerts-in-new-about-blank-window.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = &quot;modal-alerts-in-new-about-blank-window.html&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51E5C7041919EA5F00D8B3E1 /* ShouldKeepCurrentBackForwardListItemInList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShouldKeepCurrentBackForwardListItemInList.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                51E6A8921D2F1BEC00C004B6 /* LocalStorageClear.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LocalStorageClear.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                51E6A8951D2F1C7700C004B6 /* LocalStorageClear.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = LocalStorageClear.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 51E780361919AFF8001829A2 /* simple2.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = simple2.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51E780371919AFF8001829A2 /* simple3.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = simple3.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51E93016156B13E1004C99DF /* WKPageGetScaleFactorNotZero.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKPageGetScaleFactorNotZero.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -1181,6 +1186,7 @@
</span><span class="cx">                                 51B1EE8D1C80F5880064FB98 /* IndexedDBPersistence.mm */,
</span><span class="cx">                                 37D36ED61AF42ECD00BAF5D9 /* LoadAlternateHTMLString.mm */,
</span><span class="cx">                                 57901FAC1CAF12C200ED64F9 /* LoadInvalidURLRequest.mm */,
</span><ins>+                                51E6A8921D2F1BEC00C004B6 /* LocalStorageClear.mm */,
</ins><span class="cx">                                 51CD1C6A1B38CE3600142CA5 /* ModalAlerts.mm */,
</span><span class="cx">                                 1ABC3DED1899BE6D004F0626 /* Navigation.mm */,
</span><span class="cx">                                 CEA6CF2219CCF5BD0064F5A7 /* OpenAndCloseWindow.mm */,
</span><span class="lines">@@ -1293,6 +1299,7 @@
</span><span class="cx">                                 51A5877C1D1B3D8D004BA9AF /* IndexedDBMultiProcess-3.html */,
</span><span class="cx">                                 51B1EE941C80FADD0064FB98 /* IndexedDBPersistence-1.html */,
</span><span class="cx">                                 51B1EE951C80FADD0064FB98 /* IndexedDBPersistence-2.html */,
</span><ins>+                                51E6A8951D2F1C7700C004B6 /* LocalStorageClear.html */,
</ins><span class="cx">                                 51714EB21CF8C761004723C4 /* WebProcessKillIDBCleanup-1.html */,
</span><span class="cx">                                 51714EB31CF8C761004723C4 /* WebProcessKillIDBCleanup-2.html */,
</span><span class="cx">                                 93CFA8661CEB9DE1000565A8 /* autofocused-text-input.html */,
</span><span class="lines">@@ -2098,6 +2105,7 @@
</span><span class="cx">                                 51714EB81CF8CA17004723C4 /* WebProcessKillIDBCleanup.mm in Sources */,
</span><span class="cx">                                 7CCE7EFA1A411AE600447C4C /* HitTestResultNodeHandle.cpp in Sources */,
</span><span class="cx">                                 7CCE7EC11A411A7E00447C4C /* HTMLCollectionNamedItem.mm in Sources */,
</span><ins>+                                51E6A8941D2F1C0A00C004B6 /* LocalStorageClear.mm in Sources */,
</ins><span class="cx">                                 7CCE7EC21A411A7E00447C4C /* HTMLFormCollectionNamedItem.mm in Sources */,
</span><span class="cx">                                 7CCE7EFB1A411AE600447C4C /* InjectedBundleBasic.cpp in Sources */,
</span><span class="cx">                                 7CCE7EFC1A411AE600447C4C /* InjectedBundleFrameHitTest.cpp in Sources */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaLocalStorageClearhtml"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.html (0 => 202984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.html                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.html        2016-07-08 17:03:12 UTC (rev 202984)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+&lt;script&gt;
+
+window.localStorage.foo = &quot;bar&quot;;
+window.webkit.messageHandlers.testHandler.postMessage('Go ahead and clear it');
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaLocalStorageClearmm"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.mm (0 => 202984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.mm                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.mm        2016-07-08 17:03:12 UTC (rev 202984)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+/*
+ * Copyright (C) 2016 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/WKProcessPoolPrivate.h&gt;
+#import &lt;WebKit/WKUserContentControllerPrivate.h&gt;
+#import &lt;WebKit/WKWebsiteDataStore.h&gt;
+#import &lt;WebKit/WKWebViewConfigurationPrivate.h&gt;
+#import &lt;WebKit/WebKit.h&gt;
+#import &lt;WebKit/_WKProcessPoolConfiguration.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+#if WK_API_ENABLED
+
+static bool readyToContinue;
+
+@interface LocalStorageClearMessageHandler : NSObject &lt;WKScriptMessageHandler&gt;
+@end
+
+@implementation LocalStorageClearMessageHandler
+
+- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message
+{
+    readyToContinue = true;
+}
+
+@end
+
+TEST(WKWebView, LocalStorageClear)
+{
+    RetainPtr&lt;LocalStorageClearMessageHandler&gt; handler = adoptNS([[LocalStorageClearMessageHandler alloc] init]);
+    RetainPtr&lt;WKWebViewConfiguration&gt; configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
+    [[configuration userContentController] addScriptMessageHandler:handler.get() name:@&quot;testHandler&quot;];
+
+    [configuration _setAllowUniversalAccessFromFileURLs:YES];
+
+    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;LocalStorageClear&quot; withExtension:@&quot;html&quot; subdirectory:@&quot;TestWebKitAPI.resources&quot;]];
+    [webView loadRequest:request];
+
+    TestWebKitAPI::Util::run(&amp;readyToContinue);
+    readyToContinue = false;
+
+    webView = nil;
+
+    NSString *dbPath = [@&quot;~/Library/WebKit/TestWebKitAPI/WebsiteData/LocalStorage/file__0.localstorage&quot; stringByExpandingTildeInPath];
+    NSString *dbSHMPath = [@&quot;~/Library/WebKit/TestWebKitAPI/WebsiteData/LocalStorage/file__0.localstorage-shm&quot; stringByExpandingTildeInPath];
+    NSString *dbWALPath = [@&quot;~/Library/WebKit/TestWebKitAPI/WebsiteData/LocalStorage/file__0.localstorage-wal&quot; stringByExpandingTildeInPath];
+    NSString *trackerPath = [@&quot;~/Library/WebKit/TestWebKitAPI/WebsiteData/LocalStorage/StorageTracker.db&quot; stringByExpandingTildeInPath];
+    NSString *trackerSHMPath = [@&quot;~/Library/WebKit/TestWebKitAPI/WebsiteData/LocalStorage/StorageTracker.db-shm&quot; stringByExpandingTildeInPath];
+    NSString *trackerWALPath = [@&quot;~/Library/WebKit/TestWebKitAPI/WebsiteData/LocalStorage/StorageTracker.db-wal&quot; stringByExpandingTildeInPath];
+
+    [[WKWebsiteDataStore defaultDataStore] removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate distantPast] completionHandler:^() {
+        EXPECT_FALSE([[NSFileManager defaultManager] fileExistsAtPath:dbPath]);
+        EXPECT_FALSE([[NSFileManager defaultManager] fileExistsAtPath:dbSHMPath]);
+        EXPECT_FALSE([[NSFileManager defaultManager] fileExistsAtPath:dbWALPath]);
+        EXPECT_FALSE([[NSFileManager defaultManager] fileExistsAtPath:trackerPath]);
+        EXPECT_FALSE([[NSFileManager defaultManager] fileExistsAtPath:trackerSHMPath]);
+        EXPECT_FALSE([[NSFileManager defaultManager] fileExistsAtPath:trackerWALPath]);
+        readyToContinue = true;
+    }];
+
+    TestWebKitAPI::Util::run(&amp;readyToContinue);
+}
+
+#endif
</ins></span></pre>
</div>
</div>

</body>
</html>