| 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/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" |
| 13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 14 #include "chrome/common/chrome_constants.h" | 14 #include "chrome/common/chrome_constants.h" |
| 15 #include "chrome/common/chrome_paths.h" | 15 #include "chrome/common/chrome_paths.h" |
| 16 #include "content/public/common/content_constants.h" |
| 16 #include "sql/connection.h" | 17 #include "sql/connection.h" |
| 17 #include "sql/diagnostic_error_delegate.h" | 18 #include "sql/diagnostic_error_delegate.h" |
| 18 #include "sql/statement.h" | 19 #include "sql/statement.h" |
| 19 #include "third_party/sqlite/sqlite3.h" | 20 #include "third_party/sqlite/sqlite3.h" |
| 20 #include "webkit/appcache/appcache_interfaces.h" | 21 #include "webkit/appcache/appcache_interfaces.h" |
| 21 #include "webkit/database/database_tracker.h" | 22 #include "webkit/database/database_tracker.h" |
| 22 | 23 |
| 23 namespace { | 24 namespace { |
| 24 | 25 |
| 25 // Generic diagnostic test class for checking sqlite db integrity. | 26 // Generic diagnostic test class for checking sqlite db integrity. |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 return new SqliteIntegrityTest(false, ASCIIToUTF16("Archived History DB"), | 146 return new SqliteIntegrityTest(false, ASCIIToUTF16("Archived History DB"), |
| 146 FilePath(chrome::kArchivedHistoryFilename)); | 147 FilePath(chrome::kArchivedHistoryFilename)); |
| 147 } | 148 } |
| 148 | 149 |
| 149 DiagnosticTest* MakeSqliteThumbnailsDbTest() { | 150 DiagnosticTest* MakeSqliteThumbnailsDbTest() { |
| 150 return new SqliteIntegrityTest(false, ASCIIToUTF16("Thumbnails DB"), | 151 return new SqliteIntegrityTest(false, ASCIIToUTF16("Thumbnails DB"), |
| 151 FilePath(chrome::kThumbnailsFilename)); | 152 FilePath(chrome::kThumbnailsFilename)); |
| 152 } | 153 } |
| 153 | 154 |
| 154 DiagnosticTest* MakeSqliteAppCacheDbTest() { | 155 DiagnosticTest* MakeSqliteAppCacheDbTest() { |
| 155 FilePath appcache_dir(chrome::kAppCacheDirname); | 156 FilePath appcache_dir(content::kAppCacheDirname); |
| 156 FilePath appcache_db = appcache_dir.Append(appcache::kAppCacheDatabaseName); | 157 FilePath appcache_db = appcache_dir.Append(appcache::kAppCacheDatabaseName); |
| 157 return new SqliteIntegrityTest(false, ASCIIToUTF16("AppCache DB"), | 158 return new SqliteIntegrityTest(false, ASCIIToUTF16("AppCache DB"), |
| 158 appcache_db); | 159 appcache_db); |
| 159 } | 160 } |
| 160 | 161 |
| 161 DiagnosticTest* MakeSqliteWebDatabaseTrackerDbTest() { | 162 DiagnosticTest* MakeSqliteWebDatabaseTrackerDbTest() { |
| 162 FilePath databases_dir(webkit_database::kDatabaseDirectoryName); | 163 FilePath databases_dir(webkit_database::kDatabaseDirectoryName); |
| 163 FilePath tracker_db = | 164 FilePath tracker_db = |
| 164 databases_dir.Append(webkit_database::kTrackerDatabaseFileName); | 165 databases_dir.Append(webkit_database::kTrackerDatabaseFileName); |
| 165 return new SqliteIntegrityTest(false, ASCIIToUTF16("DatabaseTracker DB"), | 166 return new SqliteIntegrityTest(false, ASCIIToUTF16("DatabaseTracker DB"), |
| 166 tracker_db); | 167 tracker_db); |
| 167 } | 168 } |
| OLD | NEW |