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

Unified Diff: src/platform/crash/crash_reporter.cc

Issue 2037011: Remove the deprecated static metrics APIs. (Closed) Base URL: ssh://git@chromiumos-git/chromeos
Patch Set: Created 10 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/platform/metrics/README » ('j') | src/platform/metrics/metrics_library.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/crash/crash_reporter.cc
diff --git a/src/platform/crash/crash_reporter.cc b/src/platform/crash/crash_reporter.cc
index 234ab830834fe20a6f73784b8cb5bce5a269bfe6..6a620d19232fbd39ccccf549337f706377cc774e 100644
--- a/src/platform/crash/crash_reporter.cc
+++ b/src/platform/crash/crash_reporter.cc
@@ -30,6 +30,7 @@ enum CrashKinds {
CRASH_KIND_MAX
};
+static MetricsLibrary s_metrics_lib;
static SystemLoggingImpl s_system_log;
static bool IsMetricsCollectionAllowed() {
@@ -46,9 +47,9 @@ static void CheckUncleanShutdown() {
}
s_system_log.LogWarning("Last shutdown was not clean");
if (IsMetricsCollectionAllowed()) {
- MetricsLibrary::SendEnumToChrome(std::string(kCrashCounterHistogram),
- CRASH_KIND_KERNEL,
- CRASH_KIND_MAX);
+ s_metrics_lib.SendEnumToUMA(std::string(kCrashCounterHistogram),
+ CRASH_KIND_KERNEL,
+ CRASH_KIND_MAX);
}
if (!file_util::Delete(unclean_file_path, false)) {
s_system_log.LogError("Failed to delete unclean shutdown file %s",
@@ -70,15 +71,16 @@ static void SignalCleanShutdown() {
static void CountUserCrash() {
CHECK(IsMetricsCollectionAllowed());
- MetricsLibrary::SendEnumToChrome(std::string(kCrashCounterHistogram),
- CRASH_KIND_USER,
- CRASH_KIND_MAX);
+ s_metrics_lib.SendEnumToUMA(std::string(kCrashCounterHistogram),
+ CRASH_KIND_USER,
+ CRASH_KIND_MAX);
}
int main(int argc, char *argv[]) {
google::ParseCommandLineFlags(&argc, &argv, true);
FilePath my_path(argv[0]);
file_util::AbsolutePath(&my_path);
+ s_metrics_lib.Init();
s_system_log.Initialize(my_path.BaseName().value().c_str());
UserCollector user_collector;
user_collector.Initialize(CountUserCrash,
« no previous file with comments | « no previous file | src/platform/metrics/README » ('j') | src/platform/metrics/metrics_library.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698