Title: [193960] branches/safari-601-branch/Source
Revision
193960
Author
[email protected]
Date
2015-12-11 10:26:12 -0800 (Fri, 11 Dec 2015)

Log Message

Merge r191084. rdar://problem/23715623

Modified Paths

Added Paths

Diff

Modified: branches/safari-601-branch/Source/WebCore/ChangeLog (193959 => 193960)


--- branches/safari-601-branch/Source/WebCore/ChangeLog	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebCore/ChangeLog	2015-12-11 18:26:12 UTC (rev 193960)
@@ -1,3 +1,53 @@
+2015-12-11  Matthew Hanson  <[email protected]>
+
+        Merge r191084. rdar://problem/23715623
+
+    2015-10-14  Zhuo Li  <[email protected]>
+
+            Augment <input type=search>’s recent search history with the time each entry was added,
+            in order to allow time-based clearing of search history.
+            https://bugs.webkit.org/show_bug.cgi?id=148388.
+
+            Reviewed by Darin Adler.
+
+            Replace Vector<String> with Vector<RecentSearch>, where RecentSearch is a struct
+            that consists search string and time, for recent searches in order to store additional time
+            information.
+
+            * WebCore.xcodeproj/project.pbxproj: Added SearchPopupMenuCocoa.h and SearchPopupMenuCocoa.mm
+            and sort the project file.
+            * loader/EmptyClients.cpp:
+            (WebCore::EmptySearchPopupMenu::saveRecentSearches):
+            (WebCore::EmptySearchPopupMenu::loadRecentSearches):
+            * platform/SearchPopupMenu.h:
+            * platform/cocoa/SearchPopupMenuCocoa.h: Added methods for SeachPopupMenuMac in WebKit
+            and WebPageProxyCocoa in WebKit2 to call.
+            * platform/cocoa/SearchPopupMenuCocoa.mm: Added.
+            (WebCore::searchFieldRecentSearchesStorageDirectory): Recent searches with the new structure
+            are stored in a new location.
+            (WebCore::searchFieldRecentSearchesPlistPath): Get the path for the plist of the recent
+            searches entries.
+            (WebCore::RetainPtr<NSMutableDictionary> readSearchFieldRecentSearchesPlist): Return the
+            recent searches plist as NSMutableDictionary.
+            (WebCore::fromNSDatetoSystemClockTime): Convert from NSDate to system_clock::time_point.
+            (WebCore::fromSystemClockTimetoNSDate): Convert from system_clock::time_point to NSDate.
+            (WebCore::SearchPopupMenuCocoa::saveRecentSearches): Add a dictionary where it has two pairs
+            that the first one is the search string and the second one is the time.
+            (WebCore::SearchPopupMenuCocoa::loadRecentSearches): We expect the recent search item in the
+            plist to be a two-pair dictionary, and convert the dictionary to the struct RecentSearch.
+            * platform/win/SearchPopupMenuWin.cpp:
+            (WebCore::SearchPopupMenuWin::saveRecentSearches): Only save the RecentSearch's search
+            string on Windows platform, which is what we used to do.
+            (WebCore::SearchPopupMenuWin::loadRecentSearches): Since we need to construct a
+            RecentSearch, we get the string from the app's preferences, and set the time to be
+            std::chrono::system_clock::time_point::min().
+            * platform/win/SearchPopupMenuWin.h:
+            * rendering/RenderSearchField.cpp: Now that m_recentSearches are Vector<RecentSearch>,
+            we cannot use -removeAll with a search string. Use -removeAllMatching instead to remove the
+            item that has its member search string equal to the search string user inputs.
+            (WebCore::RenderSearchField::addSearchResult):
+            (WebCore::RenderSearchField::itemText):
+
 2015-12-09  Babak Shafiei  <[email protected]>
 
         Merge r190505.

Modified: branches/safari-601-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj (193959 => 193960)


--- branches/safari-601-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2015-12-11 18:26:12 UTC (rev 193960)
@@ -462,6 +462,8 @@
 		0C3F1F5B10C8871200D72CE1 /* WebGLUniformLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C3F1F5810C8871200D72CE1 /* WebGLUniformLocation.h */; };
 		0C45342710CDBBFA00869157 /* JSWebGLUniformLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0C45342510CDBBFA00869157 /* JSWebGLUniformLocation.cpp */; };
 		0C45342810CDBBFA00869157 /* JSWebGLUniformLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C45342610CDBBFA00869157 /* JSWebGLUniformLocation.h */; };
+		0E7058EE1BC5BC190045A507 /* SearchPopupMenuCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0E7058ED1BC5BC190045A507 /* SearchPopupMenuCocoa.mm */; };
+		0E7058F41BC5CEDA0045A507 /* SearchPopupMenuCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E7058F31BC5CCD70045A507 /* SearchPopupMenuCocoa.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		0F03C0741884695E00A5F8CA /* SystemMemory.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F03C0731884695E00A5F8CA /* SystemMemory.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		0F03C0751884805500A5F8CA /* InspectorOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C522D4A15B478B2009B7C95 /* InspectorOverlay.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		0F09087F1444FDB200028917 /* ScrollbarTheme.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE71415142189FC00DB33BA /* ScrollbarTheme.cpp */; };
@@ -7591,6 +7593,8 @@
 		0C3F1F5910C8871200D72CE1 /* WebGLUniformLocation.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebGLUniformLocation.idl; sourceTree = "<group>"; };
 		0C45342510CDBBFA00869157 /* JSWebGLUniformLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLUniformLocation.cpp; sourceTree = "<group>"; };
 		0C45342610CDBBFA00869157 /* JSWebGLUniformLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLUniformLocation.h; sourceTree = "<group>"; };
+		0E7058ED1BC5BC190045A507 /* SearchPopupMenuCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SearchPopupMenuCocoa.mm; sourceTree = "<group>"; };
+		0E7058F31BC5CCD70045A507 /* SearchPopupMenuCocoa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SearchPopupMenuCocoa.h; sourceTree = "<group>"; };
 		0F03C0731884695E00A5F8CA /* SystemMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SystemMemory.h; sourceTree = "<group>"; };
 		0F099D0617B968A100FF84B9 /* WebCoreTypedArrayController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreTypedArrayController.cpp; sourceTree = "<group>"; };
 		0F099D0717B968A100FF84B9 /* WebCoreTypedArrayController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreTypedArrayController.h; sourceTree = "<group>"; };
@@ -19100,6 +19104,8 @@
 				1AA84F02143BA7BD0051D153 /* ScrollController.mm */,
 				F478755219983AFF0024A287 /* ScrollSnapAnimatorState.h */,
 				F478755319983AFF0024A287 /* ScrollSnapAnimatorState.mm */,
+				0E7058F31BC5CCD70045A507 /* SearchPopupMenuCocoa.h */,
+				0E7058ED1BC5BC190045A507 /* SearchPopupMenuCocoa.mm */,
 				5D5975B119635F1100D00878 /* SystemVersion.h */,
 				5D5975B219635F1100D00878 /* SystemVersion.mm */,
 				7CC564B918BAC720001B9652 /* TelephoneNumberDetectorCocoa.cpp */,
@@ -26640,6 +26646,7 @@
 				BC6D6E2609AF943500F59759 /* ScrollView.h in Headers */,
 				F55B3DD21251F12D003EF269 /* SearchInputType.h in Headers */,
 				AB7170890B3118080017123E /* SearchPopupMenu.h in Headers */,
+				0E7058F41BC5CEDA0045A507 /* SearchPopupMenuCocoa.h in Headers */,
 				976F36EB14686225005E93B4 /* SecurityContext.h in Headers */,
 				BCD0E0FB0E972C3500265DEA /* SecurityOrigin.h in Headers */,
 				BCD0E0FC0E972C3500265DEA /* SecurityOriginHash.h in Headers */,
@@ -30123,6 +30130,7 @@
 				E45390450EAFD637003695C8 /* ScrollViewIOS.mm in Sources */,
 				9353676B09AED88B00D35CD6 /* ScrollViewMac.mm in Sources */,
 				F55B3DD11251F12D003EF269 /* SearchInputType.cpp in Sources */,
+				0E7058EE1BC5BC190045A507 /* SearchPopupMenuCocoa.mm in Sources */,
 				976F36EA14686225005E93B4 /* SecurityContext.cpp in Sources */,
 				BCD0E0FA0E972C3500265DEA /* SecurityOrigin.cpp in Sources */,
 				1AF7AFC71A48A8BC00C8E4E7 /* SecurityOriginPolicy.cpp in Sources */,

Modified: branches/safari-601-branch/Source/WebCore/loader/EmptyClients.cpp (193959 => 193960)


--- branches/safari-601-branch/Source/WebCore/loader/EmptyClients.cpp	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebCore/loader/EmptyClients.cpp	2015-12-11 18:26:12 UTC (rev 193960)
@@ -138,8 +138,8 @@
 class EmptySearchPopupMenu : public SearchPopupMenu {
 public:
     virtual PopupMenu* popupMenu() { return m_popup.get(); }
-    virtual void saveRecentSearches(const AtomicString&, const Vector<String>&) { }
-    virtual void loadRecentSearches(const AtomicString&, Vector<String>&) { }
+    virtual void saveRecentSearches(const AtomicString&, const Vector<RecentSearch>&) { }
+    virtual void loadRecentSearches(const AtomicString&, Vector<RecentSearch>&) { }
     virtual bool enabled() { return false; }
 
 private:

Modified: branches/safari-601-branch/Source/WebCore/platform/SearchPopupMenu.h (193959 => 193960)


--- branches/safari-601-branch/Source/WebCore/platform/SearchPopupMenu.h	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebCore/platform/SearchPopupMenu.h	2015-12-11 18:26:12 UTC (rev 193960)
@@ -21,19 +21,26 @@
 #ifndef SearchPopupMenu_h
 #define SearchPopupMenu_h
 
-#include "PopupMenu.h"
+#include <chrono>
 #include <wtf/Forward.h>
 #include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
 
+class PopupMenu;
+
+struct RecentSearch {
+    String string;
+    std::chrono::system_clock::time_point time;
+};
+
 class SearchPopupMenu : public RefCounted<SearchPopupMenu> {
 public:
-    virtual ~SearchPopupMenu() {}
+    virtual ~SearchPopupMenu() { }
     virtual PopupMenu* popupMenu() = 0;
-    virtual void saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems) = 0;
-    virtual void loadRecentSearches(const AtomicString& name, Vector<String>& searchItems) = 0;
+    virtual void saveRecentSearches(const AtomicString& name, const Vector<RecentSearch>&) = 0;
+    virtual void loadRecentSearches(const AtomicString& name, Vector<RecentSearch>&) = 0;
     virtual bool enabled() = 0;
 };
 

Added: branches/safari-601-branch/Source/WebCore/platform/cocoa/SearchPopupMenuCocoa.h (0 => 193960)


--- branches/safari-601-branch/Source/WebCore/platform/cocoa/SearchPopupMenuCocoa.h	                        (rev 0)
+++ branches/safari-601-branch/Source/WebCore/platform/cocoa/SearchPopupMenuCocoa.h	2015-12-11 18:26:12 UTC (rev 193960)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+#ifndef SearchPopupMenuCocoa_h
+#define SearchPopupMenuCocoa_h
+
+#import "SearchPopupMenu.h"
+
+namespace WebCore {
+
+WEBCORE_EXPORT void saveRecentSearches(const String& name, const Vector<RecentSearch>&);
+WEBCORE_EXPORT Vector<RecentSearch> loadRecentSearches(const String& name);
+
+}
+
+#endif // SearchPopupMenuCocoa_h

Added: branches/safari-601-branch/Source/WebCore/platform/cocoa/SearchPopupMenuCocoa.mm (0 => 193960)


--- branches/safari-601-branch/Source/WebCore/platform/cocoa/SearchPopupMenuCocoa.mm	                        (rev 0)
+++ branches/safari-601-branch/Source/WebCore/platform/cocoa/SearchPopupMenuCocoa.mm	2015-12-11 18:26:12 UTC (rev 193960)
@@ -0,0 +1,137 @@
+/*
+ * Copyright (C) 2015 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 "config.h"
+#import "SearchPopupMenuCocoa.h"
+
+using namespace std::chrono;
+
+namespace WebCore {
+
+static NSString * const dateKey = @"date";
+static NSString * const itemsKey = @"items";
+static NSString * const searchesKey = @"searches";
+static NSString * const searchStringKey = @"searchString";
+
+static NSString *searchFieldRecentSearchesStorageDirectory()
+{
+    NSString *appName = [[NSBundle mainBundle] bundleIdentifier];
+    if (!appName)
+        appName = [[NSProcessInfo processInfo] processName];
+    
+    return [[NSHomeDirectory() stringByAppendingPathComponent:@"Library/WebKit"] stringByAppendingPathComponent:appName];
+}
+
+static NSString *searchFieldRecentSearchesPlistPath()
+{
+    return [searchFieldRecentSearchesStorageDirectory() stringByAppendingPathComponent:@"RecentSearches.plist"];
+}
+
+static RetainPtr<NSMutableDictionary> readSearchFieldRecentSearchesPlist()
+{
+    return adoptNS([[NSMutableDictionary alloc] initWithContentsOfFile:searchFieldRecentSearchesPlistPath()]);
+}
+
+static system_clock::time_point toSystemClockTime(NSDate *date)
+{
+    ASSERT(date);
+
+    return system_clock::time_point(duration_cast<system_clock::duration>(duration<double>(date.timeIntervalSince1970)));
+}
+
+static NSDate *toNSDateFromSystemClock(system_clock::time_point time)
+{
+    return [NSDate dateWithTimeIntervalSince1970:duration_cast<duration<double>>(time.time_since_epoch()).count()];
+}
+
+void saveRecentSearches(const String& name, const Vector<RecentSearch>& searchItems)
+{
+    if (name.isEmpty())
+        return;
+
+    RetainPtr<NSDictionary> recentSearchesPlist = readSearchFieldRecentSearchesPlist();
+    RetainPtr<NSMutableDictionary> itemsDictionary = [recentSearchesPlist objectForKey:itemsKey];
+    // The NSMutableDictionary method we use to read the property list guarantees we get only
+    // mutable containers, but it does not guarantee the file has a dictionary as expected.
+    if (![itemsDictionary isKindOfClass:[NSDictionary class]]) {
+        itemsDictionary = adoptNS([[NSMutableDictionary alloc] init]);
+        recentSearchesPlist = adoptNS([[NSDictionary alloc] initWithObjectsAndKeys:itemsDictionary.get(), itemsKey, nil]);
+    }
+
+    if (searchItems.isEmpty())
+        [itemsDictionary removeObjectForKey:name];
+    else {
+        RetainPtr<NSMutableArray> items = adoptNS([[NSMutableArray alloc] initWithCapacity:searchItems.size()]);
+        for (auto& searchItem : searchItems)
+            [items addObject:adoptNS([[NSDictionary alloc] initWithObjectsAndKeys:searchItem.string, searchStringKey, toNSDateFromSystemClock(searchItem.time), dateKey, nil]).get()];
+
+        [itemsDictionary setObject:adoptNS([[NSDictionary alloc] initWithObjectsAndKeys:items.get(), searchesKey, nil]).get() forKey:name];
+    }
+
+    [recentSearchesPlist writeToFile:searchFieldRecentSearchesPlistPath() atomically:NO];
+}
+
+Vector<RecentSearch> loadRecentSearches(const String& name)
+{
+    Vector<RecentSearch> searchItems;
+
+    if (name.isEmpty())
+        return searchItems;
+
+    RetainPtr<NSMutableDictionary> recentSearchesPlist = readSearchFieldRecentSearchesPlist();
+    if (!recentSearchesPlist)
+        return searchItems;
+
+    NSDictionary *items = [recentSearchesPlist objectForKey:itemsKey];
+    if (![items isKindOfClass:[NSDictionary class]])
+        return searchItems;
+
+    NSDictionary *nameItems = [items objectForKey:name];
+    if (![nameItems isKindOfClass:[NSDictionary class]])
+        return searchItems;
+
+    NSArray *recentSearches = [nameItems objectForKey:searchesKey];
+    if (![recentSearches isKindOfClass:[NSArray class]])
+        return searchItems;
+    
+    for (NSDictionary *item in recentSearches) {
+        if (![item isKindOfClass:[NSDictionary class]])
+            continue;
+        
+        NSString *searchString = [item objectForKey:searchStringKey];
+        if (![searchString isKindOfClass:[NSString class]])
+            continue;
+        
+        NSDate *date = [item objectForKey:dateKey];
+        if (![date isKindOfClass:[NSDate class]])
+            continue;
+        
+        searchItems.append({ String{ searchString }, toSystemClockTime(date) });
+    }
+
+    return searchItems;
+}
+
+}

Modified: branches/safari-601-branch/Source/WebCore/platform/win/SearchPopupMenuWin.cpp (193959 => 193960)


--- branches/safari-601-branch/Source/WebCore/platform/win/SearchPopupMenuWin.cpp	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebCore/platform/win/SearchPopupMenuWin.cpp	2015-12-11 18:26:12 UTC (rev 193960)
@@ -55,7 +55,7 @@
 }
 #endif
 
-void SearchPopupMenuWin::saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems)
+void SearchPopupMenuWin::saveRecentSearches(const AtomicString& name, const Vector<RecentSearch>& searchItems)
 {
     if (name.isEmpty())
         return;
@@ -67,7 +67,7 @@
     if (size) {
         items = adoptCF(CFArrayCreateMutable(0, size, &kCFTypeArrayCallBacks));
         for (size_t i = 0; i < size; ++i)
-            CFArrayAppendValue(items.get(), searchItems[i].createCFString().get());
+            CFArrayAppendValue(items.get(), searchItems[i].string.createCFString().get());
     }
 
     CFPreferencesSetAppValue(autosaveKey(name).get(), items.get(), kCFPreferencesCurrentApplication);
@@ -75,7 +75,7 @@
 #endif
 }
 
-void SearchPopupMenuWin::loadRecentSearches(const AtomicString& name, Vector<String>& searchItems)
+void SearchPopupMenuWin::loadRecentSearches(const AtomicString& name, Vector<RecentSearch>& searchItems)
 {
     if (name.isEmpty())
         return;
@@ -90,8 +90,10 @@
     size_t size = CFArrayGetCount(items.get());
     for (size_t i = 0; i < size; ++i) {
         CFStringRef item = (CFStringRef)CFArrayGetValueAtIndex(items.get(), i);
-        if (CFGetTypeID(item) == CFStringGetTypeID())
-            searchItems.append(item);
+        if (CFGetTypeID(item) == CFStringGetTypeID()) {
+            // We are choosing not to use or store search times on Windows at this time, so for now it's OK to use a "distant past" time as a placeholder.
+            searchItems.append({ String{ item }, std::chrono::system_clock::time_point::min() });
+        }
     }
 #endif
 }

Modified: branches/safari-601-branch/Source/WebCore/platform/win/SearchPopupMenuWin.h (193959 => 193960)


--- branches/safari-601-branch/Source/WebCore/platform/win/SearchPopupMenuWin.h	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebCore/platform/win/SearchPopupMenuWin.h	2015-12-11 18:26:12 UTC (rev 193960)
@@ -31,8 +31,8 @@
     SearchPopupMenuWin(PopupMenuClient*);
 
     virtual PopupMenu* popupMenu();
-    virtual void saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems);
-    virtual void loadRecentSearches(const AtomicString& name, Vector<String>& searchItems);
+    virtual void saveRecentSearches(const AtomicString& name, const Vector<RecentSearch>&);
+    virtual void loadRecentSearches(const AtomicString& name, Vector<RecentSearch>&);
     virtual bool enabled();
 
 private:

Modified: branches/safari-601-branch/Source/WebCore/rendering/RenderSearchField.cpp (193959 => 193960)


--- branches/safari-601-branch/Source/WebCore/rendering/RenderSearchField.cpp	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebCore/rendering/RenderSearchField.cpp	2015-12-11 18:26:12 UTC (rev 193960)
@@ -37,11 +37,11 @@
 #include "LocalizedStrings.h"
 #include "Page.h"
 #include "PlatformKeyboardEvent.h"
+#include "PopupMenu.h"
 #include "RenderLayer.h"
 #include "RenderScrollbar.h"
 #include "RenderTheme.h"
 #include "RenderView.h"
-#include "SearchPopupMenu.h"
 #include "Settings.h"
 #include "StyleResolver.h"
 #include "TextControlInnerElements.h"
@@ -88,8 +88,12 @@
     if (frame().page()->usesEphemeralSession())
         return;
 
-    m_recentSearches.removeAll(value);
-    m_recentSearches.insert(0, value);
+    m_recentSearches.removeAllMatching([value] (const RecentSearch& recentSearch) {
+        return recentSearch.string == value;
+    });
+
+    RecentSearch recentSearch = { value, std::chrono::system_clock::now() };
+    m_recentSearches.insert(0, recentSearch);
     while (static_cast<int>(m_recentSearches.size()) > inputElement().maxResults())
         m_recentSearches.removeLast();
 
@@ -228,7 +232,7 @@
     if (static_cast<int>(listIndex) == (size - 1))
         return searchMenuClearRecentSearchesText();
 #endif
-    return m_recentSearches[listIndex - 1];
+    return m_recentSearches[listIndex - 1].string;
 }
 
 String RenderSearchField::itemLabel(unsigned) const

Modified: branches/safari-601-branch/Source/WebCore/rendering/RenderSearchField.h (193959 => 193960)


--- branches/safari-601-branch/Source/WebCore/rendering/RenderSearchField.h	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebCore/rendering/RenderSearchField.h	2015-12-11 18:26:12 UTC (rev 193960)
@@ -25,11 +25,11 @@
 
 #include "PopupMenuClient.h"
 #include "RenderTextControlSingleLine.h"
+#include "SearchPopupMenu.h"
 
 namespace WebCore {
 
 class HTMLInputElement;
-class SearchPopupMenu;
 
 class RenderSearchField final : public RenderTextControlSingleLine, private PopupMenuClient {
 public:
@@ -87,7 +87,7 @@
 
     bool m_searchPopupIsVisible;
     RefPtr<SearchPopupMenu> m_searchPopup;
-    Vector<String> m_recentSearches;
+    Vector<RecentSearch> m_recentSearches;
 };
 
 } // namespace WebCore

Modified: branches/safari-601-branch/Source/WebKit/ios/ChangeLog (193959 => 193960)


--- branches/safari-601-branch/Source/WebKit/ios/ChangeLog	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebKit/ios/ChangeLog	2015-12-11 18:26:12 UTC (rev 193960)
@@ -1,3 +1,23 @@
+2015-12-11  Matthew Hanson  <[email protected]>
+
+        Merge r191084. rdar://problem/23715623
+
+    2015-10-14  Zhuo Li  <[email protected]>
+
+            Augment <input type=search>’s recent search history with the time each entry was added,
+            in order to allow time-based clearing of search history.
+            https://bugs.webkit.org/show_bug.cgi?id=148388.
+
+            Reviewed by Darin Adler.
+
+            Replace Vector<String> with Vector<RecentSearch>, where RecentSearch is a struct
+            that consists search string and time, for recent searches in order to store additional time information.
+
+            * WebCoreSupport/SearchPopupMenuIOS.cpp:
+            (SearchPopupMenuIOS::saveRecentSearches):
+            (SearchPopupMenuIOS::loadRecentSearches):
+            * WebCoreSupport/SearchPopupMenuIOS.h:
+
 2015-07-23  Lucas Forschler  <[email protected]>
 
         Merge r187113

Modified: branches/safari-601-branch/Source/WebKit/ios/WebCoreSupport/SearchPopupMenuIOS.cpp (193959 => 193960)


--- branches/safari-601-branch/Source/WebKit/ios/WebCoreSupport/SearchPopupMenuIOS.cpp	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebKit/ios/WebCoreSupport/SearchPopupMenuIOS.cpp	2015-12-11 18:26:12 UTC (rev 193960)
@@ -35,11 +35,11 @@
     return m_popup.get();
 }
 
-void SearchPopupMenuIOS::saveRecentSearches(const AtomicString&, const Vector<String>& /*searchItems*/)
+void SearchPopupMenuIOS::saveRecentSearches(const AtomicString&, const Vector<RecentSearch>& /*searchItems*/)
 {
 }
 
-void SearchPopupMenuIOS::loadRecentSearches(const AtomicString&, Vector<String>& /*searchItems*/)
+void SearchPopupMenuIOS::loadRecentSearches(const AtomicString&, Vector<RecentSearch>& /*searchItems*/)
 {
 }
 

Modified: branches/safari-601-branch/Source/WebKit/ios/WebCoreSupport/SearchPopupMenuIOS.h (193959 => 193960)


--- branches/safari-601-branch/Source/WebKit/ios/WebCoreSupport/SearchPopupMenuIOS.h	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebKit/ios/WebCoreSupport/SearchPopupMenuIOS.h	2015-12-11 18:26:12 UTC (rev 193960)
@@ -33,8 +33,8 @@
     SearchPopupMenuIOS(WebCore::PopupMenuClient*);
 
     virtual WebCore::PopupMenu* popupMenu() override;
-    virtual void saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems) override;
-    virtual void loadRecentSearches(const AtomicString& name, Vector<String>& searchItems) override;
+    virtual void saveRecentSearches(const AtomicString& name, const Vector<WebCore::RecentSearch>&) override;
+    virtual void loadRecentSearches(const AtomicString& name, Vector<WebCore::RecentSearch>&) override;
     virtual bool enabled() override;
 
 private:

Modified: branches/safari-601-branch/Source/WebKit/mac/ChangeLog (193959 => 193960)


--- branches/safari-601-branch/Source/WebKit/mac/ChangeLog	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebKit/mac/ChangeLog	2015-12-11 18:26:12 UTC (rev 193960)
@@ -1,3 +1,36 @@
+2015-12-11  Matthew Hanson  <[email protected]>
+
+        Merge r191084. rdar://problem/23715623
+
+    2015-10-14  Zhuo Li  <[email protected]>
+
+            Augment <input type=search>’s recent search history with the time each entry was added,
+            in order to allow time-based clearing of search history.
+            https://bugs.webkit.org/show_bug.cgi?id=148388.
+
+            Reviewed by Darin Adler.
+
+            Replace Vector<String> with Vector<RecentSearch>, where RecentSearch is a struct
+            that consists search string and time, for recent searches in order to store additional time information.
+
+            All these new RecentSearches are stored in a plist in which the structure looks like:
+            Root {
+                "items": {
+                    autosave name: {
+                        "searches": [
+                            { "searchString": searchString, "date": date },
+                            ...
+                        ]
+                    }
+                }
+            }
+
+            * WebCoreSupport/SearchPopupMenuMac.h:
+            * WebCoreSupport/SearchPopupMenuMac.mm:
+            (SearchPopupMenuMac::saveRecentSearches): Call saveRecentSearches in WebCore::SearchPopupMenuCocoa.
+            (SearchPopupMenuMac::loadRecentSearches): Call loadRecentSearches in WebCore::SearchPopupMenuCocoa.
+            (autosaveKey): Deleted.
+
 2015-10-17  Myles C. Maxfield  <[email protected]>
 
         Build fix after r191260

Modified: branches/safari-601-branch/Source/WebKit/mac/WebCoreSupport/SearchPopupMenuMac.h (193959 => 193960)


--- branches/safari-601-branch/Source/WebKit/mac/WebCoreSupport/SearchPopupMenuMac.h	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebKit/mac/WebCoreSupport/SearchPopupMenuMac.h	2015-12-11 18:26:12 UTC (rev 193960)
@@ -21,7 +21,7 @@
 #ifndef SearchPopupMenuMac_h
 #define SearchPopupMenuMac_h
 
-#include <WebCore/SearchPopupMenu.h>
+#include <WebCore/SearchPopupMenuCocoa.h>
 
 namespace WebCore {
 class PopupMenuClient;
@@ -35,8 +35,8 @@
     ~SearchPopupMenuMac();
 
     virtual WebCore::PopupMenu* popupMenu() override;
-    virtual void saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems) override;
-    virtual void loadRecentSearches(const AtomicString& name, Vector<String>& searchItems) override;
+    virtual void saveRecentSearches(const AtomicString& name, const Vector<WebCore::RecentSearch>&) override;
+    virtual void loadRecentSearches(const AtomicString& name, Vector<WebCore::RecentSearch>&) override;
     virtual bool enabled() override;
 
 private:

Modified: branches/safari-601-branch/Source/WebKit/mac/WebCoreSupport/SearchPopupMenuMac.mm (193959 => 193960)


--- branches/safari-601-branch/Source/WebKit/mac/WebCoreSupport/SearchPopupMenuMac.mm	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebKit/mac/WebCoreSupport/SearchPopupMenuMac.mm	2015-12-11 18:26:12 UTC (rev 193960)
@@ -23,9 +23,7 @@
 #include "PopupMenuMac.h"
 #include <wtf/text/AtomicString.h>
 
-using namespace WebCore;
-
-SearchPopupMenuMac::SearchPopupMenuMac(PopupMenuClient* client)
+SearchPopupMenuMac::SearchPopupMenuMac(WebCore::PopupMenuClient* client)
     : m_popup(adoptRef(new PopupMenuMac(client)))
 {
 }
@@ -34,13 +32,8 @@
 {
 }
 
-static NSString *autosaveKey(const String& name)
+WebCore::PopupMenu* SearchPopupMenuMac::popupMenu()
 {
-    return [@"com.apple.WebKit.searchField:" stringByAppendingString:name];
-}
-
-PopupMenu* SearchPopupMenuMac::popupMenu()
-{
     return m_popup.get();
 }
 
@@ -49,31 +42,12 @@
     return true;
 }
 
-void SearchPopupMenuMac::saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems)
+void SearchPopupMenuMac::saveRecentSearches(const AtomicString& name, const Vector<WebCore::RecentSearch>& searchItems)
 {
-    if (name.isEmpty())
-        return;
-
-    if (searchItems.isEmpty()) {
-        [[NSUserDefaults standardUserDefaults] removeObjectForKey:autosaveKey(name)];
-        return;
-    }
-
-    RetainPtr<NSMutableArray> items = adoptNS([[NSMutableArray alloc] initWithCapacity:searchItems.size()]);
-    for (const auto& searchItem: searchItems)
-        [items addObject:searchItem];
-
-    [[NSUserDefaults standardUserDefaults] setObject:items.get() forKey:autosaveKey(name)];
+    WebCore::saveRecentSearches(name, searchItems);
 }
 
-void SearchPopupMenuMac::loadRecentSearches(const AtomicString& name, Vector<String>& searchItems)
+void SearchPopupMenuMac::loadRecentSearches(const AtomicString& name, Vector<WebCore::RecentSearch>& searchItems)
 {
-    if (name.isEmpty())
-        return;
-
-    searchItems.clear();
-    for (NSString *item in [[NSUserDefaults standardUserDefaults] arrayForKey:autosaveKey(name)]) {
-        if ([item isKindOfClass:[NSString class]])
-            searchItems.append(item);
-    }
+    searchItems = WebCore::loadRecentSearches(name);
 }

Modified: branches/safari-601-branch/Source/WebKit2/ChangeLog (193959 => 193960)


--- branches/safari-601-branch/Source/WebKit2/ChangeLog	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebKit2/ChangeLog	2015-12-11 18:26:12 UTC (rev 193960)
@@ -1,3 +1,53 @@
+2015-12-11  Matthew Hanson  <[email protected]>
+
+        Merge r191084. rdar://problem/23715623
+
+    2015-10-14  Zhuo Li  <[email protected]>
+
+            Augment <input type=search>’s recent search history with the time each entry was added,
+            in order to allow time-based clearing of search history.
+            https://bugs.webkit.org/show_bug.cgi?id=148388.
+
+            Reviewed by Darin Adler.
+
+            Replace Vector<String> with Vector<RecentSearch>, where RecentSearch is a struct
+            that consists search string and time, for recent searches in order to store additional time
+            information.
+
+            All these new RecentSearches are stored in a plist in which the structure looks like:
+            Root {
+                "items": {
+                    autosave name: {
+                        "searches": [
+                            { "searchString": searchString, "date": date },
+                            ...
+                        ]
+                    }
+                }
+            }
+
+            * Scripts/webkit/messages.py:
+            (headers_for_type):
+            * Shared/WebCoreArgumentCoders.cpp:
+            (IPC::ArgumentCoder<RecentSearch>::encode): Encode the new struct RecentSearch
+            (IPC::ArgumentCoder<RecentSearch>::decode): Decode the new struct RecentSearch
+            * Shared/WebCoreArgumentCoders.h:
+            * UIProcess/Cocoa/WebPageProxyCocoa.mm:
+            (WebKit::WebPageProxy::saveRecentSearches): Call saveRecentSearches in WebCore::SearchPopupMenuCocoa.
+            (WebKit::WebPageProxy::loadRecentSearches): Call loadRecentSearches in WebCore::SearchPopupMenuCocoa.
+            * UIProcess/WebPageProxy.h:
+            * UIProcess/WebPageProxy.messages.in:
+            * UIProcess/efl/WebPageProxyEfl.cpp:
+            (WebKit::WebPageProxy::saveRecentSearches):
+            (WebKit::WebPageProxy::loadRecentSearches):
+            * UIProcess/gtk/WebPageProxyGtk.cpp:
+            (WebKit::WebPageProxy::saveRecentSearches):
+            (WebKit::WebPageProxy::loadRecentSearches):
+            * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp:
+            (WebKit::WebSearchPopupMenu::saveRecentSearches):
+            (WebKit::WebSearchPopupMenu::loadRecentSearches):
+            * WebProcess/WebCoreSupport/WebSearchPopupMenu.h:
+
 2015-12-09  Babak Shafiei  <[email protected]>
 
         Merge r190505.

Modified: branches/safari-601-branch/Source/WebKit2/Scripts/webkit/messages.py (193959 => 193960)


--- branches/safari-601-branch/Source/WebKit2/Scripts/webkit/messages.py	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebKit2/Scripts/webkit/messages.py	2015-12-11 18:26:12 UTC (rev 193960)
@@ -361,6 +361,7 @@
         'WebCore::PluginInfo': ['<WebCore/PluginData.h>'],
         'WebCore::PasteboardImage': ['<WebCore/Pasteboard.h>'],
         'WebCore::PasteboardWebContent': ['<WebCore/Pasteboard.h>'],
+        'WebCore::RecentSearch': ['<WebCore/SearchPopupMenu.h>'],
         'WebCore::TextCheckingRequestData': ['<WebCore/TextChecking.h>'],
         'WebCore::TextCheckingResult': ['<WebCore/TextCheckerClient.h>'],
         'WebCore::TextIndicatorData': ['<WebCore/TextIndicator.h>'],

Modified: branches/safari-601-branch/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp (193959 => 193960)


--- branches/safari-601-branch/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp	2015-12-11 18:26:12 UTC (rev 193960)
@@ -58,6 +58,7 @@
 #include <WebCore/ResourceResponse.h>
 #include <WebCore/ScrollingConstraints.h>
 #include <WebCore/ScrollingCoordinator.h>
+#include <WebCore/SearchPopupMenu.h>
 #include <WebCore/SessionID.h>
 #include <WebCore/TextCheckerClient.h>
 #include <WebCore/TextIndicator.h>
@@ -482,6 +483,22 @@
     return true;
 }
 
+void ArgumentCoder<RecentSearch>::encode(ArgumentEncoder& encoder, const RecentSearch& recentSearch)
+{
+    encoder << recentSearch.string << recentSearch.time;
+}
+
+bool ArgumentCoder<RecentSearch>::decode(ArgumentDecoder& decoder, RecentSearch& recentSearch)
+{
+    if (!decoder.decode(recentSearch.string))
+        return false;
+
+    if (!decoder.decode(recentSearch.time))
+        return false;
+
+    return true;
+}
+
 template<> struct ArgumentCoder<Region::Span> {
     static void encode(ArgumentEncoder&, const Region::Span&);
     static bool decode(ArgumentDecoder&, Region::Span&);

Modified: branches/safari-601-branch/Source/WebKit2/Shared/WebCoreArgumentCoders.h (193959 => 193960)


--- branches/safari-601-branch/Source/WebKit2/Shared/WebCoreArgumentCoders.h	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebKit2/Shared/WebCoreArgumentCoders.h	2015-12-11 18:26:12 UTC (rev 193960)
@@ -84,6 +84,7 @@
 struct PasteboardImage;
 struct PasteboardWebContent;
 struct PluginInfo;
+struct RecentSearch;
 struct ScrollableAreaParameters;
 struct TextCheckingResult;
 struct TextIndicatorData;
@@ -482,6 +483,11 @@
 };
 #endif
 
+template<> struct ArgumentCoder<WebCore::RecentSearch> {
+    static void encode(ArgumentEncoder&, const WebCore::RecentSearch&);
+    static bool decode(ArgumentDecoder&, WebCore::RecentSearch&);
+};
+
 } // namespace IPC
 
 #endif // WebCoreArgumentCoders_h

Modified: branches/safari-601-branch/Source/WebKit2/UIProcess/Cocoa/WebPageProxyCocoa.mm (193959 => 193960)


--- branches/safari-601-branch/Source/WebKit2/UIProcess/Cocoa/WebPageProxyCocoa.mm	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebKit2/UIProcess/Cocoa/WebPageProxyCocoa.mm	2015-12-11 18:26:12 UTC (rev 193960)
@@ -26,50 +26,29 @@
 #import "config.h"
 #import "WebProcessProxy.h"
 
+#import <WebCore/SearchPopupMenuCocoa.h>
 #import <wtf/cf/TypeCastsCF.h>
 
 namespace WebKit {
 
-static RetainPtr<CFStringRef> autosaveKey(const String& name)
+void WebPageProxy::saveRecentSearches(const String& name, const Vector<WebCore::RecentSearch>& searchItems)
 {
-    return String("com.apple.WebKit.searchField:" + name).createCFString();
-}
-
-void WebPageProxy::saveRecentSearches(const String& name, const Vector<String>& searchItems)
-{
     if (!name) {
         // FIXME: This should be a message check.
         return;
     }
 
-    RetainPtr<CFMutableArrayRef> items;
-
-    if (!searchItems.isEmpty()) {
-        items = adoptCF(CFArrayCreateMutable(0, searchItems.size(), &kCFTypeArrayCallBacks));
-
-        for (const auto& searchItem : searchItems)
-            CFArrayAppendValue(items.get(), searchItem.createCFString().get());
-    }
-
-    CFPreferencesSetAppValue(autosaveKey(name).get(), items.get(), kCFPreferencesCurrentApplication);
-    CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
+    WebCore::saveRecentSearches(name, searchItems);
 }
 
-void WebPageProxy::loadRecentSearches(const String& name, Vector<String>& searchItems)
+void WebPageProxy::loadRecentSearches(const String& name, Vector<WebCore::RecentSearch>& searchItems)
 {
     if (!name) {
         // FIXME: This should be a message check.
         return;
     }
 
-    auto items = adoptCF(dynamic_cf_cast<CFArrayRef>(CFPreferencesCopyAppValue(autosaveKey(name).get(), kCFPreferencesCurrentApplication)));
-    if (!items)
-        return;
-
-    for (size_t i = 0, size = CFArrayGetCount(items.get()); i < size; ++i) {
-        if (auto item = dynamic_cf_cast<CFStringRef>(CFArrayGetValueAtIndex(items.get(), i)))
-            searchItems.append(item);
-    }
+    searchItems = WebCore::loadRecentSearches(name);
 }
 
 #if ENABLE(CONTENT_FILTERING)

Modified: branches/safari-601-branch/Source/WebKit2/UIProcess/WebPageProxy.h (193959 => 193960)


--- branches/safari-601-branch/Source/WebKit2/UIProcess/WebPageProxy.h	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebKit2/UIProcess/WebPageProxy.h	2015-12-11 18:26:12 UTC (rev 193960)
@@ -71,6 +71,7 @@
 #include <WebCore/Page.h>
 #include <WebCore/PlatformScreen.h>
 #include <WebCore/ScrollTypes.h>
+#include <WebCore/SearchPopupMenu.h>
 #include <WebCore/TextChecking.h>
 #include <WebCore/TextGranularity.h>
 #include <WebCore/ViewState.h>
@@ -1301,8 +1302,8 @@
 #endif
 
     // Search popup results
-    void saveRecentSearches(const String&, const Vector<String>&);
-    void loadRecentSearches(const String&, Vector<String>&);
+    void saveRecentSearches(const String&, const Vector<WebCore::RecentSearch>&);
+    void loadRecentSearches(const String&, Vector<WebCore::RecentSearch>&);
 
 #if PLATFORM(COCOA)
     // Speech.

Modified: branches/safari-601-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in (193959 => 193960)


--- branches/safari-601-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2015-12-11 18:26:12 UTC (rev 193960)
@@ -379,8 +379,8 @@
 #endif
 
     # Search popup menus
-    SaveRecentSearches(String name, Vector<String> searchItems)
-    LoadRecentSearches(String name) -> (Vector<String> result)
+    SaveRecentSearches(String name, Vector<WebCore::RecentSearch> searchItems)
+    LoadRecentSearches(String name) -> (Vector<WebCore::RecentSearch> result)
 
     SavePDFToFileInDownloadsFolder(String suggestedFilename, String originatingURLString, IPC::DataReference data)
 

Modified: branches/safari-601-branch/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp (193959 => 193960)


--- branches/safari-601-branch/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp	2015-12-11 18:26:12 UTC (rev 193960)
@@ -73,12 +73,12 @@
     notImplemented();
 }
 
-void WebPageProxy::saveRecentSearches(const String&, const Vector<String>&)
+void WebPageProxy::saveRecentSearches(const String&, const Vector<WebCore::RecentSearch>&)
 {
     notImplemented();
 }
 
-void WebPageProxy::loadRecentSearches(const String&, Vector<String>&)
+void WebPageProxy::loadRecentSearches(const String&, Vector<WebCore::RecentSearch>&)
 {
     notImplemented();
 }

Modified: branches/safari-601-branch/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp (193959 => 193960)


--- branches/safari-601-branch/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp	2015-12-11 18:26:12 UTC (rev 193960)
@@ -57,12 +57,12 @@
     m_accessibilityPlugID = plugID;
 }
 
-void WebPageProxy::saveRecentSearches(const String&, const Vector<String>&)
+void WebPageProxy::saveRecentSearches(const String&, const Vector<WebCore::RecentSearch>&)
 {
     notImplemented();
 }
 
-void WebPageProxy::loadRecentSearches(const String&, Vector<String>&)
+void WebPageProxy::loadRecentSearches(const String&, Vector<WebCore::RecentSearch>&)
 {
     notImplemented();
 }

Modified: branches/safari-601-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp (193959 => 193960)


--- branches/safari-601-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp	2015-12-11 18:26:12 UTC (rev 193960)
@@ -47,7 +47,7 @@
     return m_popup.get();
 }
 
-void WebSearchPopupMenu::saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems)
+void WebSearchPopupMenu::saveRecentSearches(const AtomicString& name, const Vector<RecentSearch>& searchItems)
 {
     if (name.isEmpty())
         return;
@@ -59,7 +59,7 @@
     WebProcess::singleton().parentProcessConnection()->send(Messages::WebPageProxy::SaveRecentSearches(name, searchItems), page->pageID());
 }
 
-void WebSearchPopupMenu::loadRecentSearches(const AtomicString& name, Vector<String>& resultItems)
+void WebSearchPopupMenu::loadRecentSearches(const AtomicString& name, Vector<RecentSearch>& resultItems)
 {
     if (name.isEmpty())
         return;

Modified: branches/safari-601-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebSearchPopupMenu.h (193959 => 193960)


--- branches/safari-601-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebSearchPopupMenu.h	2015-12-11 17:45:16 UTC (rev 193959)
+++ branches/safari-601-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebSearchPopupMenu.h	2015-12-11 18:26:12 UTC (rev 193960)
@@ -31,8 +31,8 @@
     static Ref<WebSearchPopupMenu> create(WebPage*, WebCore::PopupMenuClient*);
 
     virtual WebCore::PopupMenu* popupMenu() override;
-    virtual void saveRecentSearches(const WTF::AtomicString& name, const Vector<String>& searchItems) override;
-    virtual void loadRecentSearches(const WTF::AtomicString& name, Vector<String>& searchItems) override;
+    virtual void saveRecentSearches(const WTF::AtomicString& name, const Vector<WebCore::RecentSearch>&) override;
+    virtual void loadRecentSearches(const WTF::AtomicString& name, Vector<WebCore::RecentSearch>&) override;
     virtual bool enabled() override;
 
 private:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to