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 #include "components/arc/metrics/arc_metrics_service.h" | 5 #include "components/arc/metrics/arc_metrics_service.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 | 10 |
11 namespace { | 11 namespace { |
12 | 12 |
13 const int kRequestProcessListPeriodInMinutes = 5; | 13 const int kRequestProcessListPeriodInMinutes = 5; |
14 const char kArcProcessNamePrefix[] = "org.chromium.arc."; | 14 const char kArcProcessNamePrefix[] = "org.chromium.arc."; |
15 const char kGmsProcessNamePrefix[] = "com.google.android.gms"; | 15 const char kGmsProcessNamePrefix[] = "com.google.android.gms"; |
16 | 16 |
17 } // namespace | 17 } // namespace |
18 | 18 |
19 namespace arc { | 19 namespace arc { |
20 | 20 |
21 ArcMetricsService::ArcMetricsService(ArcBridgeService* bridge_service) | 21 ArcMetricsService::ArcMetricsService(ArcBridgeService* bridge_service) |
22 : ArcService(bridge_service), weak_ptr_factory_(this) { | 22 : ArcService(bridge_service), weak_ptr_factory_(this) { |
23 arc_bridge_service()->AddObserver(this); | 23 arc_bridge_service()->AddObserver(this); |
| 24 low_memory_killer_minotor_.Start(); |
24 } | 25 } |
25 | 26 |
26 ArcMetricsService::~ArcMetricsService() { | 27 ArcMetricsService::~ArcMetricsService() { |
27 DCHECK(CalledOnValidThread()); | 28 DCHECK(CalledOnValidThread()); |
28 arc_bridge_service()->RemoveObserver(this); | 29 arc_bridge_service()->RemoveObserver(this); |
29 } | 30 } |
30 | 31 |
31 bool ArcMetricsService::CalledOnValidThread() { | 32 bool ArcMetricsService::CalledOnValidThread() { |
32 // Make sure access to the Chrome clipboard is happening in the UI thread. | 33 // Make sure access to the Chrome clipboard is happening in the UI thread. |
33 return thread_checker_.CalledOnValidThread(); | 34 return thread_checker_.CalledOnValidThread(); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 VLOG(2) << "Skipped " << process_name << " " << process_state; | 82 VLOG(2) << "Skipped " << process_name << " " << process_state; |
82 } else { | 83 } else { |
83 ++running_app_count; | 84 ++running_app_count; |
84 } | 85 } |
85 } | 86 } |
86 | 87 |
87 UMA_HISTOGRAM_COUNTS_100("Arc.AppCount", running_app_count); | 88 UMA_HISTOGRAM_COUNTS_100("Arc.AppCount", running_app_count); |
88 } | 89 } |
89 | 90 |
90 } // namespace arc | 91 } // namespace arc |
OLD | NEW |