• Dan Harrington's avatar
    Add start of scheduling logic for v2 · d498e91b
    Dan Harrington authored
    Instead of using FeedSchedulerHost directly, this CL starts importing
    its capabilities into FeedStream.
    - Added RefreshTaskScheduler interface for scheduling the background task.
    - Added AllRefreshThrottler to wrap use of RefreshThrottler
    - FeedStream handles various events, and reacts by attempting to do a
      refresh. Actual refresh code is TBD.
      Injection of these events will happen externally.
    - scheduling.cc implements some scheduling logic/constants.
    - Added a FeedStream::EventObserver interface to simplify
      testing and push metric logging code out of FeedStream.
    
    Unit tests in this CL are admittedly minimal, and should be
    improved. I'm thinking it makes sense to wait until we have code that
    actually does a refresh.
    
    Things FeedSchedulerHost does not included here:
    - Reconciling host state vs feed library state (we don't need this)
    - Lots of UMA (we'll replicate some of this)
    - Resetting the scheduled fetch on fetch success (todo)
    
    Bug: 1044139
    Change-Id: I8fbecfad67ff1639b419fe65962f4887ec2ea305
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2031721
    Commit-Queue: Dan H <harringtond@chromium.org>
    Reviewed-by: default avatarCarlos Knippschild <carlosk@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#748903}
    d498e91b
scheduling.h 1.29 KB