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

Unified Diff: services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl.h

Issue 2954413004: [GRC] Tab-level CPU Attribution (Closed)
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
Index: services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl.h
diff --git a/services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl.h b/services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..35523d879d20e02e2f429e3a1e33c9f9a1e7a8e1
--- /dev/null
+++ b/services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl.h
@@ -0,0 +1,45 @@
+// 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_WEB_CONTENTS_COORDINATION_UNIT_IMPL_H_
+#define SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_WEB_CONTENTS_COORDINATION_UNIT_IMPL_H_
+
+#include <stdint.h>
+
+#include <memory>
+#include <set>
+
+#include "base/macros.h"
+#include "services/resource_coordinator/coordination_unit/coordination_unit_impl.h"
+#include "services/resource_coordinator/public/interfaces/coordination_unit.mojom.h"
+
+namespace service_manager {
+class ServiceContextRef;
+}
+
+namespace resource_coordinator {
+
+struct CoordinationUnitID;
+
+class WebContentsCoordinationUnitImpl : public CoordinationUnitImpl {
+ public:
+ WebContentsCoordinationUnitImpl(
+ const CoordinationUnitID& id,
+ std::unique_ptr<service_manager::ServiceContextRef> service_ref);
+ ~WebContentsCoordinationUnitImpl() override;
+
+ // CoordinationUnitImpl implementation.
+ std::set<CoordinationUnitImpl*> GetAssociatedCoordinationUnitsOfType(
+ CoordinationUnitType type) override;
+ void RecalculateProperty(mojom::PropertyType property_type) override;
+
+ private:
+ double CalculateCPUUsage();
+
+ DISALLOW_COPY_AND_ASSIGN(WebContentsCoordinationUnitImpl);
+};
+
+} // namespace resource_coordinator
+
+#endif // SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_WEB_CONTENTS_COORDINATION_UNIT_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698