OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/metrics/mobile_session_shutdown_metrics_provider.h" | 5 #include "ios/chrome/browser/metrics/mobile_session_shutdown_metrics_provider.h" |
6 | 6 |
7 #include <Foundation/Foundation.h> | 7 #include <Foundation/Foundation.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
11 #include "components/metrics/metrics_service.h" | 11 #include "components/metrics/metrics_service.h" |
12 #include "ios/chrome/browser/crash_report/breakpad_helper.h" | 12 #include "ios/chrome/browser/crash_report/breakpad_helper.h" |
13 #import "ios/chrome/browser/crash_report/crash_report_background_uploader.h" | 13 #import "ios/chrome/browser/crash_report/crash_report_background_uploader.h" |
14 #import "ios/chrome/browser/metrics/previous_session_info.h" | 14 #import "ios/chrome/browser/metrics/previous_session_info.h" |
15 | 15 |
| 16 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 17 #error "This file requires ARC support." |
| 18 #endif |
| 19 |
16 namespace { | 20 namespace { |
17 | 21 |
18 // Logs |type| in the shutdown type histogram. | 22 // Logs |type| in the shutdown type histogram. |
19 void LogShutdownType(MobileSessionShutdownType type) { | 23 void LogShutdownType(MobileSessionShutdownType type) { |
20 UMA_STABILITY_HISTOGRAM_ENUMERATION("Stability.MobileSessionShutdownType", | 24 UMA_STABILITY_HISTOGRAM_ENUMERATION("Stability.MobileSessionShutdownType", |
21 type, MOBILE_SESSION_SHUTDOWN_TYPE_COUNT); | 25 type, MOBILE_SESSION_SHUTDOWN_TYPE_COUNT); |
22 } | 26 } |
23 | 27 |
24 } // namespace | 28 } // namespace |
25 | 29 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 bool MobileSessionShutdownMetricsProvider:: | 87 bool MobileSessionShutdownMetricsProvider:: |
84 HasUploadedCrashReportsInBackground() { | 88 HasUploadedCrashReportsInBackground() { |
85 return [CrashReportBackgroundUploader hasUploadedCrashReportsInBackground]; | 89 return [CrashReportBackgroundUploader hasUploadedCrashReportsInBackground]; |
86 } | 90 } |
87 | 91 |
88 bool MobileSessionShutdownMetricsProvider:: | 92 bool MobileSessionShutdownMetricsProvider:: |
89 ReceivedMemoryWarningBeforeLastShutdown() { | 93 ReceivedMemoryWarningBeforeLastShutdown() { |
90 return [[PreviousSessionInfo sharedInstance] | 94 return [[PreviousSessionInfo sharedInstance] |
91 didSeeMemoryWarningShortlyBeforeTerminating]; | 95 didSeeMemoryWarningShortlyBeforeTerminating]; |
92 } | 96 } |
OLD | NEW |