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

Unified Diff: chrome/browser/diagnostics/diagnostics_controller.cc

Issue 16948012: This adds a recovery mode to the diagnostics (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Upload after merge Created 7 years, 4 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
Index: chrome/browser/diagnostics/diagnostics_controller.cc
diff --git a/chrome/browser/diagnostics/diagnostics_controller.cc b/chrome/browser/diagnostics/diagnostics_controller.cc
index a578beb2fd2994177790f063671894fd26d97784..76bf7c97eb331311f229314fff14a3ddf62712ab 100644
--- a/chrome/browser/diagnostics/diagnostics_controller.cc
+++ b/chrome/browser/diagnostics/diagnostics_controller.cc
@@ -34,8 +34,8 @@ bool DiagnosticsController::HasResults() {
void DiagnosticsController::ClearResults() { model_.reset(); }
-// This entry point is called from ChromeMain() when very few things
-// have been initialized, so be careful what you use.
+// This entry point is called from early in startup when very few things have
+// been initialized, so be careful what you use.
int DiagnosticsController::Run(const CommandLine& command_line,
DiagnosticsWriter* writer) {
writer_ = writer;
@@ -46,4 +46,22 @@ int DiagnosticsController::Run(const CommandLine& command_line,
return 0;
}
+// This entry point is called from early in startup when very few things have
+// been initialized, so be careful what you use.
+int DiagnosticsController::RunRecovery(const CommandLine& command_line,
+ DiagnosticsWriter* writer) {
+ if (!HasResults()) {
+ if (writer) {
+ writer->WriteInfoLine("No diagnostics have been run.");
+ writer->OnAllRecoveryDone(model_.get());
+ }
+ return -1;
+ }
+
+ writer_ = writer;
+
+ model_->RecoverAll(writer_);
+ return 0;
+}
+
} // namespace diagnostics
« no previous file with comments | « chrome/browser/diagnostics/diagnostics_controller.h ('k') | chrome/browser/diagnostics/diagnostics_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698