Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Issue 734053003: Reporting of policy errors via host-offline-reason: part 2b (Closed)

Created:
6 years, 1 month ago by Łukasz Anforowicz
Modified:
6 years ago
Reviewers:
Lambros
CC:
chromium-reviews, chromoting-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@hor-nohoststatussender
Project:
chromium
Visibility:
Public.

Description

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 Committed: https://crrev.com/ead20f1a85c6cb6f3faf6042bea56126a7078854 Cr-Commit-Position: refs/heads/master@{#305836}

Patch Set 1 #

Total comments: 31

Patch Set 2 : Addressed CR feedback from Lambros. #

Total comments: 4

Patch Set 3 : Going back to including callback.h #

Patch Set 4 : Switched to base::Unretained in mock_callback.h #

Total comments: 2

Patch Set 5 : Removing unnecessary include of weak_ptr.h #

Patch Set 6 : Rebasing... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+86 lines, -62 lines) Patch
M remoting/host/heartbeat_sender.h View 1 2 3 4 5 4 chunks +5 lines, -21 lines 0 comments Download
M remoting/host/heartbeat_sender.cc View 1 2 3 4 5 3 chunks +6 lines, -4 lines 0 comments Download
M remoting/host/heartbeat_sender_unittest.cc View 1 2 3 4 5 7 chunks +25 lines, -30 lines 0 comments Download
A remoting/host/mock_callback.h View 1 2 3 1 chunk +43 lines, -0 lines 0 comments Download
M remoting/host/remoting_me2me_host.cc View 1 2 3 4 5 4 chunks +6 lines, -7 lines 0 comments Download
M remoting/remoting_test.gypi View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 15 (3 generated)
Łukasz Anforowicz
Lambros, Could you please review HeartbeatSender refactoring from Listener pattern to Callbacks (suggested by Renato) ...
6 years, 1 month ago (2014-11-17 18:16:56 UTC) #2
Lambros
https://codereview.chromium.org/734053003/diff/1/remoting/host/heartbeat_sender_unittest.cc File remoting/host/heartbeat_sender_unittest.cc (right): https://codereview.chromium.org/734053003/diff/1/remoting/host/heartbeat_sender_unittest.cc#newcode292 remoting/host/heartbeat_sender_unittest.cc:292: .Times(0); nit: Fits on one line. https://codereview.chromium.org/734053003/diff/1/remoting/host/heartbeat_sender_unittest.cc#newcode301 remoting/host/heartbeat_sender_unittest.cc:301: false, ...
6 years, 1 month ago (2014-11-18 00:19:30 UTC) #3
Łukasz Anforowicz
Thanks for the feedback. I think I addressed most of it. Please take a look ...
6 years, 1 month ago (2014-11-18 01:03:22 UTC) #4
Lambros
https://codereview.chromium.org/734053003/diff/1/remoting/host/heartbeat_sender_unittest.cc File remoting/host/heartbeat_sender_unittest.cc (right): https://codereview.chromium.org/734053003/diff/1/remoting/host/heartbeat_sender_unittest.cc#newcode306 remoting/host/heartbeat_sender_unittest.cc:306: EXPECT_CALL(mock_ack_callback, Run()) On 2014/11/18 01:03:22, lukasza wrote: > On ...
6 years, 1 month ago (2014-11-18 02:33:53 UTC) #5
Łukasz Anforowicz
Thanks for pushing back on avoiding WeakPtr in mock_callback.h; after thinking more about it I ...
6 years, 1 month ago (2014-11-18 17:30:46 UTC) #6
Lambros
On the CL description: This is a small self-contained CL. So I think it's better ...
6 years, 1 month ago (2014-11-18 18:47:21 UTC) #7
Łukasz Anforowicz
Switched to base::Unretained in mock_callback.h (I want to keep mock_callback.h in this changelist simple and ...
6 years, 1 month ago (2014-11-18 20:31:24 UTC) #9
Lambros
lgtm https://codereview.chromium.org/734053003/diff/80001/remoting/host/heartbeat_sender_unittest.cc File remoting/host/heartbeat_sender_unittest.cc (right): https://codereview.chromium.org/734053003/diff/80001/remoting/host/heartbeat_sender_unittest.cc#newcode10 remoting/host/heartbeat_sender_unittest.cc:10: #include "base/memory/weak_ptr.h" Do you need weark_ptr.h ?
6 years, 1 month ago (2014-11-18 21:57:56 UTC) #10
Łukasz Anforowicz
Fixed the unnecessary include of weak_ptr.h https://codereview.chromium.org/734053003/diff/80001/remoting/host/heartbeat_sender_unittest.cc File remoting/host/heartbeat_sender_unittest.cc (right): https://codereview.chromium.org/734053003/diff/80001/remoting/host/heartbeat_sender_unittest.cc#newcode10 remoting/host/heartbeat_sender_unittest.cc:10: #include "base/memory/weak_ptr.h" On ...
6 years, 1 month ago (2014-11-18 22:16:54 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/734053003/120001
6 years ago (2014-11-26 17:40:07 UTC) #13
commit-bot: I haz the power
Committed patchset #6 (id:120001)
6 years ago (2014-11-26 18:20:00 UTC) #14
commit-bot: I haz the power
6 years ago (2014-11-26 18:21:18 UTC) #15
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/ead20f1a85c6cb6f3faf6042bea56126a7078854
Cr-Commit-Position: refs/heads/master@{#305836}

Powered by Google App Engine
This is Rietveld 408576698