Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Side by Side Diff: components/history/core/browser/thumbnail_database.cc

Issue 1991503002: [sql] sql::ScopedErrorIgnorer rename to sql::test::ScopedErrorExpecter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/history/core/browser/thumbnail_database_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | components/history/core/browser/thumbnail_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698