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

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

Issue 2856243002: [Chromoting] Add ProcessStatsDispatcher to send process stats to the client
Patch Set: Partially resolve the review comments Created 3 years, 6 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
« no previous file with comments | « remoting/protocol/process_stats_adapter.h ('k') | remoting/protocol/process_stats_stub.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/process_stats_adapter.h"
6
7 #include <utility>
8
9 #include "base/logging.h"
10 #include "remoting/base/constants.h"
11 #include "remoting/proto/control.pb.h"
12 #include "remoting/proto/process_stats.pb.h"
13 #include "remoting/protocol/client_stub.h"
14
15 namespace remoting {
16 namespace protocol {
17
18 ProcessStatsAdapter::ProcessStatsAdapter(ClientStub* client_stub)
19 : client_stub_(client_stub) {
20 DCHECK(client_stub_);
21 }
22 ProcessStatsAdapter::~ProcessStatsAdapter() = default;
23
24 void ProcessStatsAdapter::OnProcessStats(
25 const AggregatedProcessResourceUsage& usage) {
26 protocol::ExtensionMessage message;
27 message.set_type(kProcessStatsExtensionMessageType);
28 std::string data;
29 bool result = usage.SerializeToString(&data);
30 DCHECK(result);
31 message.set_data(std::move(data));
32
33 client_stub_->DeliverHostMessage(message);
34 }
35
36 } // namespace protocol
37 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/process_stats_adapter.h ('k') | remoting/protocol/process_stats_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698