[search_engines] TemplateURL::IsBetterThanEngineWithConflictingKeyword
This CL adds a IsBetterThanEngineWithConflictingKeyword method to TemplateURL in an attempt to introduce a total ordering where we can decide consistently across clients whether a given TemplateURL is better than another one with a conflicting keyword. There's already something very similar called: TemplateURLService::BestEngineForKeyword(), which this CL replaces. There's also TemplateURLService::IsLocalTemplateURLBetter() which this CL leaves alone, but I hope to replace that with this new method too as a followup. My goal is that if every client can agree on which conflicting TemplateURL is better than another, then we can resolve sync conflicts in a consistent way. One major caveat: Because the sync GUIDs are not globally unique, it's possible to have a true tie, so there's no total ordering yet. I hope to fix this once I can make the sync GUIDs globally unique. Moreover, IsLocalTemplateURLBetter() privileges the default search provider, which we probably have to keep doing. That would also be an obstacle to this idea. Bug: 1022775 Change-Id: I9249222cb10d2c34c3bc0a90da37fe88c52a6218 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2511256 Commit-Queue: Tommy Li <tommycli@chromium.org> Reviewed-by:Peter Kasting <pkasting@chromium.org> Cr-Commit-Position: refs/heads/master@{#823302}
Showing
Please register or sign in to comment