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