• Guillaume Jenkins's avatar
    [CBCM] Refactor ReportScheduler to use delegate pattern · fe481c66
    Guillaume Jenkins authored
    Moves all platform-specific logic in ReportScheduler to a delegate
    class. A few things to note:
    
    - For now, ReportScheduler takes the desktop-specific factory in its
      constructor because it can't use the base factory until
      ReportScheduler is moved to components.
    - Observing the build state is now done by the desktop delegate. To
      notify ReportScheduler of an update, ReportScheduler passes a
      callback to its delegate, which the delegate can use to trigger
      report uploads. For this to work, the ReportTrigger enum had to be
      made visible to the delegate.
    - ReportScheduler still has one chrome/browser dependency for the name
      of the kLastUploadTimestamp pref. This pref name will be moved to
      components in the next CL.
    - On Chrome OS, ReportScheduler was being given a specific profile to
      watch. Because Profile cannot be used in Components, the Profile*
      must now be passed to the delegate directly. So, on Chrome OS, the
      ReportSchedulerDesktop delegate is instantiated directly and passed
      to ReportScheduler, instead of ReportScheduler taking the delegate
      from the factory.
    
    Bug: 1092432
    Change-Id: Ia3169410c8ca83151556fed4319db512bc9fc258
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2303589
    Commit-Queue: Guillaume Jenkins <gujen@google.com>
    Reviewed-by: default avatarMaksim Ivanov <emaxx@chromium.org>
    Reviewed-by: default avatarOwen Min <zmin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#790848}
    fe481c66
report_scheduler.cc 9.59 KB