• Yao Xiao's avatar
    Update the floc computation scheduling pattern · 0e2f7cb7
    Yao Xiao authored
    Before: Schedule the computation events using a RepeatingTimer and use a
    session number to address potential race conditions.
    
    After: Use a flag |floc_computation_in_progress_| to guard the process
    from ComputeFloc to OnComputeFlocCompleted. Incoming computation will be
    ignored if there’s one ongoing. After each OnComputeFlocCompleted, a
    ComputeFloc event will be scheduled 24 hours later / override the
    existing scheduled event.
    
    Why: The new pattern would be more suitable for a future plan where more
    computation triggers are introduced (e.g. kHistoryDelete). In that case,
    the caller can simply call
    ComputeFloc(ComputeFlocTrigger::kHistoryDelete) without needing to reset
    the timer.
    
    
    Bug: 1062736
    Change-Id: Ic128262272c71be3bc8998bb192ff7c7b615faa8
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2359394
    Commit-Queue: Yao Xiao <yaoxia@chromium.org>
    Reviewed-by: default avatarJosh Karlin <jkarlin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#799547}
    0e2f7cb7
floc_id_provider_impl.h 4.21 KB