Chromium Code Reviews| Index: services/resource_coordinator/coordination_unit/process_coordination_unit_impl.h |
| diff --git a/services/resource_coordinator/coordination_unit/process_coordination_unit_impl.h b/services/resource_coordinator/coordination_unit/process_coordination_unit_impl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cfdcb584f5b629684fec80a52f063860053765d6 |
| --- /dev/null |
| +++ b/services/resource_coordinator/coordination_unit/process_coordination_unit_impl.h |
| @@ -0,0 +1,42 @@ |
| +// 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. |
| + |
| +#ifndef SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_PROCESS_COORDINATION_UNIT_IMPL_H_ |
| +#define SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_PROCESS_COORDINATION_UNIT_IMPL_H_ |
| + |
| +#include "base/process/process_metrics.h" |
| +#include "base/timer/timer.h" |
| +#include "services/resource_coordinator/coordination_unit/coordination_unit_impl.h" |
| + |
| +namespace service_manager { |
| + |
|
oystein (OOO til 10th of July)
2017/05/17 23:06:06
nit: ditch the blank lines here and the //namespac
matthalp
2017/05/18 16:13:46
Done.
|
| +class ServiceContextRef; |
| + |
| +} // namespace service_manager |
| + |
| +namespace resource_coordinator { |
| + |
| +struct CoordinationUnitID; |
| + |
| +class ProcessCoordinationUnitImpl : public CoordinationUnitImpl { |
| + public: |
| + ProcessCoordinationUnitImpl( |
| + const CoordinationUnitID& id, |
| + std::unique_ptr<service_manager::ServiceContextRef> service_ref); |
| + ~ProcessCoordinationUnitImpl() override; |
| + void ScheduleProcessCPUProfiling(base::TimeDelta delay); |
| + void MeasureProcessCPUUsage(); |
| + double GetCPUUsageForTesting() override; |
| + |
| + private: |
| + std::unique_ptr<base::ProcessMetrics> process_metrics_; |
|
oystein (OOO til 10th of July)
2017/05/17 23:06:07
nit: #include <memory> for this.
matthalp
2017/05/18 16:13:46
Done.
|
| + base::OneShotTimer repeating_timer_; |
| + double cpu_usage_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ProcessCoordinationUnitImpl); |
|
oystein (OOO til 10th of July)
2017/05/17 23:06:07
nit: #include "base/macros.h"
matthalp
2017/05/18 16:13:46
Done.
|
| +}; |
| + |
| +} // namespace resource_coordinator |
| + |
| +#endif // SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_PROCESS_COORDINATION_UNIT_IMPL_H_ |