Convert HeartbeatSender to use Callbacks instead of Listener pattern.
This is a separte, self-contained changelist, but it fits in-between
part 2 and part 3 of a set of changes for reporting of policy errors
via host-offline-reason (which address the issue at crbug.com/410050).
Using Callbacks rather than Listener pattern in HeartbeatSender allows
MinimumHeartbeatSender from part3 to consistently use Callbacks (which
in turn allows a *static* MinimumHeartbeatSender::Create method).
To support this changelist, I introduced MockCallback<Sig> template.
I was not able to find a generic MockCallback in Chromium. GMock
has MockFunction<Sig>, but connecting it to Chromium's Callback class
is more trouble, then just introducing a new MockCallback<Sig> right here.
In the current changelist I just have MockClosure, but in part3, I will
be extending this to cover MockCallback<R(A1)>.
BUG=410050
Review URL: https://codereview.chromium.org/
734053003
Cr-Commit-Position: refs/heads/master@{#305836}