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

Unified Diff: remoting/host/process_stats_sender.cc

Issue 2847743004: Revert of [Chromoting] Retrieve process resource usage (ProcessStats) and its tests (Closed)
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/host/process_stats_sender.h ('k') | remoting/host/process_stats_sender_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/process_stats_sender.cc
diff --git a/remoting/host/process_stats_sender.cc b/remoting/host/process_stats_sender.cc
deleted file mode 100644
index 3fd3f8e8aae2d2415be7d4ec7fa807926ce41e9a..0000000000000000000000000000000000000000
--- a/remoting/host/process_stats_sender.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-// 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/host/process_stats_sender.h"
-
-#include <utility>
-
-#include "base/location.h"
-#include "base/logging.h"
-#include "remoting/host/process_stats_agent.h"
-#include "remoting/host/process_stats_util.h"
-
-namespace remoting {
-
-ProcessStatsSender::ProcessStatsSender(
- protocol::ProcessStatsStub* host_stats_stub,
- base::TimeDelta interval,
- std::initializer_list<ProcessStatsAgent*> agents)
- : host_stats_stub_(host_stats_stub),
- agents_(agents) {
- DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK(host_stats_stub_);
- DCHECK(!interval.is_zero());
- DCHECK(!agents_.empty());
-
- timer_.Start(FROM_HERE, interval, this, &ProcessStatsSender::ReportUsage);
-}
-
-ProcessStatsSender::~ProcessStatsSender() {
- DCHECK(thread_checker_.CalledOnValidThread());
- timer_.Stop();
-}
-
-void ProcessStatsSender::ReportUsage() {
- DCHECK(thread_checker_.CalledOnValidThread());
-
- std::vector<protocol::ProcessResourceUsage> usages;
- for (auto* const agent : agents_) {
- DCHECK(agent);
- protocol::ProcessResourceUsage usage = agent->GetResourceUsage();
- if (!IsEmptyProcessResourceUsage(usage)) {
- usages.push_back(std::move(usage));
- }
- }
-
- host_stats_stub_->OnProcessStats(AggregateProcessResourceUsage(usages));
-}
-
-} // namespace remoting
« no previous file with comments | « remoting/host/process_stats_sender.h ('k') | remoting/host/process_stats_sender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698