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

Unified Diff: sql/connection.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sql/connection.h ('k') | sql/connection_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/connection.cc
diff --git a/sql/connection.cc b/sql/connection.cc
index 5900e891f977c3ce9edbde044eacff4510263c64..f748449f5f731a29517a5c25efab6585c4277158 100644
--- a/sql/connection.cc
+++ b/sql/connection.cc
@@ -230,13 +230,13 @@ std::string AsUTF8ForSQL(const base::FilePath& path) {
namespace sql {
// static
-Connection::ErrorIgnorerCallback* Connection::current_ignorer_cb_ = NULL;
+Connection::ErrorExpecterCallback* Connection::current_expecter_cb_ = NULL;
// static
-bool Connection::ShouldIgnoreSqliteError(int error) {
- if (!current_ignorer_cb_)
+bool Connection::IsExpectedSqliteError(int error) {
+ if (!current_expecter_cb_)
return false;
- return current_ignorer_cb_->Run(error);
+ return current_expecter_cb_->Run(error);
}
void Connection::ReportDiagnosticInfo(int extended_error, Statement* stmt) {
@@ -268,15 +268,15 @@ void Connection::ReportDiagnosticInfo(int extended_error, Statement* stmt) {
}
// static
-void Connection::SetErrorIgnorer(Connection::ErrorIgnorerCallback* cb) {
- CHECK(current_ignorer_cb_ == NULL);
- current_ignorer_cb_ = cb;
+void Connection::SetErrorExpecter(Connection::ErrorExpecterCallback* cb) {
+ CHECK(current_expecter_cb_ == NULL);
+ current_expecter_cb_ = cb;
}
// static
-void Connection::ResetErrorIgnorer() {
- CHECK(current_ignorer_cb_);
- current_ignorer_cb_ = NULL;
+void Connection::ResetErrorExpecter() {
+ CHECK(current_expecter_cb_);
+ current_expecter_cb_ = NULL;
}
bool StatementID::operator<(const StatementID& other) const {
@@ -1529,8 +1529,8 @@ bool Connection::DoesTableOrIndexExist(
"SELECT name FROM sqlite_master WHERE type=? AND name=? COLLATE NOCASE";
Statement statement(GetUntrackedStatement(kSql));
- // This can happen if the database is corrupt and the error is being ignored
- // for testing purposes.
+ // This can happen if the database is corrupt and the error is a test
+ // expectation.
if (!statement.is_valid())
return false;
@@ -1548,8 +1548,8 @@ bool Connection::DoesColumnExist(const char* table_name,
Statement statement(GetUntrackedStatement(sql.c_str()));
- // This can happen if the database is corrupt and the error is being ignored
- // for testing purposes.
+ // This can happen if the database is corrupt and the error is a test
+ // expectation.
if (!statement.is_valid())
return false;
@@ -1902,7 +1902,7 @@ int Connection::OnSqliteError(
}
// The default handling is to assert on debug and to ignore on release.
- if (!ShouldIgnoreSqliteError(err))
+ if (!IsExpectedSqliteError(err))
DLOG(FATAL) << GetErrorMessage();
return err;
}
« no previous file with comments | « sql/connection.h ('k') | sql/connection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698