<!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>[191628] trunk/Source</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/191628">191628</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-10-27 11:49:58 -0700 (Tue, 27 Oct 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add WebKit API to clear data type Search Field Recent Searches.
https://bugs.webkit.org/show_bug.cgi?id=150019.

Patch by Zhuo Li &lt;zachli@apple.com&gt; on 2015-10-27
Reviewed by Anders Carlsson.

Source/WebCore:

* platform/cocoa/SearchPopupMenuCocoa.h: Add a function to remove recent searches based on
time.
* platform/cocoa/SearchPopupMenuCocoa.mm:
(WebCore::typeCheckedRecentSearchesArray): Return nil if the recent searches array is
corrupted, otherwise return the array.
(WebCore::typeCheckedDateInRecentSearch): Return nil if the date in recent search is
corrupted, otherwise return the date.
(WebCore::typeCheckedRecentSearchesRemovingRecentSearchesAddedAfterDate): Return nil if the recent searches plist is
corrupted, otherwise return the recent searches plist.
(WebCore::writeEmptyRecentSearchesPlist): Replace the existing recent searches plist if there is
any with a clean one.
(WebCore::loadRecentSearches): Use -typeCheckedRecentSearchesArray and -typeCheckedDateInRecentSearch.
(WebCore::removeRecentlyModifiedRecentSearches):
When the time passed in is equivalent to [NSDate distantPast], clear all recent searches in
the Recent Searches plist. Otherwise, we only clear the recent searches that were created
after or at the time that is passed in as the parameter. If all recent searches associated
with an autosave name were created after or at the time that is passed in as the parameter,
remove this autosave name key and all of its values in the plist. If all recent searches
associated with every autosave name in the plist were created after or at the time that is
passed in as the parameter, clear all recent searches in the Recent Searches plist.

Also, we clear all recent searches in the Recent Searches plist when we find the plist is
corrupted.

Source/WebKit2:

* Shared/WebsiteData/WebsiteDataTypes.h: Add data type Search Field Recent Searches.
* UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
(dataTypesToString): Ditto.
* UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
(WebKit::toWebsiteDataTypes): Ditto.
(WebKit::toWKWebsiteDataTypes): Ditto.
* UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h: Ditto.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData): Handle the case when data type is Search
Field Recent Searches.
* UIProcess/WebsiteData/WebsiteDataStore.h: Add a private function for removing
recent searches based on time.
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStoreCocoa::platformRemoveRecentSearches): Call the removing
recent searches logic in WebCore.
* UIProcess/efl/WebPageProxyEfl.cpp:
(WebKit::WebsiteDataStore::platformRemoveRecentSearches): Not implemented.
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebsiteDataStore::platformRemoveRecentSearches): Not implemented.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaSearchPopupMenuCocoah">trunk/Source/WebCore/platform/cocoa/SearchPopupMenuCocoa.h</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaSearchPopupMenuCocoamm">trunk/Source/WebCore/platform/cocoa/SearchPopupMenuCocoa.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebsiteDataWebsiteDataTypesh">trunk/Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebsiteDataRecordmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecord.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebsiteDataRecordInternalh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebsiteDataRecordPrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebsiteDataCocoaWebsiteDataStoreCocoamm">trunk/Source/WebKit2/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebsiteDataWebsiteDataStorecpp">trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebsiteDataWebsiteDataStoreh">trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcesseflWebPageProxyEflcpp">trunk/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessgtkWebPageProxyGtkcpp">trunk/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (191627 => 191628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-27 18:27:17 UTC (rev 191627)
+++ trunk/Source/WebCore/ChangeLog        2015-10-27 18:49:58 UTC (rev 191628)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2015-10-27  Zhuo Li  &lt;zachli@apple.com&gt;
+
+        Add WebKit API to clear data type Search Field Recent Searches.
+        https://bugs.webkit.org/show_bug.cgi?id=150019.
+
+        Reviewed by Anders Carlsson.
+
+        * platform/cocoa/SearchPopupMenuCocoa.h: Add a function to remove recent searches based on
+        time.
+        * platform/cocoa/SearchPopupMenuCocoa.mm:
+        (WebCore::typeCheckedRecentSearchesArray): Return nil if the recent searches array is
+        corrupted, otherwise return the array.
+        (WebCore::typeCheckedDateInRecentSearch): Return nil if the date in recent search is
+        corrupted, otherwise return the date.
+        (WebCore::typeCheckedRecentSearchesRemovingRecentSearchesAddedAfterDate): Return nil if the recent searches plist is
+        corrupted, otherwise return the recent searches plist.
+        (WebCore::writeEmptyRecentSearchesPlist): Replace the existing recent searches plist if there is
+        any with a clean one.
+        (WebCore::loadRecentSearches): Use -typeCheckedRecentSearchesArray and -typeCheckedDateInRecentSearch.
+        (WebCore::removeRecentlyModifiedRecentSearches):
+        When the time passed in is equivalent to [NSDate distantPast], clear all recent searches in
+        the Recent Searches plist. Otherwise, we only clear the recent searches that were created
+        after or at the time that is passed in as the parameter. If all recent searches associated
+        with an autosave name were created after or at the time that is passed in as the parameter,
+        remove this autosave name key and all of its values in the plist. If all recent searches
+        associated with every autosave name in the plist were created after or at the time that is
+        passed in as the parameter, clear all recent searches in the Recent Searches plist.
+
+        Also, we clear all recent searches in the Recent Searches plist when we find the plist is
+        corrupted.
+
</ins><span class="cx"> 2015-10-27  Keith Rollin  &lt;krollin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Do not sanitize user input for input[type=url]
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaSearchPopupMenuCocoah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cocoa/SearchPopupMenuCocoa.h (191627 => 191628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/SearchPopupMenuCocoa.h        2015-10-27 18:27:17 UTC (rev 191627)
+++ trunk/Source/WebCore/platform/cocoa/SearchPopupMenuCocoa.h        2015-10-27 18:49:58 UTC (rev 191628)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> 
</span><span class="cx"> WEBCORE_EXPORT void saveRecentSearches(const String&amp; name, const Vector&lt;RecentSearch&gt;&amp;);
</span><span class="cx"> WEBCORE_EXPORT Vector&lt;RecentSearch&gt; loadRecentSearches(const String&amp; name);
</span><ins>+WEBCORE_EXPORT void removeRecentlyModifiedRecentSearches(std::chrono::system_clock::time_point);
</ins><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaSearchPopupMenuCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cocoa/SearchPopupMenuCocoa.mm (191627 => 191628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/SearchPopupMenuCocoa.mm        2015-10-27 18:27:17 UTC (rev 191627)
+++ trunk/Source/WebCore/platform/cocoa/SearchPopupMenuCocoa.mm        2015-10-27 18:49:58 UTC (rev 191628)
</span><span class="lines">@@ -66,6 +66,79 @@
</span><span class="cx">     return [NSDate dateWithTimeIntervalSince1970:duration_cast&lt;duration&lt;double&gt;&gt;(time.time_since_epoch()).count()];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static NSMutableArray *typeCheckedRecentSearchesArray(NSMutableDictionary *itemsDictionary, NSString *name)
+{
+    NSMutableDictionary *nameDictionary = [itemsDictionary objectForKey:name];
+    if (![nameDictionary isKindOfClass:[NSDictionary class]])
+        return nil;
+
+    NSMutableArray *recentSearches = [nameDictionary objectForKey:searchesKey];
+    if (![recentSearches isKindOfClass:[NSArray class]])
+        return nil;
+
+    return recentSearches;
+}
+
+static NSDate *typeCheckedDateInRecentSearch(NSDictionary *recentSearch)
+{
+    if (![recentSearch isKindOfClass:[NSDictionary class]])
+        return nil;
+
+    NSDate *date = [recentSearch objectForKey:dateKey];
+    if (![date isKindOfClass:[NSDate class]])
+        return nil;
+
+    return date;
+}
+
+static RetainPtr&lt;NSDictionary&gt; typeCheckedRecentSearchesRemovingRecentSearchesAddedAfterDate(NSDate *date)
+{
+    if ([date isEqualToDate:[NSDate distantPast]])
+        return nil;
+
+    RetainPtr&lt;NSMutableDictionary&gt; recentSearchesPlist = readSearchFieldRecentSearchesPlist();
+    NSMutableDictionary *itemsDictionary = [recentSearchesPlist objectForKey:itemsKey];
+    if (![itemsDictionary isKindOfClass:[NSDictionary class]])
+        return nil;
+
+    RetainPtr&lt;NSMutableArray&gt; keysToRemove = adoptNS([[NSMutableArray alloc] init]);
+    for (NSString *key in itemsDictionary) {
+        if (![key isKindOfClass:[NSString class]])
+            return nil;
+
+        NSMutableArray *recentSearches = typeCheckedRecentSearchesArray(itemsDictionary, key);
+        if (!recentSearches)
+            return nil;
+
+        RetainPtr&lt;NSMutableArray&gt; entriesToRemove = adoptNS([[NSMutableArray alloc] init]);
+        for (NSDictionary *recentSearch in recentSearches) {
+            NSDate *date = typeCheckedDateInRecentSearch(recentSearch);
+            if (!date)
+                return nil;
+
+            if ([date compare:date] == NSOrderedDescending)
+                [entriesToRemove addObject:recentSearch];
+        }
+
+        [recentSearches removeObjectsInArray:entriesToRemove.get()];
+        if (!recentSearches.count)
+            [keysToRemove addObject:key];
+    }
+
+    [itemsDictionary removeObjectsForKeys:keysToRemove.get()];
+    if (!itemsDictionary.count)
+        return nil;
+
+    return recentSearchesPlist;
+}
+
+static void writeEmptyRecentSearchesPlist()
+{
+    auto emptyItemsDictionary = adoptNS([[NSDictionary alloc] init]);
+    auto emptyRecentSearchesDictionary = adoptNS([[NSDictionary alloc] initWithObjectsAndKeys:emptyItemsDictionary.get(), itemsKey, nil]);
+    [emptyRecentSearchesDictionary writeToFile:searchFieldRecentSearchesPlistPath() atomically:YES];
+}
+
</ins><span class="cx"> void saveRecentSearches(const String&amp; name, const Vector&lt;RecentSearch&gt;&amp; searchItems)
</span><span class="cx"> {
</span><span class="cx">     if (name.isEmpty())
</span><span class="lines">@@ -90,7 +163,7 @@
</span><span class="cx">         [itemsDictionary setObject:adoptNS([[NSDictionary alloc] initWithObjectsAndKeys:items.get(), searchesKey, nil]).get() forKey:name];
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    [recentSearchesPlist writeToFile:searchFieldRecentSearchesPlistPath() atomically:NO];
</del><ins>+    [recentSearchesPlist writeToFile:searchFieldRecentSearchesPlistPath() atomically:YES];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Vector&lt;RecentSearch&gt; loadRecentSearches(const String&amp; name)
</span><span class="lines">@@ -104,34 +177,37 @@
</span><span class="cx">     if (!recentSearchesPlist)
</span><span class="cx">         return searchItems;
</span><span class="cx"> 
</span><del>-    NSDictionary *items = [recentSearchesPlist objectForKey:itemsKey];
</del><ins>+    NSMutableDictionary *items = [recentSearchesPlist objectForKey:itemsKey];
</ins><span class="cx">     if (![items isKindOfClass:[NSDictionary class]])
</span><span class="cx">         return searchItems;
</span><span class="cx"> 
</span><del>-    NSDictionary *nameItems = [items objectForKey:name];
-    if (![nameItems isKindOfClass:[NSDictionary class]])
</del><ins>+    NSArray *recentSearches = typeCheckedRecentSearchesArray(items, name);
+    if (!recentSearches)
</ins><span class="cx">         return searchItems;
</span><del>-
-    NSArray *recentSearches = [nameItems objectForKey:searchesKey];
-    if (![recentSearches isKindOfClass:[NSArray class]])
-        return searchItems;
</del><span class="cx">     
</span><span class="cx">     for (NSDictionary *item in recentSearches) {
</span><del>-        if (![item isKindOfClass:[NSDictionary class]])
</del><ins>+        NSDate *date = typeCheckedDateInRecentSearch(item);
+        if (!date)
</ins><span class="cx">             continue;
</span><del>-        
</del><ins>+
</ins><span class="cx">         NSString *searchString = [item objectForKey:searchStringKey];
</span><span class="cx">         if (![searchString isKindOfClass:[NSString class]])
</span><span class="cx">             continue;
</span><span class="cx">         
</span><del>-        NSDate *date = [item objectForKey:dateKey];
-        if (![date isKindOfClass:[NSDate class]])
-            continue;
-        
</del><span class="cx">         searchItems.append({ String{ searchString }, toSystemClockTime(date) });
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return searchItems;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void removeRecentlyModifiedRecentSearches(std::chrono::system_clock::time_point oldestTimeToRemove)
+{
+    NSDate *date = toNSDateFromSystemClock(oldestTimeToRemove);
+    auto recentSearchesPlist = typeCheckedRecentSearchesRemovingRecentSearchesAddedAfterDate(date);
+    if (recentSearchesPlist)
+        [recentSearchesPlist writeToFile:searchFieldRecentSearchesPlistPath() atomically:YES];
+    else
+        writeEmptyRecentSearchesPlist();
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (191627 => 191628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-10-27 18:27:17 UTC (rev 191627)
+++ trunk/Source/WebKit2/ChangeLog        2015-10-27 18:49:58 UTC (rev 191628)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2015-10-27  Zhuo Li  &lt;zachli@apple.com&gt;
+
+        Add WebKit API to clear data type Search Field Recent Searches.
+        https://bugs.webkit.org/show_bug.cgi?id=150019.
+
+        Reviewed by Anders Carlsson.
+
+        * Shared/WebsiteData/WebsiteDataTypes.h: Add data type Search Field Recent Searches.
+        * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
+        (dataTypesToString): Ditto.
+        * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
+        (WebKit::toWebsiteDataTypes): Ditto.
+        (WebKit::toWKWebsiteDataTypes): Ditto.
+        * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h: Ditto.
+        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+        (WebKit::WebsiteDataStore::removeData): Handle the case when data type is Search
+        Field Recent Searches.
+        * UIProcess/WebsiteData/WebsiteDataStore.h: Add a private function for removing
+        recent searches based on time.
+        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+        (WebKit::WebsiteDataStoreCocoa::platformRemoveRecentSearches): Call the removing
+        recent searches logic in WebCore.
+        * UIProcess/efl/WebPageProxyEfl.cpp:
+        (WebKit::WebsiteDataStore::platformRemoveRecentSearches): Not implemented.
+        * UIProcess/gtk/WebPageProxyGtk.cpp:
+        (WebKit::WebsiteDataStore::platformRemoveRecentSearches): Not implemented.
+
</ins><span class="cx"> 2015-10-26  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Make IDBKeyData from a struct to a class.
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebsiteDataWebsiteDataTypesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h (191627 => 191628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h        2015-10-27 18:27:17 UTC (rev 191627)
+++ trunk/Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h        2015-10-27 18:49:58 UTC (rev 191628)
</span><span class="lines">@@ -39,11 +39,12 @@
</span><span class="cx">     WebsiteDataTypeIndexedDBDatabases = 1 &lt;&lt; 7,
</span><span class="cx">     WebsiteDataTypeMediaKeys = 1 &lt;&lt; 8,
</span><span class="cx">     WebsiteDataTypeHSTSCache = 1 &lt;&lt; 9,
</span><ins>+    WebsiteDataTypeSearchFieldRecentSearches = 1 &lt;&lt; 10,
</ins><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><del>-    WebsiteDataTypePlugInData = 1 &lt;&lt; 10,
</del><ins>+    WebsiteDataTypePlugInData = 1 &lt;&lt; 11,
</ins><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><del>-    WebsiteDataTypeMediaDeviceIdentifier = 1 &lt;&lt; 11,
</del><ins>+    WebsiteDataTypeMediaDeviceIdentifier = 1 &lt;&lt; 12,
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebsiteDataRecordmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecord.mm (191627 => 191628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecord.mm        2015-10-27 18:27:17 UTC (rev 191627)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecord.mm        2015-10-27 18:49:58 UTC (rev 191628)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> 
</span><span class="cx"> NSString * const _WKWebsiteDataTypeMediaKeys = @&quot;_WKWebsiteDataTypeMediaKeys&quot;;
</span><span class="cx"> NSString * const _WKWebsiteDataTypeHSTSCache = @&quot;_WKWebsiteDataTypeHSTSCache&quot;;
</span><ins>+NSString * const _WKWebsiteDataTypeSearchFieldRecentSearches = @&quot;_WKWebsiteDataTypeSearchFieldRecentSearches&quot;;
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> NSString * const _WKWebsiteDataTypePlugInData = @&quot;_WKWebsiteDataTypePlugInData&quot;;
</span><span class="lines">@@ -79,6 +80,8 @@
</span><span class="cx">         [array addObject:@&quot;HSTS Cache&quot;];
</span><span class="cx">     if ([dataTypes containsObject:_WKWebsiteDataTypeMediaKeys])
</span><span class="cx">         [array addObject:@&quot;Media Keys&quot;];
</span><ins>+    if ([dataTypes containsObject:_WKWebsiteDataTypeSearchFieldRecentSearches])
+        [array addObject:@&quot;Search Field Recent Searches&quot;];
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     if ([dataTypes containsObject:_WKWebsiteDataTypePlugInData])
</span><span class="cx">         [array addObject:@&quot;Plug-in Data&quot;];
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebsiteDataRecordInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h (191627 => 191628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h        2015-10-27 18:27:17 UTC (rev 191627)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h        2015-10-27 18:49:58 UTC (rev 191628)
</span><span class="lines">@@ -64,6 +64,8 @@
</span><span class="cx">         websiteDataTypes |= WebsiteDataTypes::WebsiteDataTypeHSTSCache;
</span><span class="cx">     if ([wkWebsiteDataTypes containsObject:_WKWebsiteDataTypeMediaKeys])
</span><span class="cx">         websiteDataTypes |= WebsiteDataTypes::WebsiteDataTypeMediaKeys;
</span><ins>+    if ([wkWebsiteDataTypes containsObject:_WKWebsiteDataTypeSearchFieldRecentSearches])
+        websiteDataTypes |= WebsiteDataTypes::WebsiteDataTypeSearchFieldRecentSearches;
</ins><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx">     if ([wkWebsiteDataTypes containsObject:_WKWebsiteDataTypePlugInData])
</span><span class="cx">         websiteDataTypes |= WebsiteDataTypes::WebsiteDataTypePlugInData;
</span><span class="lines">@@ -97,6 +99,8 @@
</span><span class="cx">         [wkWebsiteDataTypes addObject:_WKWebsiteDataTypeHSTSCache];
</span><span class="cx">     if (websiteDataTypes &amp; WebsiteDataTypes::WebsiteDataTypeMediaKeys)
</span><span class="cx">         [wkWebsiteDataTypes addObject:_WKWebsiteDataTypeMediaKeys];
</span><ins>+    if (websiteDataTypes &amp; WebsiteDataTypes::WebsiteDataTypeSearchFieldRecentSearches)
+        [wkWebsiteDataTypes addObject:_WKWebsiteDataTypeSearchFieldRecentSearches];
</ins><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx">     if (websiteDataTypes &amp; WebsiteDataTypes::WebsiteDataTypePlugInData)
</span><span class="cx">         [wkWebsiteDataTypes addObject:_WKWebsiteDataTypePlugInData];
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebsiteDataRecordPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h (191627 => 191628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h        2015-10-27 18:27:17 UTC (rev 191627)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h        2015-10-27 18:49:58 UTC (rev 191628)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> 
</span><span class="cx"> WK_EXTERN NSString * const _WKWebsiteDataTypeHSTSCache WK_AVAILABLE(10_11, 9_0);
</span><span class="cx"> WK_EXTERN NSString * const _WKWebsiteDataTypeMediaKeys WK_AVAILABLE(10_11, 9_0);
</span><ins>+WK_EXTERN NSString * const _WKWebsiteDataTypeSearchFieldRecentSearches WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
</ins><span class="cx"> 
</span><span class="cx"> #if !TARGET_OS_IPHONE
</span><span class="cx"> WK_EXTERN NSString * const _WKWebsiteDataTypePlugInData WK_AVAILABLE(10_11, NA);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebsiteDataCocoaWebsiteDataStoreCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm (191627 => 191628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm        2015-10-27 18:27:17 UTC (rev 191627)
+++ trunk/Source/WebKit2/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm        2015-10-27 18:49:58 UTC (rev 191628)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #import &quot;WebsiteDataStore.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #import &quot;StorageManager.h&quot;
</span><ins>+#import &lt;WebCore/SearchPopupMenuCocoa.h&gt;
</ins><span class="cx"> #import &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="lines">@@ -84,4 +85,9 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebsiteDataStore::platformRemoveRecentSearches(std::chrono::system_clock::time_point oldestTimeToRemove)
+{
+    WebCore::removeRecentlyModifiedRecentSearches(oldestTimeToRemove);
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebsiteDataWebsiteDataStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp (191627 => 191628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp        2015-10-27 18:27:17 UTC (rev 191627)
+++ trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp        2015-10-27 18:49:58 UTC (rev 191628)
</span><span class="lines">@@ -632,6 +632,18 @@
</span><span class="cx">         });
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (dataTypes &amp; WebsiteDataTypeSearchFieldRecentSearches &amp;&amp; isPersistent()) {
+        callbackAggregator-&gt;addPendingCallback();
+
+        m_queue-&gt;dispatch([modifiedSince, callbackAggregator] {
+            platformRemoveRecentSearches(modifiedSince);
+
+            RunLoop::main().dispatch([callbackAggregator] {
+                callbackAggregator-&gt;removePendingCallback();
+            });
+        });
+    }
+
</ins><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx">     if (dataTypes &amp; WebsiteDataTypePlugInData &amp;&amp; isPersistent()) {
</span><span class="cx">         class State {
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebsiteDataWebsiteDataStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h (191627 => 191628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h        2015-10-27 18:27:17 UTC (rev 191627)
+++ trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h        2015-10-27 18:49:58 UTC (rev 191628)
</span><span class="lines">@@ -93,6 +93,7 @@
</span><span class="cx"> 
</span><span class="cx">     void platformInitialize();
</span><span class="cx">     void platformDestroy();
</span><ins>+    static void platformRemoveRecentSearches(std::chrono::system_clock::time_point);
</ins><span class="cx"> 
</span><span class="cx">     HashSet&lt;RefPtr&lt;WebProcessPool&gt;&gt; processPools() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcesseflWebPageProxyEflcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp (191627 => 191628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp        2015-10-27 18:27:17 UTC (rev 191627)
+++ trunk/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp        2015-10-27 18:49:58 UTC (rev 191628)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;WebPageMessages.h&quot;
</span><span class="cx"> #include &quot;WebProcessProxy.h&quot;
</span><span class="cx"> #include &quot;WebView.h&quot;
</span><ins>+#include &quot;WebsiteDataStore.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #include &lt;sys/utsname.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -83,6 +84,11 @@
</span><span class="cx">     notImplemented();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebsiteDataStore::platformRemoveRecentSearches(std::chrono::system_clock::time_point oldestTimeToRemove)
+{
+    notImplemented();
+}
+
</ins><span class="cx"> void WebPageProxy::editorStateChanged(const EditorState&amp; editorState)
</span><span class="cx"> {
</span><span class="cx">     m_editorState = editorState;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessgtkWebPageProxyGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp (191627 => 191628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp        2015-10-27 18:27:17 UTC (rev 191627)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp        2015-10-27 18:49:58 UTC (rev 191628)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &quot;WebKitWebViewBasePrivate.h&quot;
</span><span class="cx"> #include &quot;WebPageMessages.h&quot;
</span><span class="cx"> #include &quot;WebProcessProxy.h&quot;
</span><ins>+#include &quot;WebsiteDataStore.h&quot;
</ins><span class="cx"> #include &lt;WebCore/UserAgentGtk.h&gt;
</span><span class="cx"> #include &lt;gtk/gtkx.h&gt;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="lines">@@ -67,6 +68,11 @@
</span><span class="cx">     notImplemented();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebsiteDataStore::platformRemoveRecentSearches(std::chrono::system_clock::time_point oldestTimeToRemove)
+{
+    notImplemented();
+}
+
</ins><span class="cx"> void WebPageProxy::editorStateChanged(const EditorState&amp; editorState)
</span><span class="cx"> {
</span><span class="cx">     m_editorState = editorState;
</span></span></pre>
</div>
</div>

</body>
</html>