| 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 <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 const char kBootProgressEnableScreen[] = "boot_progress_enable_screen"; | 22 const char kBootProgressEnableScreen[] = "boot_progress_enable_screen"; |
| 23 | 23 |
| 24 } // namespace | 24 } // namespace |
| 25 | 25 |
| 26 namespace arc { | 26 namespace arc { |
| 27 | 27 |
| 28 ArcMetricsService::ArcMetricsService(ArcBridgeService* bridge_service) | 28 ArcMetricsService::ArcMetricsService(ArcBridgeService* bridge_service) |
| 29 : ArcService(bridge_service), | 29 : ArcService(bridge_service), |
| 30 binding_(this), | 30 binding_(this), |
| 31 process_observer_(this), | 31 process_observer_(this), |
| 32 oom_kills_monitor_handle_(OomKillsMonitor::StartMonitoring()), | |
| 33 weak_ptr_factory_(this) { | 32 weak_ptr_factory_(this) { |
| 34 arc_bridge_service()->metrics()->AddObserver(this); | 33 arc_bridge_service()->metrics()->AddObserver(this); |
| 35 arc_bridge_service()->process()->AddObserver(&process_observer_); | 34 arc_bridge_service()->process()->AddObserver(&process_observer_); |
| 36 } | 35 } |
| 37 | 36 |
| 38 ArcMetricsService::~ArcMetricsService() { | 37 ArcMetricsService::~ArcMetricsService() { |
| 39 DCHECK(CalledOnValidThread()); | 38 DCHECK(CalledOnValidThread()); |
| 40 arc_bridge_service()->process()->RemoveObserver(&process_observer_); | 39 arc_bridge_service()->process()->RemoveObserver(&process_observer_); |
| 41 arc_bridge_service()->metrics()->RemoveObserver(this); | 40 arc_bridge_service()->metrics()->RemoveObserver(this); |
| 42 } | 41 } |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 168 |
| 170 void ArcMetricsService::ProcessObserver::OnInstanceReady() { | 169 void ArcMetricsService::ProcessObserver::OnInstanceReady() { |
| 171 arc_metrics_service_->OnProcessInstanceReady(); | 170 arc_metrics_service_->OnProcessInstanceReady(); |
| 172 } | 171 } |
| 173 | 172 |
| 174 void ArcMetricsService::ProcessObserver::OnInstanceClosed() { | 173 void ArcMetricsService::ProcessObserver::OnInstanceClosed() { |
| 175 arc_metrics_service_->OnProcessInstanceClosed(); | 174 arc_metrics_service_->OnProcessInstanceClosed(); |
| 176 } | 175 } |
| 177 | 176 |
| 178 } // namespace arc | 177 } // namespace arc |
| OLD | NEW |