| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
| 13 #include "base/timer/timer.h" | 13 #include "base/timer/timer.h" |
| 14 #include "components/arc/arc_service.h" | 14 #include "components/arc/arc_service.h" |
| 15 #include "components/arc/common/metrics.mojom.h" | 15 #include "components/arc/common/metrics.mojom.h" |
| 16 #include "components/arc/common/process.mojom.h" | 16 #include "components/arc/common/process.mojom.h" |
| 17 #include "components/arc/instance_holder.h" | 17 #include "components/arc/instance_holder.h" |
| 18 #include "components/arc/metrics/oom_kills_monitor.h" | |
| 19 #include "mojo/public/cpp/bindings/binding.h" | 18 #include "mojo/public/cpp/bindings/binding.h" |
| 20 | 19 |
| 21 namespace arc { | 20 namespace arc { |
| 22 | 21 |
| 23 class ArcBridgeService; | 22 class ArcBridgeService; |
| 24 | 23 |
| 25 // Collects information from other ArcServices and send UMA metrics. | 24 // Collects information from other ArcServices and send UMA metrics. |
| 26 class ArcMetricsService | 25 class ArcMetricsService |
| 27 : public ArcService, | 26 : public ArcService, |
| 28 public InstanceHolder<mojom::MetricsInstance>::Observer, | 27 public InstanceHolder<mojom::MetricsInstance>::Observer, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 65 |
| 67 ArcMetricsService* arc_metrics_service_; | 66 ArcMetricsService* arc_metrics_service_; |
| 68 }; | 67 }; |
| 69 | 68 |
| 70 mojo::Binding<mojom::MetricsHost> binding_; | 69 mojo::Binding<mojom::MetricsHost> binding_; |
| 71 | 70 |
| 72 ProcessObserver process_observer_; | 71 ProcessObserver process_observer_; |
| 73 base::ThreadChecker thread_checker_; | 72 base::ThreadChecker thread_checker_; |
| 74 base::RepeatingTimer timer_; | 73 base::RepeatingTimer timer_; |
| 75 | 74 |
| 76 OomKillsMonitor::Handle oom_kills_monitor_handle_; | |
| 77 | |
| 78 base::TimeTicks arc_start_time_; | 75 base::TimeTicks arc_start_time_; |
| 79 | 76 |
| 80 // Always keep this the last member of this class to make sure it's the | 77 // Always keep this the last member of this class to make sure it's the |
| 81 // first thing to be destructed. | 78 // first thing to be destructed. |
| 82 base::WeakPtrFactory<ArcMetricsService> weak_ptr_factory_; | 79 base::WeakPtrFactory<ArcMetricsService> weak_ptr_factory_; |
| 83 | 80 |
| 84 DISALLOW_COPY_AND_ASSIGN(ArcMetricsService); | 81 DISALLOW_COPY_AND_ASSIGN(ArcMetricsService); |
| 85 }; | 82 }; |
| 86 | 83 |
| 87 } // namespace arc | 84 } // namespace arc |
| 88 | 85 |
| 89 #endif // COMPONENTS_ARC_METRICS_ARC_METRICS_SERVICE_H_ | 86 #endif // COMPONENTS_ARC_METRICS_ARC_METRICS_SERVICE_H_ |
| OLD | NEW |