• Joe DeBlasio's avatar
    [Lookalikes] Ensure only one site engagement update occurs at once · e43a8e77
    Joe DeBlasio authored
    This CL changes the way async callbacks to the lookalike service are
    handled. Previously, if the list of engaged sites was out of date, a
    background task would be spawned to update them. This could result in
    a spike of near-simultaneous background tasks that would contend for the
    same lock. This contributes to jank.
    
    This CL changes the process to ensure that only one update is in flight
    at a time, and simply pushes the on-updated callbacks onto the end of
    the task sequence after any existing update completes.
    
    Bug: 1157596,1135279
    Change-Id: I0629f523491d8e4b8e966fa3b65f670c901e7169
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2623005
    Commit-Queue: Joe DeBlasio <jdeblasio@chromium.org>
    Reviewed-by: default avatarMustafa Emre Acer <meacer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#842821}
    e43a8e77
lookalike_url_service.cc 5.53 KB