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

Unified Diff: chrome/browser/diagnostics/recon_diagnostics.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
« no previous file with comments | « chrome/browser/diagnostics/recon_diagnostics.h ('k') | chrome/browser/diagnostics/sqlite_diagnostics.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/diagnostics/recon_diagnostics.cc
diff --git a/chrome/browser/diagnostics/recon_diagnostics.cc b/chrome/browser/diagnostics/recon_diagnostics.cc
index 059d6fc0009ccd47fc514b3c3fef9f85687a7f95..2761f7ce9fdef94fd6e824709e4cfa2ecb404c37 100644
--- a/chrome/browser/diagnostics/recon_diagnostics.cc
+++ b/chrome/browser/diagnostics/recon_diagnostics.cc
@@ -325,15 +325,32 @@ class DiskSpaceTest : public DiagnosticsTest {
// Checks that a given json file can be correctly parsed.
class JSONTest : public DiagnosticsTest {
public:
+ enum FileImportance {
+ NON_CRITICAL,
+ CRITICAL
+ };
+
JSONTest(const base::FilePath& path,
const std::string& id,
const std::string& name,
- int64 max_file_size)
- : DiagnosticsTest(id, name), path_(path), max_file_size_(max_file_size) {}
+ int64 max_file_size,
+ FileImportance importance)
+ : DiagnosticsTest(id, name),
+ path_(path),
+ max_file_size_(max_file_size),
+ importance_(importance) {}
virtual bool ExecuteImpl(DiagnosticsModel::Observer* observer) OVERRIDE {
if (!base::PathExists(path_)) {
- RecordFailure(DIAG_RECON_FILE_NOT_FOUND, "File not found");
+ if (importance_ == CRITICAL) {
+ RecordOutcome(DIAG_RECON_FILE_NOT_FOUND,
+ "File not found",
+ DiagnosticsModel::TEST_FAIL_CONTINUE);
+ } else {
+ RecordOutcome(DIAG_RECON_FILE_NOT_FOUND_OK,
+ "File not found (but that is OK)",
+ DiagnosticsModel::TEST_OK);
+ }
return true;
}
int64 file_size;
@@ -374,6 +391,7 @@ class JSONTest : public DiagnosticsTest {
private:
base::FilePath path_;
int64 max_file_size_;
+ FileImportance importance_;
DISALLOW_COPY_AND_ASSIGN(JSONTest);
};
@@ -406,23 +424,32 @@ DiagnosticsTest* MakeInstallTypeTest() { return new InstallTypeTest(); }
DiagnosticsTest* MakePreferencesTest() {
base::FilePath path = DiagnosticsTest::GetUserDefaultProfileDir();
path = path.Append(chrome::kPreferencesFilename);
- return new JSONTest(
- path, kJSONProfileTest, "Profile JSON", 100 * kOneKilobyte);
+ return new JSONTest(path,
+ kJSONProfileTest,
+ "Profile JSON",
+ 100 * kOneKilobyte,
+ JSONTest::CRITICAL);
}
DiagnosticsTest* MakeBookMarksTest() {
base::FilePath path = DiagnosticsTest::GetUserDefaultProfileDir();
path = path.Append(chrome::kBookmarksFileName);
- return new JSONTest(
- path, kJSONBookmarksTest, "Bookmarks JSON", 2 * kOneMegabyte);
+ return new JSONTest(path,
+ kJSONBookmarksTest,
+ "Bookmarks JSON",
+ 2 * kOneMegabyte,
+ JSONTest::NON_CRITICAL);
}
DiagnosticsTest* MakeLocalStateTest() {
base::FilePath path;
PathService::Get(chrome::DIR_USER_DATA, &path);
path = path.Append(chrome::kLocalStateFilename);
- return new JSONTest(
- path, kJSONLocalStateTest, "Local State JSON", 50 * kOneKilobyte);
+ return new JSONTest(path,
+ kJSONLocalStateTest,
+ "Local State JSON",
+ 50 * kOneKilobyte,
+ JSONTest::CRITICAL);
}
} // namespace diagnostics
« no previous file with comments | « chrome/browser/diagnostics/recon_diagnostics.h ('k') | chrome/browser/diagnostics/sqlite_diagnostics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698