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

Unified Diff: remoting/protocol/process_stats_dispatcher.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/process_stats_dispatcher.h ('k') | remoting/protocol/process_stats_stub.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/process_stats_dispatcher.cc
diff --git a/remoting/protocol/process_stats_dispatcher.cc b/remoting/protocol/process_stats_dispatcher.cc
new file mode 100644
index 0000000000000000000000000000000000000000..31c0b1700ab9b5b8a6946950e011dc1cf80662fc
--- /dev/null
+++ b/remoting/protocol/process_stats_dispatcher.cc
@@ -0,0 +1,33 @@
+// Copyright 2016 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/process_stats_dispatcher.h"
+
+#include "remoting/base/compound_buffer.h"
+#include "remoting/base/constants.h"
+#include "remoting/proto/process_stats.pb.h"
+
+namespace remoting {
+namespace protocol {
+
+ProcessStatsDispatcher::ProcessStatsDispatcher()
+ : ChannelDispatcherBase(kProcessStatsChannelName) {}
+
+ProcessStatsDispatcher::~ProcessStatsDispatcher() = default;
+
+void ProcessStatsDispatcher::OnProcessStats(
+ const AggregatedProcessResourceUsage& usage) {
+ // MessagePipe::Send() receives a raw pointer without const-qualifier, so
+ // making a copy can avoid const_cast.
+ AggregatedProcessResourceUsage copy = usage;
+ message_pipe()->Send(&copy, base::Closure());
+}
+
+void ProcessStatsDispatcher::OnIncomingMessage(
+ std::unique_ptr<remoting::CompoundBuffer> message) {
+ // Do not expect to receive message from this channel.
+}
+
+} // namespace protocol
+} // namespace remoting
« no previous file with comments | « remoting/protocol/process_stats_dispatcher.h ('k') | remoting/protocol/process_stats_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698