| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "app/sql/connection.h" | |
| 8 #include "app/sql/diagnostic_error_delegate.h" | |
| 9 #include "app/sql/statement.h" | |
| 10 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 11 #include "base/logging.h" | 8 #include "base/logging.h" |
| 12 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 13 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 14 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 15 #include "base/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" |
| 16 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 17 #include "chrome/common/chrome_constants.h" | 14 #include "chrome/common/chrome_constants.h" |
| 18 #include "chrome/common/chrome_paths.h" | 15 #include "chrome/common/chrome_paths.h" |
| 16 #include "sql/connection.h" |
| 17 #include "sql/diagnostic_error_delegate.h" |
| 18 #include "sql/statement.h" |
| 19 #include "third_party/sqlite/sqlite3.h" | 19 #include "third_party/sqlite/sqlite3.h" |
| 20 #include "webkit/appcache/appcache_interfaces.h" | 20 #include "webkit/appcache/appcache_interfaces.h" |
| 21 #include "webkit/database/database_tracker.h" | 21 #include "webkit/database/database_tracker.h" |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 // Generic diagnostic test class for checking sqlite db integrity. | 25 // Generic diagnostic test class for checking sqlite db integrity. |
| 26 class SqliteIntegrityTest : public DiagnosticTest { | 26 class SqliteIntegrityTest : public DiagnosticTest { |
| 27 public: | 27 public: |
| 28 SqliteIntegrityTest(bool critical, const string16& title, | 28 SqliteIntegrityTest(bool critical, const string16& title, |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 appcache_db); | 158 appcache_db); |
| 159 } | 159 } |
| 160 | 160 |
| 161 DiagnosticTest* MakeSqliteWebDatabaseTrackerDbTest() { | 161 DiagnosticTest* MakeSqliteWebDatabaseTrackerDbTest() { |
| 162 FilePath databases_dir(webkit_database::kDatabaseDirectoryName); | 162 FilePath databases_dir(webkit_database::kDatabaseDirectoryName); |
| 163 FilePath tracker_db = | 163 FilePath tracker_db = |
| 164 databases_dir.Append(webkit_database::kTrackerDatabaseFileName); | 164 databases_dir.Append(webkit_database::kTrackerDatabaseFileName); |
| 165 return new SqliteIntegrityTest(false, ASCIIToUTF16("DatabaseTracker DB"), | 165 return new SqliteIntegrityTest(false, ASCIIToUTF16("DatabaseTracker DB"), |
| 166 tracker_db); | 166 tracker_db); |
| 167 } | 167 } |
| OLD | NEW |