| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 kCrashKindUncleanShutdown = 1, | 36 kCrashKindUncleanShutdown = 1, |
| 37 kCrashKindUser = 2, | 37 kCrashKindUser = 2, |
| 38 kCrashKindKernel = 3, | 38 kCrashKindKernel = 3, |
| 39 kCrashKindMax | 39 kCrashKindMax |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 static MetricsLibrary s_metrics_lib; | 42 static MetricsLibrary s_metrics_lib; |
| 43 static SystemLoggingImpl s_system_log; | 43 static SystemLoggingImpl s_system_log; |
| 44 | 44 |
| 45 static bool IsFeedbackAllowed() { | 45 static bool IsFeedbackAllowed() { |
| 46 // Once crosbug.com/5814 is fixed, call the is opted in function | 46 return s_metrics_lib.AreMetricsEnabled(); |
| 47 // here. | |
| 48 return true; | |
| 49 } | 47 } |
| 50 | 48 |
| 51 static bool TouchFile(const FilePath &file_path) { | 49 static bool TouchFile(const FilePath &file_path) { |
| 52 return file_util::WriteFile(file_path, "", 0) == 0; | 50 return file_util::WriteFile(file_path, "", 0) == 0; |
| 53 } | 51 } |
| 54 | 52 |
| 55 static void CountKernelCrash() { | 53 static void CountKernelCrash() { |
| 56 s_metrics_lib.SendEnumToUMA(std::string(kCrashCounterHistogram), | 54 s_metrics_lib.SendEnumToUMA(std::string(kCrashCounterHistogram), |
| 57 kCrashKindKernel, | 55 kCrashKindKernel, |
| 58 kCrashKindMax); | 56 kCrashKindMax); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 } | 170 } |
| 173 | 171 |
| 174 if (FLAGS_clean_shutdown) { | 172 if (FLAGS_clean_shutdown) { |
| 175 unclean_shutdown_collector.Disable(); | 173 unclean_shutdown_collector.Disable(); |
| 176 user_collector.Disable(); | 174 user_collector.Disable(); |
| 177 return 0; | 175 return 0; |
| 178 } | 176 } |
| 179 | 177 |
| 180 return HandleUserCrash(&user_collector); | 178 return HandleUserCrash(&user_collector); |
| 181 } | 179 } |
| OLD | NEW |