[Background Sync] Move browser wakeup to scheduler.

Before this chance, we were calculating the soonest wakeup_delta across
all storage partitions every time there was a change in state of any
storage partition, to schedule a wakeup task with this delta.

This change builds on the fact that we have running timers representing
delays for each of the storage partitions with active registrations in
the scheduler. I've changed scheduling the wakeup task to a push system.
Each storage partition informs the scheduler of its soonest delay after
there's any change in state. If this requested delay is the smallest of
all the current delays of the timers the scheduler has, it schedules a
wakeup task.

Canceling delayed scheduling causes cancellation of the wakeup task if
none of the storage partitions need it.

The change also removes now unnecessary code.
Unit tests are also added, and integration tests updated.

Bug: 996166
Change-Id: I1e6216ecc7085535a8e0ca0075ddad05085df763
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1834086
Commit-Queue: Mugdha Lakhani <[email protected]>
Reviewed-by: David Trainor <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Reviewed-by: Rayan Kanso <[email protected]>
Auto-Submit: Mugdha Lakhani <[email protected]>
Cr-Commit-Position: refs/heads/master@{#715262}
13 files changed