• Tommy Li's avatar
    [search_engines] Stop Extensions from duplicating TemplateURL Sync GUIDs · 50aeacaf
    Tommy Li authored
    Extensions that use the Override Settings API to create new search
    engines matching prepopulated engines currently erreneously duplicate
    the Sync GUID of the prepopulated engines.
    
    That violates an invariant of TemplateURLService - that each engine
    have a unique Sync GUID.
    
    It also caused CHECK crashes, when it seemed like we were trying to
    remove an engine that matched the GUID of the DSE, yet it didn't match
    the pointer value of the DSE.
    
    This CL also relaxes the CHECK, because now we have to be tolerant of
    users with a strange database state of multiple engines having the same
    Sync GUID.
    
    It seems like this bug has been around for years without causing harm
    though, so it's probably mostly harmless except for our CHECK.
    
    Bug: 1166372
    Change-Id: I4c0e0729a3b3f27f29615b782532b20dcd4dc996
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2636683
    Commit-Queue: Tommy Li <tommycli@chromium.org>
    Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
    Reviewed-by: default avatarOrin Jaworski <orinj@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#845330}
    50aeacaf
template_url_service.cc 87.7 KB