<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - We should be able to clear search field recent searches based on time given"
href="https://bugs.webkit.org/show_bug.cgi?id=150019#c9">Comment # 9</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - We should be able to clear search field recent searches based on time given"
href="https://bugs.webkit.org/show_bug.cgi?id=150019">bug 150019</a>
from <span class="vcard"><a class="email" href="mailto:zacharyli323@gmail.com" title="Zach Li <zacharyli323@gmail.com>"> <span class="fn">Zach Li</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=150019#c8">comment #8</a>)
<span class="quote">> Comment on <span class=""><a href="attachment.cgi?id=263184&action=diff" name="attach_263184" title="Patch v2">attachment 263184</a> <a href="attachment.cgi?id=263184&action=edit" title="Patch v2">[details]</a></span>
> Patch v2
>
> View in context:
> <a href="https://bugs.webkit.org/attachment.cgi?id=263184&action=review">https://bugs.webkit.org/attachment.cgi?id=263184&action=review</a>
>
> > Source/WebCore/platform/SearchPopupMenu.h:45
> > +WEBCORE_EXPORT static void removeRecentSearches(std::chrono::system_clock::time_point modifiedSince);
>
> Indentation.</span >
Will fix.
<span class="quote">>
> > Source/WebCore/platform/cocoa/SearchPopupMenuCocoa.mm:135
> > + RetainPtr<NSDictionary> emptyItemsDictionary = adoptNS([[NSDictionary alloc] init]);
> > + RetainPtr<NSDictionary> emptyRecentSearchesDictionary = adoptNS([[NSDictionary alloc] initWithObjectsAndKeys:emptyItemsDictionary.get(), itemsKey, nil]);
>
> Can use auto here.</span >
What is the benefit of using auto? Is it more modern?
<span class="quote">>
> > Source/WebCore/platform/cocoa/SearchPopupMenuCocoa.mm:203
> > + RetainPtr<NSDictionary> recentSearchesPlist = returnUncorruptedRecentSearchesPlist(dateModified);
>
> Can use auto here.</span >
Ditto.
<span class="quote">>
> > Source/WebCore/platform/cocoa/SearchPopupMenuCocoa.mm:205
> > + [recentSearchesPlist writeToFile:searchFieldRecentSearchesPlistPath() atomically:NO];
>
> Should be atomically:YES here.</span >
Darin suggested I should use atomically:NO because of the performance cost.
<span class="quote">>
> > Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:1085
> > + WebCore::SearchPopupMenu::removeRecentSearches(modifiedSince);
>
> I don't think you should call into WebCore here. Why can't you just put the
> contents of removeRecentSearches here?</span >
Originally I had the contents of removeRecentSearches in WebsiteDataStore, but Darin thinks we should not do
#if PLATFORM(COCOA)
#endif
in WebsiteDataStore and it would be better to move this logic to the platform independent SearchPopupMenu file.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>