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

Side by Side Diff: components/history/core/browser/top_sites_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
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/top_sites_database.h" 5 #include "components/history/core/browser/top_sites_database.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 // .4% SQLITE_FULL 338 // .4% SQLITE_FULL
339 // nominal SQLITE_TOBIG, SQLITE_AUTH, and SQLITE_BUSY. In the case of 339 // nominal SQLITE_TOBIG, SQLITE_AUTH, and SQLITE_BUSY. In the case of
340 // thumbnail_database.cc, as soon as the recovery code landed, SQLITE_IOERR 340 // thumbnail_database.cc, as soon as the recovery code landed, SQLITE_IOERR
341 // shot to leadership. If the I/O error is system-level, there is probably no 341 // shot to leadership. If the I/O error is system-level, there is probably no
342 // hope, but if it is restricted to something about the database file, it is 342 // hope, but if it is restricted to something about the database file, it is
343 // possible that the recovery code could be brought to bear. In fact, it is 343 // possible that the recovery code could be brought to bear. In fact, it is
344 // possible that running recovery would be a reasonable default when errors 344 // possible that running recovery would be a reasonable default when errors
345 // are seen. 345 // are seen.
346 346
347 // The default handling is to assert on debug and to ignore on release. 347 // The default handling is to assert on debug and to ignore on release.
348 if (!sql::Connection::ShouldIgnoreSqliteError(extended_error)) 348 if (!sql::Connection::IsExpectedSqliteError(extended_error))
349 DLOG(FATAL) << db->GetErrorMessage(); 349 DLOG(FATAL) << db->GetErrorMessage();
350 } 350 }
351 351
352 } // namespace 352 } // namespace
353 353
354 // static 354 // static
355 const int TopSitesDatabase::kRankOfForcedURL = -1; 355 const int TopSitesDatabase::kRankOfForcedURL = -1;
356 356
357 // static 357 // static
358 const int TopSitesDatabase::kRankOfNonExistingURL = -2; 358 const int TopSitesDatabase::kRankOfNonExistingURL = -2;
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 db->set_error_callback(base::Bind(&DatabaseErrorCallback, db.get(), db_name)); 726 db->set_error_callback(base::Bind(&DatabaseErrorCallback, db.get(), db_name));
727 db->set_page_size(4096); 727 db->set_page_size(4096);
728 db->set_cache_size(32); 728 db->set_cache_size(32);
729 729
730 if (!db->Open(db_name)) 730 if (!db->Open(db_name))
731 return NULL; 731 return NULL;
732 return db.release(); 732 return db.release();
733 } 733 }
734 734
735 } // namespace history 735 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698