| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/diagnostics/diagnostics_controller.h" | 5 #include "chrome/browser/diagnostics/diagnostics_controller.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // we have a common denominator. | 51 // we have a common denominator. |
| 52 for (int i = 0; i < DIAGNOSTICS_TEST_ID_COUNT; ++i) { | 52 for (int i = 0; i < DIAGNOSTICS_TEST_ID_COUNT; ++i) { |
| 53 RecordUMARecoveryResult(static_cast<DiagnosticsTestId>(i), RESULT_NOT_RUN); | 53 RecordUMARecoveryResult(static_cast<DiagnosticsTestId>(i), RESULT_NOT_RUN); |
| 54 RecordUMATestResult(static_cast<DiagnosticsTestId>(i), RESULT_NOT_RUN); | 54 RecordUMATestResult(static_cast<DiagnosticsTestId>(i), RESULT_NOT_RUN); |
| 55 } | 55 } |
| 56 #endif | 56 #endif |
| 57 } | 57 } |
| 58 | 58 |
| 59 // This entry point is called from early in startup when very few things have | 59 // This entry point is called from early in startup when very few things have |
| 60 // been initialized, so be careful what you use. | 60 // been initialized, so be careful what you use. |
| 61 int DiagnosticsController::Run(const CommandLine& command_line, | 61 int DiagnosticsController::Run(const base::CommandLine& command_line, |
| 62 DiagnosticsWriter* writer) { | 62 DiagnosticsWriter* writer) { |
| 63 writer_ = writer; | 63 writer_ = writer; |
| 64 | 64 |
| 65 model_.reset(MakeDiagnosticsModel(command_line)); | 65 model_.reset(MakeDiagnosticsModel(command_line)); |
| 66 model_->RunAll(writer_); | 66 model_->RunAll(writer_); |
| 67 | 67 |
| 68 return 0; | 68 return 0; |
| 69 } | 69 } |
| 70 | 70 |
| 71 // This entry point is called from early in startup when very few things have | 71 // This entry point is called from early in startup when very few things have |
| 72 // been initialized, so be careful what you use. | 72 // been initialized, so be careful what you use. |
| 73 int DiagnosticsController::RunRecovery(const CommandLine& command_line, | 73 int DiagnosticsController::RunRecovery(const base::CommandLine& command_line, |
| 74 DiagnosticsWriter* writer) { | 74 DiagnosticsWriter* writer) { |
| 75 // Separate out recoveries that we execute automatically as a result of a | 75 // Separate out recoveries that we execute automatically as a result of a |
| 76 // crash from user-run recoveries. | 76 // crash from user-run recoveries. |
| 77 #if defined(OS_CHROMEOS) // Only collecting UMA stats on ChromeOS | 77 #if defined(OS_CHROMEOS) // Only collecting UMA stats on ChromeOS |
| 78 if (command_line.HasSwitch(chromeos::switches::kLoginUser)) { | 78 if (command_line.HasSwitch(chromeos::switches::kLoginUser)) { |
| 79 UMA_HISTOGRAM_ENUMERATION("Diagnostics.RecoveryRun", | 79 UMA_HISTOGRAM_ENUMERATION("Diagnostics.RecoveryRun", |
| 80 diagnostics::RECOVERY_CRASH_RUN, | 80 diagnostics::RECOVERY_CRASH_RUN, |
| 81 diagnostics::RECOVERY_RUN_METRICS_COUNT); | 81 diagnostics::RECOVERY_RUN_METRICS_COUNT); |
| 82 } else { | 82 } else { |
| 83 UMA_HISTOGRAM_ENUMERATION("Diagnostics.RecoveryRun", | 83 UMA_HISTOGRAM_ENUMERATION("Diagnostics.RecoveryRun", |
| (...skipping 10 matching lines...) Expand all Loading... |
| 94 return -1; | 94 return -1; |
| 95 } | 95 } |
| 96 | 96 |
| 97 writer_ = writer; | 97 writer_ = writer; |
| 98 | 98 |
| 99 model_->RecoverAll(writer_); | 99 model_->RecoverAll(writer_); |
| 100 return 0; | 100 return 0; |
| 101 } | 101 } |
| 102 | 102 |
| 103 } // namespace diagnostics | 103 } // namespace diagnostics |
| OLD | NEW |