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

Side by Side Diff: components/arc/metrics/arc_metrics_service.h

Issue 1828533002: Enable UMA histogram logger for low memor kill events in ArcMetricsService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix NaClBrowserTest Created 4 years, 9 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 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/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/threading/thread_checker.h" 10 #include "base/threading/thread_checker.h"
11 #include "base/timer/timer.h" 11 #include "base/timer/timer.h"
12 #include "components/arc/arc_bridge_service.h" 12 #include "components/arc/arc_bridge_service.h"
13 #include "components/arc/arc_service.h" 13 #include "components/arc/arc_service.h"
14 #include "components/arc/common/arc_bridge.mojom.h" 14 #include "components/arc/common/arc_bridge.mojom.h"
15 #include "components/arc/metrics/arc_low_memory_killer_monitor.h"
15 16
16 namespace arc { 17 namespace arc {
17 18
18 // Collects information from other ArcServices and send UMA metrics. 19 // Collects information from other ArcServices and send UMA metrics.
19 class ArcMetricsService : public ArcService, 20 class ArcMetricsService : public ArcService,
20 public ArcBridgeService::Observer { 21 public ArcBridgeService::Observer {
21 public: 22 public:
22 explicit ArcMetricsService(ArcBridgeService* bridge_service); 23 explicit ArcMetricsService(ArcBridgeService* bridge_service);
23 ~ArcMetricsService() override; 24 ~ArcMetricsService() override;
24 25
25 // ArcBridgeService::Observer overrides. 26 // ArcBridgeService::Observer overrides.
26 void OnProcessInstanceReady() override; 27 void OnProcessInstanceReady() override;
27 void OnProcessInstanceClosed() override; 28 void OnProcessInstanceClosed() override;
28 29
29 private: 30 private:
30 bool CalledOnValidThread(); 31 bool CalledOnValidThread();
31 void RequestProcessList(); 32 void RequestProcessList();
32 void ParseProcessList(mojo::Array<arc::RunningAppProcessInfoPtr> processes); 33 void ParseProcessList(mojo::Array<arc::RunningAppProcessInfoPtr> processes);
33 34
34 base::ThreadChecker thread_checker_; 35 base::ThreadChecker thread_checker_;
35 base::RepeatingTimer timer_; 36 base::RepeatingTimer timer_;
36 37
38 ArcLowMemoryKillerMonitor low_memory_killer_minotor_;
39
37 // Always keep this the last member of this class to make sure it's the 40 // Always keep this the last member of this class to make sure it's the
38 // first thing to be destructed. 41 // first thing to be destructed.
39 base::WeakPtrFactory<ArcMetricsService> weak_ptr_factory_; 42 base::WeakPtrFactory<ArcMetricsService> weak_ptr_factory_;
40 43
41 DISALLOW_COPY_AND_ASSIGN(ArcMetricsService); 44 DISALLOW_COPY_AND_ASSIGN(ArcMetricsService);
42 }; 45 };
43 46
44 } // namespace arc 47 } // namespace arc
45 48
46 #endif // COMPONENTS_ARC_METRICS_ARC_METRICS_SERVICE_H 49 #endif // COMPONENTS_ARC_METRICS_ARC_METRICS_SERVICE_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698