| Index: remoting/protocol/process_stats_adapter.cc
|
| diff --git a/remoting/protocol/process_stats_adapter.cc b/remoting/protocol/process_stats_adapter.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..653b47e4a8eeee7af4459c241a58bedfa62fac51
|
| --- /dev/null
|
| +++ b/remoting/protocol/process_stats_adapter.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/process_stats_adapter.h"
|
| +
|
| +#include <utility>
|
| +
|
| +#include "base/logging.h"
|
| +#include "remoting/base/constants.h"
|
| +#include "remoting/proto/control.pb.h"
|
| +#include "remoting/proto/process_stats.pb.h"
|
| +#include "remoting/protocol/client_stub.h"
|
| +
|
| +namespace remoting {
|
| +namespace protocol {
|
| +
|
| +ProcessStatsAdapter::ProcessStatsAdapter(ClientStub* client_stub)
|
| + : client_stub_(client_stub) {
|
| + DCHECK(client_stub_);
|
| +}
|
| +ProcessStatsAdapter::~ProcessStatsAdapter() = default;
|
| +
|
| +void ProcessStatsAdapter::OnProcessStats(
|
| + const AggregatedProcessResourceUsage& usage) {
|
| + protocol::ExtensionMessage message;
|
| + message.set_type(kProcessStatsExtensionMessageType);
|
| + std::string data;
|
| + bool result = usage.SerializeToString(&data);
|
| + DCHECK(result);
|
| + message.set_data(std::move(data));
|
| +
|
| + client_stub_->DeliverHostMessage(message);
|
| +}
|
| +
|
| +} // namespace protocol
|
| +} // namespace remoting
|
|
|