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 "components/history/core/browser/thumbnail_database.h" | 5 #include "components/history/core/browser/thumbnail_database.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 | 426 |
427 // Attempt to recover corrupt databases. | 427 // Attempt to recover corrupt databases. |
428 int error = (extended_error & 0xFF); | 428 int error = (extended_error & 0xFF); |
429 if (error == SQLITE_CORRUPT || | 429 if (error == SQLITE_CORRUPT || |
430 error == SQLITE_CANTOPEN || | 430 error == SQLITE_CANTOPEN || |
431 error == SQLITE_NOTADB) { | 431 error == SQLITE_NOTADB) { |
432 RecoverDatabaseOrRaze(db, db_path); | 432 RecoverDatabaseOrRaze(db, db_path); |
433 } | 433 } |
434 | 434 |
435 // The default handling is to assert on debug and to ignore on release. | 435 // The default handling is to assert on debug and to ignore on release. |
436 if (!sql::Connection::ShouldIgnoreSqliteError(extended_error)) | 436 if (!sql::Connection::IsExpectedSqliteError(extended_error)) |
437 DLOG(FATAL) << db->GetErrorMessage(); | 437 DLOG(FATAL) << db->GetErrorMessage(); |
438 } | 438 } |
439 | 439 |
440 } // namespace | 440 } // namespace |
441 | 441 |
442 ThumbnailDatabase::IconMappingEnumerator::IconMappingEnumerator() { | 442 ThumbnailDatabase::IconMappingEnumerator::IconMappingEnumerator() { |
443 } | 443 } |
444 | 444 |
445 ThumbnailDatabase::IconMappingEnumerator::~IconMappingEnumerator() { | 445 ThumbnailDatabase::IconMappingEnumerator::~IconMappingEnumerator() { |
446 } | 446 } |
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1237 meta_table_.SetVersionNumber(8); | 1237 meta_table_.SetVersionNumber(8); |
1238 meta_table_.SetCompatibleVersionNumber(std::min(8, kCompatibleVersionNumber)); | 1238 meta_table_.SetCompatibleVersionNumber(std::min(8, kCompatibleVersionNumber)); |
1239 return true; | 1239 return true; |
1240 } | 1240 } |
1241 | 1241 |
1242 bool ThumbnailDatabase::IsFaviconDBStructureIncorrect() { | 1242 bool ThumbnailDatabase::IsFaviconDBStructureIncorrect() { |
1243 return !db_.IsSQLValid("SELECT id, url, icon_type FROM favicons"); | 1243 return !db_.IsSQLValid("SELECT id, url, icon_type FROM favicons"); |
1244 } | 1244 } |
1245 | 1245 |
1246 } // namespace history | 1246 } // namespace history |
OLD | NEW |