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

Side by Side Diff: remoting/protocol/fake_process_stats_stub.cc

Issue 2858813002: [Chromoting] Use ProcessStatsSender in host process
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "remoting/protocol/fake_process_stats_stub.h"
6
7 namespace remoting {
8 namespace protocol {
9
10 FakeProcessStatsStub::FakeProcessStatsStub() = default;
11 FakeProcessStatsStub::~FakeProcessStatsStub() = default;
12
13 void FakeProcessStatsStub::OnProcessStats(
14 const AggregatedProcessResourceUsage& usage) {
15 received_.push_back(usage);
16 if (received_.size() == expected_usage_count_ &&
17 !quit_closure_.is_null()) {
18 quit_closure_.Run();
19 }
20 }
21
22 const std::vector<AggregatedProcessResourceUsage>&
23 FakeProcessStatsStub::received() const {
24 return received_;
25 }
26
27 void FakeProcessStatsStub::set_quit_closure(base::Closure quit_closure) {
28 quit_closure_ = quit_closure;
29 }
30
31 void FakeProcessStatsStub::set_expected_usage_count(
32 size_t expected_usage_count) {
33 expected_usage_count_ = expected_usage_count;
34 }
35
36 } // namespace protocol
37 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/fake_process_stats_stub.h ('k') | remoting/protocol/ice_connection_to_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698