OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_ARC_METRICS_ARC_METRICS_SERVICE_H | 5 #ifndef COMPONENTS_ARC_METRICS_ARC_METRICS_SERVICE_H |
6 #define COMPONENTS_ARC_METRICS_ARC_METRICS_SERVICE_H | 6 #define COMPONENTS_ARC_METRICS_ARC_METRICS_SERVICE_H |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | |
9 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
10 #include "base/threading/thread_checker.h" | 11 #include "base/threading/thread_checker.h" |
11 #include "base/timer/timer.h" | 12 #include "base/timer/timer.h" |
12 #include "components/arc/arc_bridge_service.h" | 13 #include "components/arc/arc_bridge_service.h" |
13 #include "components/arc/arc_service.h" | 14 #include "components/arc/arc_service.h" |
14 #include "components/arc/common/arc_bridge.mojom.h" | 15 #include "components/arc/common/arc_bridge.mojom.h" |
15 | 16 |
16 namespace arc { | 17 namespace arc { |
17 | 18 |
19 class ArcLowMemoryKillerMonitor; | |
20 | |
18 // Collects information from other ArcServices and send UMA metrics. | 21 // Collects information from other ArcServices and send UMA metrics. |
19 class ArcMetricsService : public ArcService, | 22 class ArcMetricsService : public ArcService, |
20 public ArcBridgeService::Observer { | 23 public ArcBridgeService::Observer { |
21 public: | 24 public: |
22 explicit ArcMetricsService(ArcBridgeService* bridge_service); | 25 explicit ArcMetricsService(ArcBridgeService* bridge_service); |
23 ~ArcMetricsService() override; | 26 ~ArcMetricsService() override; |
24 | 27 |
25 // ArcBridgeService::Observer overrides. | 28 // ArcBridgeService::Observer overrides. |
26 void OnProcessInstanceReady() override; | 29 void OnProcessInstanceReady() override; |
27 void OnProcessInstanceClosed() override; | 30 void OnProcessInstanceClosed() override; |
28 | 31 |
29 private: | 32 private: |
30 bool CalledOnValidThread(); | 33 bool CalledOnValidThread(); |
31 void RequestProcessList(); | 34 void RequestProcessList(); |
32 void ParseProcessList(mojo::Array<arc::RunningAppProcessInfoPtr> processes); | 35 void ParseProcessList(mojo::Array<arc::RunningAppProcessInfoPtr> processes); |
33 | 36 |
34 base::ThreadChecker thread_checker_; | 37 base::ThreadChecker thread_checker_; |
35 base::RepeatingTimer timer_; | 38 base::RepeatingTimer timer_; |
36 | 39 |
40 scoped_ptr<ArcLowMemoryKillerMonitor> low_memory_killer_minotor_; | |
hidehiko
2016/03/24 08:11:21
You just can use ArcLowMemoryKillerMonitor directl
cylee1
2016/03/24 14:36:07
Done.
| |
41 | |
37 // Always keep this the last member of this class to make sure it's the | 42 // Always keep this the last member of this class to make sure it's the |
38 // first thing to be destructed. | 43 // first thing to be destructed. |
39 base::WeakPtrFactory<ArcMetricsService> weak_ptr_factory_; | 44 base::WeakPtrFactory<ArcMetricsService> weak_ptr_factory_; |
40 | 45 |
41 DISALLOW_COPY_AND_ASSIGN(ArcMetricsService); | 46 DISALLOW_COPY_AND_ASSIGN(ArcMetricsService); |
42 }; | 47 }; |
43 | 48 |
44 } // namespace arc | 49 } // namespace arc |
45 | 50 |
46 #endif // COMPONENTS_ARC_METRICS_ARC_METRICS_SERVICE_H | 51 #endif // COMPONENTS_ARC_METRICS_ARC_METRICS_SERVICE_H |
hidehiko
2016/03/24 08:11:21
unnecessary trailing white space.
cylee1
2016/03/24 14:36:06
There's no trailing white space?
#endif<space><spa
cylee1
2016/03/24 14:39:22
Ah I know what happens. The original file doesn't
| |
OLD | NEW |