Let AppRegistryCache.OnApps recurse

Having cache.OnApps notifying observer.OnAppsUpdate calling cache.OnApps
should be pretty rare, but if it does happen, we should behave sensibly.

Sensibly includes maintaining the consistency condition that if calling
cache.ForEachApp or cache.ForOneApp, the AppRegistryCache should present
a consistent view of the world: the inner and outer AppUpdate's should
be equal.

Sensibly also includes that delta's passed to OnApps should be processed
in FIFO, not LIFO order. Each delta builds on the sum of previous ones.

BUG=826982

Change-Id: I99b99b99176dd0afff6281814c0a20a025b9d462
Reviewed-on: https://chromium-review.googlesource.com/c/1388348
Commit-Queue: Nigel Tao <nigeltao@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#621041}
3 files changed