From 69e37209b3c28dec5fe7ac0bcfcfdec61ef64023 Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Wed, 16 Jun 2010 17:55:31 -0700 Subject: [PATCH] TBR: Adding petkov's patch committed today in other repo --- crash_reporter/crash_reporter.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crash_reporter/crash_reporter.cc b/crash_reporter/crash_reporter.cc index 951d3fae3..e283322da 100644 --- a/crash_reporter/crash_reporter.cc +++ b/crash_reporter/crash_reporter.cc @@ -77,6 +77,18 @@ static void CountUserCrash() { s_metrics_lib.SendEnumToUMA(std::string(kCrashCounterHistogram), CRASH_KIND_USER, CRASH_KIND_MAX); + + // Announce through D-Bus whenever a user crash happens. This is + // used by the metrics daemon to log active use time between + // crashes. + // + // This could be done more efficiently by explicit fork/exec or + // using a dbus library directly. However, this should run + // relatively rarely and longer term we may need to implement a + // better way to do this that doesn't rely on D-Bus. + int status __attribute__((unused)) = + system("/usr/bin/dbus-send --type=signal --system / " + "org.chromium.CrashReporter.UserCrash"); } int main(int argc, char *argv[]) {