[Webkit-unassigned] [Bug 150019] We should be able to clear search field recent searches based on time given
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Oct 16 10:31:36 PDT 2015
https://bugs.webkit.org/show_bug.cgi?id=150019
--- Comment #9 from Zach Li <zacharyli323 at gmail.com> ---
(In reply to comment #8)
> Comment on attachment 263184 [details]
> Patch v2
>
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=263184&action=review
>
> > Source/WebCore/platform/SearchPopupMenu.h:45
> > +WEBCORE_EXPORT static void removeRecentSearches(std::chrono::system_clock::time_point modifiedSince);
>
> Indentation.
Will fix.
>
> > 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.
What is the benefit of using auto? Is it more modern?
>
> > Source/WebCore/platform/cocoa/SearchPopupMenuCocoa.mm:203
> > + RetainPtr<NSDictionary> recentSearchesPlist = returnUncorruptedRecentSearchesPlist(dateModified);
>
> Can use auto here.
Ditto.
>
> > Source/WebCore/platform/cocoa/SearchPopupMenuCocoa.mm:205
> > + [recentSearchesPlist writeToFile:searchFieldRecentSearchesPlistPath() atomically:NO];
>
> Should be atomically:YES here.
Darin suggested I should use atomically:NO because of the performance cost.
>
> > 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?
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.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20151016/24448b1a/attachment-0001.html>
More information about the webkit-unassigned
mailing list