OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/sqlite_diagnostics.h" | 5 #include "chrome/browser/diagnostics/sqlite_diagnostics.h" |
6 | 6 |
7 #include "base/base_paths.h" | |
8 #include "base/file_util.h" | 7 #include "base/file_util.h" |
9 #include "base/logging.h" | 8 #include "base/logging.h" |
10 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
11 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
12 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
13 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
14 #include "base/path_service.h" | 13 #include "base/path_service.h" |
15 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
16 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
17 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 } | 233 } |
235 | 234 |
236 DiagnosticsTest* MakeSqliteHistoryDbTest() { | 235 DiagnosticsTest* MakeSqliteHistoryDbTest() { |
237 return new SqliteIntegrityTest(SqliteIntegrityTest::CRITICAL, | 236 return new SqliteIntegrityTest(SqliteIntegrityTest::CRITICAL, |
238 DIAGNOSTICS_SQLITE_INTEGRITY_HISTORY_TEST, | 237 DIAGNOSTICS_SQLITE_INTEGRITY_HISTORY_TEST, |
239 base::FilePath(chrome::kHistoryFilename)); | 238 base::FilePath(chrome::kHistoryFilename)); |
240 } | 239 } |
241 | 240 |
242 #if defined(OS_CHROMEOS) | 241 #if defined(OS_CHROMEOS) |
243 DiagnosticsTest* MakeSqliteNssCertDbTest() { | 242 DiagnosticsTest* MakeSqliteNssCertDbTest() { |
244 base::FilePath home_dir; | 243 base::FilePath home_dir = base::GetHomeDir(); |
245 PathService::Get(base::DIR_HOME, &home_dir); | |
246 return new SqliteIntegrityTest(SqliteIntegrityTest::REMOVE_IF_CORRUPT, | 244 return new SqliteIntegrityTest(SqliteIntegrityTest::REMOVE_IF_CORRUPT, |
247 DIAGNOSTICS_SQLITE_INTEGRITY_NSS_CERT_TEST, | 245 DIAGNOSTICS_SQLITE_INTEGRITY_NSS_CERT_TEST, |
248 home_dir.Append(chromeos::kNssCertDbPath)); | 246 home_dir.Append(chromeos::kNssCertDbPath)); |
249 } | 247 } |
250 | 248 |
251 DiagnosticsTest* MakeSqliteNssKeyDbTest() { | 249 DiagnosticsTest* MakeSqliteNssKeyDbTest() { |
252 base::FilePath home_dir; | 250 base::FilePath home_dir = base::GetHomeDir(); |
253 PathService::Get(base::DIR_HOME, &home_dir); | |
254 return new SqliteIntegrityTest(SqliteIntegrityTest::REMOVE_IF_CORRUPT, | 251 return new SqliteIntegrityTest(SqliteIntegrityTest::REMOVE_IF_CORRUPT, |
255 DIAGNOSTICS_SQLITE_INTEGRITY_NSS_KEY_TEST, | 252 DIAGNOSTICS_SQLITE_INTEGRITY_NSS_KEY_TEST, |
256 home_dir.Append(chromeos::kNssKeyDbPath)); | 253 home_dir.Append(chromeos::kNssKeyDbPath)); |
257 } | 254 } |
258 #endif // defined(OS_CHROMEOS) | 255 #endif // defined(OS_CHROMEOS) |
259 | 256 |
260 DiagnosticsTest* MakeSqliteThumbnailsDbTest() { | 257 DiagnosticsTest* MakeSqliteThumbnailsDbTest() { |
261 return new SqliteIntegrityTest(SqliteIntegrityTest::NO_FLAGS_SET, | 258 return new SqliteIntegrityTest(SqliteIntegrityTest::NO_FLAGS_SET, |
262 DIAGNOSTICS_SQLITE_INTEGRITY_THUMBNAILS_TEST, | 259 DIAGNOSTICS_SQLITE_INTEGRITY_THUMBNAILS_TEST, |
263 base::FilePath(chrome::kThumbnailsFilename)); | 260 base::FilePath(chrome::kThumbnailsFilename)); |
264 } | 261 } |
265 | 262 |
266 DiagnosticsTest* MakeSqliteWebDataDbTest() { | 263 DiagnosticsTest* MakeSqliteWebDataDbTest() { |
267 return new SqliteIntegrityTest(SqliteIntegrityTest::CRITICAL, | 264 return new SqliteIntegrityTest(SqliteIntegrityTest::CRITICAL, |
268 DIAGNOSTICS_SQLITE_INTEGRITY_WEB_DATA_TEST, | 265 DIAGNOSTICS_SQLITE_INTEGRITY_WEB_DATA_TEST, |
269 base::FilePath(kWebDataFilename)); | 266 base::FilePath(kWebDataFilename)); |
270 } | 267 } |
271 | 268 |
272 } // namespace diagnostics | 269 } // namespace diagnostics |
OLD | NEW |