Convert HeartbeatSender to use Callbacks instead of Listener pattern.
commitead20f1a85c6cb6f3faf6042bea56126a7078854
authorlukasza <lukasza@chromium.org>
Wed, 26 Nov 2014 18:19:48 +0000 (26 10:19 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 26 Nov 2014 18:20:51 +0000 (26 18:20 +0000)
tree6a62757df1b3e1fdfa479dea31e53112515e5a8f
parent6a3749381639840fec38b8449638653d2c925c0a
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}
remoting/host/heartbeat_sender.cc
remoting/host/heartbeat_sender.h
remoting/host/heartbeat_sender_unittest.cc
remoting/host/mock_callback.h [new file with mode: 0644]
remoting/host/remoting_me2me_host.cc
remoting/remoting_test.gypi