[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:57:21 PDT 2015
https://bugs.webkit.org/show_bug.cgi?id=150019
--- Comment #10 from Anders Carlsson <andersca at apple.com> ---
(In reply to comment #9)
> (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?
It avoids having "NSDictionary" twice on one line.
> >
> > > 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.
I think the performance cost is negligible and not corrupting data is better.
> > > 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.
Just call platformRemoveRecentSearches and implement it in WebsiteDataStoreCocoa.mm.
--
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/356ce5e7/attachment.html>
More information about the webkit-unassigned
mailing list