Add RegisterCallback to DailyEvent
The DailyEvent class enables limiting function call (especially metric
data gathering) to once a day. Up to now the only way to use it was
creating DailyEvent object, implementing the DailyEvent::Observer, with
overridden OnDailyEvent method and registering such an Observer to the
observed DailyEvent object. It requires quite a lot of code for simple
appliance. This CL improves the class by providing a method to register
Callback directly.
Bug: 438120812, 438120815
Change-Id: I7c8384c30502869e4c86ca9fb9d3161b0f6d49f7
Fixed: 438121481
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6839619
Reviewed-by: Patryk Chodur <pchodur@google.com>
Commit-Queue: Robert Ferens <rferens@google.com>
Reviewed-by: Andrew Rayskiy <greengrape@google.com>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1502712}
NOKEYCHECK=True
GitOrigin-RevId: 770c94282641597f4873f26657e2fe9b30d764c2
3 files changed