OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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_dispatcher.h" |
| 6 |
| 7 #include "remoting/base/compound_buffer.h" |
| 8 #include "remoting/base/constants.h" |
| 9 #include "remoting/proto/process_stats.pb.h" |
| 10 |
| 11 namespace remoting { |
| 12 namespace protocol { |
| 13 |
| 14 ProcessStatsDispatcher::ProcessStatsDispatcher() |
| 15 : ChannelDispatcherBase(kProcessStatsChannelName) {} |
| 16 |
| 17 ProcessStatsDispatcher::~ProcessStatsDispatcher() = default; |
| 18 |
| 19 void ProcessStatsDispatcher::OnProcessStats( |
| 20 const AggregatedProcessResourceUsage& usage) { |
| 21 // MessagePipe::Send() receives a raw pointer without const-qualifier, so |
| 22 // making a copy can avoid const_cast. |
| 23 AggregatedProcessResourceUsage copy = usage; |
| 24 message_pipe()->Send(©, base::Closure()); |
| 25 } |
| 26 |
| 27 void ProcessStatsDispatcher::OnIncomingMessage( |
| 28 std::unique_ptr<remoting::CompoundBuffer> message) { |
| 29 // Do not expect to receive message from this channel. |
| 30 } |
| 31 |
| 32 } // namespace protocol |
| 33 } // namespace remoting |
OLD | NEW |