Introduce the BackgroundFetchDataManagerObserver class

In the Background Fetch code, there currently isn't a clean separation
between initiating an action to storage (e.g. updating the title of a
background fetch from JavaScript) and propagating such changes to other
subsystems that have to know.

In effect, there are BackgroundFetchJobController instances for
background fetches that aren't active, the BackgroundFetchContext is the
one that owns the instances (as opposed to the BackgroundFetchScheduler)
and much of the control flow serves multiple purposes.

This CL introduces an observer interface for the
BackgroundFetchDataManager that notifies observers about successful
changes to the data store. This means that such code doesn't have to
worry about the source of the change, or whether it was successful.

Right now the BackgroundFetchContext observes the data manager. In the
mid term we'd like the BackgroundFetchScheduler to observe the data
manager instead.

Bug: 850512
Change-Id: Ie4d5b280ac1f220553cc2867c035bf4662c4e88f
Reviewed-on: https://chromium-review.googlesource.com/1127784
Commit-Queue: Peter Beverloo <peter@chromium.org>
Reviewed-by: Michael van Ouwerkerk <mvanouwerkerk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573002}
7 files changed