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

Side by Side Diff: components/power/origin_power_map.h

Issue 666133002: Standardize usage of virtual/override/final in components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_POWER_ORIGIN_POWER_MAP_H_ 5 #ifndef COMPONENTS_POWER_ORIGIN_POWER_MAP_H_
6 #define COMPONENTS_POWER_ORIGIN_POWER_MAP_H_ 6 #define COMPONENTS_POWER_ORIGIN_POWER_MAP_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/callback_list.h" 10 #include "base/callback_list.h"
11 #include "components/keyed_service/core/keyed_service.h" 11 #include "components/keyed_service/core/keyed_service.h"
12 #include "url/gurl.h" 12 #include "url/gurl.h"
13 13
14 namespace power { 14 namespace power {
15 15
16 // Tracks app and website origins and how much power they are consuming while 16 // Tracks app and website origins and how much power they are consuming while
17 // running. 17 // running.
18 class OriginPowerMap : public KeyedService { 18 class OriginPowerMap : public KeyedService {
19 public: 19 public:
20 typedef std::map<GURL, int> PercentOriginMap; 20 typedef std::map<GURL, int> PercentOriginMap;
21 typedef base::CallbackList<void(void)>::Subscription Subscription; 21 typedef base::CallbackList<void(void)>::Subscription Subscription;
22 22
23 OriginPowerMap(); 23 OriginPowerMap();
24 virtual ~OriginPowerMap(); 24 ~OriginPowerMap() override;
25 25
26 // Returns the integer percentage usage of the total power consumed by a 26 // Returns the integer percentage usage of the total power consumed by a
27 // given URL's origin. 27 // given URL's origin.
28 int GetPowerForOrigin(const GURL& url); 28 int GetPowerForOrigin(const GURL& url);
29 29
30 // Adds a certain amount of power consumption to a given URL's origin. 30 // Adds a certain amount of power consumption to a given URL's origin.
31 // |power| is a platform-specific heuristic estimating power consumption. 31 // |power| is a platform-specific heuristic estimating power consumption.
32 void AddPowerForOrigin(const GURL& url, double power); 32 void AddPowerForOrigin(const GURL& url, double power);
33 33
34 // Returns a map of all origins to the integer percentage usage of power 34 // Returns a map of all origins to the integer percentage usage of power
(...skipping 22 matching lines...) Expand all
57 double total_consumed_; 57 double total_consumed_;
58 58
59 base::CallbackList<void(void)> callback_list_; 59 base::CallbackList<void(void)> callback_list_;
60 60
61 DISALLOW_COPY_AND_ASSIGN(OriginPowerMap); 61 DISALLOW_COPY_AND_ASSIGN(OriginPowerMap);
62 }; 62 };
63 63
64 } // namespace power 64 } // namespace power
65 65
66 #endif // COMPONENTS_POWER_ORIGIN_POWER_MAP_H_ 66 #endif // COMPONENTS_POWER_ORIGIN_POWER_MAP_H_
OLDNEW
« no previous file with comments | « components/policy/core/common/schema_registry.h ('k') | components/power/origin_power_map_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698