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

Unified Diff: remoting/protocol/fake_process_stats_stub.cc

Issue 2858813002: [Chromoting] Use ProcessStatsSender in host process
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/fake_process_stats_stub.cc
diff --git a/remoting/protocol/fake_process_stats_stub.cc b/remoting/protocol/fake_process_stats_stub.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e614436d0807705cfb6c3c3dd54893b0c281d290
--- /dev/null
+++ b/remoting/protocol/fake_process_stats_stub.cc
@@ -0,0 +1,37 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "remoting/protocol/fake_process_stats_stub.h"
+
+namespace remoting {
+namespace protocol {
+
+FakeProcessStatsStub::FakeProcessStatsStub() = default;
+FakeProcessStatsStub::~FakeProcessStatsStub() = default;
+
+void FakeProcessStatsStub::OnProcessStats(
+ const AggregatedProcessResourceUsage& usage) {
+ received_.push_back(usage);
+ if (received_.size() == expected_usage_count_ &&
+ !quit_closure_.is_null()) {
+ quit_closure_.Run();
+ }
+}
+
+const std::vector<AggregatedProcessResourceUsage>&
+FakeProcessStatsStub::received() const {
+ return received_;
+}
+
+void FakeProcessStatsStub::set_quit_closure(base::Closure quit_closure) {
+ quit_closure_ = quit_closure;
+}
+
+void FakeProcessStatsStub::set_expected_usage_count(
+ size_t expected_usage_count) {
+ expected_usage_count_ = expected_usage_count;
+}
+
+} // namespace protocol
+} // namespace remoting
« 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