Commit 3dcd3bc9 authored by Adrienne Walker's avatar Adrienne Walker Committed by Commit Bot

indexeddb: Remove _UNTESTED macro suffix

There are plenty of bits of code that aren't tested in Chrome, and we
don't need to specifically call these out.  The bug to remove these has
been open for six years, and so the time has come to just remove these
macros.

Bug: 380416
Change-Id: I9d8e4641d074763649fa600ef9c7411e64b961de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2477238
Commit-Queue: enne <enne@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Auto-Submit: enne <enne@chromium.org>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817699}
parent a5d503d2
......@@ -303,7 +303,7 @@ Status SetMaxObjectStoreId(TransactionalLevelDBTransaction* transaction,
DCHECK_GE(max_object_store_id, 0);
if (!s.ok()) {
INTERNAL_READ_ERROR_UNTESTED(SET_MAX_OBJECT_STORE_ID);
INTERNAL_READ_ERROR(SET_MAX_OBJECT_STORE_ID);
return s;
}
......@@ -327,7 +327,7 @@ Status GetNewVersionNumber(TransactionalLevelDBTransaction* transaction,
bool found = false;
Status s = GetInt(transaction, last_version_key, &last_version, &found);
if (!s.ok()) {
INTERNAL_READ_ERROR_UNTESTED(GET_NEW_VERSION_NUMBER);
INTERNAL_READ_ERROR(GET_NEW_VERSION_NUMBER);
return s;
}
if (!found)
......@@ -338,7 +338,7 @@ Status GetNewVersionNumber(TransactionalLevelDBTransaction* transaction,
int64_t version = last_version + 1;
s = PutInt(transaction, last_version_key, version);
if (!s.ok()) {
INTERNAL_READ_ERROR_UNTESTED(GET_NEW_VERSION_NUMBER);
INTERNAL_READ_ERROR(GET_NEW_VERSION_NUMBER);
return s;
}
......@@ -359,14 +359,14 @@ Status SetMaxIndexId(TransactionalLevelDBTransaction* transaction,
bool found = false;
Status s = GetInt(transaction, max_index_id_key, &max_index_id, &found);
if (!s.ok()) {
INTERNAL_READ_ERROR_UNTESTED(SET_MAX_INDEX_ID);
INTERNAL_READ_ERROR(SET_MAX_INDEX_ID);
return s;
}
if (!found)
max_index_id = kMinimumIndexId;
if (index_id <= max_index_id) {
INTERNAL_CONSISTENCY_ERROR_UNTESTED(SET_MAX_INDEX_ID);
INTERNAL_CONSISTENCY_ERROR(SET_MAX_INDEX_ID);
return InternalInconsistencyStatus();
}
......@@ -385,7 +385,7 @@ Status VersionExists(TransactionalLevelDBTransaction* transaction,
Status s = transaction->Get(key, &data, exists);
if (!s.ok()) {
INTERNAL_READ_ERROR_UNTESTED(VERSION_EXISTS);
INTERNAL_READ_ERROR(VERSION_EXISTS);
return s;
}
if (!*exists)
......@@ -415,7 +415,7 @@ Status GetNewDatabaseId(Transaction* transaction, int64_t* new_id) {
Status s = indexed_db::GetInt(transaction, MaxDatabaseIdKey::Encode(),
&max_database_id, &found);
if (!s.ok()) {
INTERNAL_READ_ERROR_UNTESTED(GET_NEW_DATABASE_ID);
INTERNAL_READ_ERROR(GET_NEW_DATABASE_ID);
return s;
}
if (!found)
......@@ -426,7 +426,7 @@ Status GetNewDatabaseId(Transaction* transaction, int64_t* new_id) {
int64_t database_id = max_database_id + 1;
s = indexed_db::PutInt(transaction, MaxDatabaseIdKey::Encode(), database_id);
if (!s.ok()) {
INTERNAL_READ_ERROR_UNTESTED(GET_NEW_DATABASE_ID);
INTERNAL_READ_ERROR(GET_NEW_DATABASE_ID);
return s;
}
*new_id = database_id;
......@@ -478,7 +478,7 @@ bool FindGreatestKeyLessThanOrEqual(
std::unique_ptr<TransactionalLevelDBIterator> it =
transaction->CreateIterator(*s);
if (!s->ok()) {
INTERNAL_WRITE_ERROR_UNTESTED(CREATE_ITERATOR);
INTERNAL_WRITE_ERROR(CREATE_ITERATOR);
return false;
}
......@@ -522,14 +522,14 @@ bool GetBlobNumberGeneratorCurrentNumber(
bool found = false;
bool ok = leveldb_transaction->Get(key_gen_key, &data, &found).ok();
if (!ok) {
INTERNAL_READ_ERROR_UNTESTED(GET_BLOB_KEY_GENERATOR_CURRENT_NUMBER);
INTERNAL_READ_ERROR(GET_BLOB_KEY_GENERATOR_CURRENT_NUMBER);
return false;
}
if (found) {
StringPiece slice(data);
if (!DecodeVarInt(&slice, &cur_number) || !slice.empty() ||
!DatabaseMetaDataKey::IsValidBlobNumber(cur_number)) {
INTERNAL_READ_ERROR_UNTESTED(GET_BLOB_KEY_GENERATOR_CURRENT_NUMBER);
INTERNAL_READ_ERROR(GET_BLOB_KEY_GENERATOR_CURRENT_NUMBER);
return false;
}
}
......
......@@ -119,26 +119,6 @@ void ReportLevelDBError(const std::string& histogram_name,
REPORT_ERROR("Consistency", location)
#define INTERNAL_WRITE_ERROR(location) REPORT_ERROR("Write", location)
// Use to signal conditions that usually indicate developer error, but
// could be caused by data corruption. A macro is used instead of an
// inline function so that the assert and log report the line number.
// TODO(cmumford): Improve test coverage so that all error conditions are
// "tested" and then delete this macro.
#define REPORT_ERROR_UNTESTED(type, location) \
do { \
LOG(ERROR) << "IndexedDB " type " Error: " #location; \
NOTREACHED(); \
::content::indexed_db::ReportInternalError( \
type, ::content::indexed_db::location); \
} while (0)
#define INTERNAL_READ_ERROR_UNTESTED(location) \
REPORT_ERROR_UNTESTED("Read", location)
#define INTERNAL_CONSISTENCY_ERROR_UNTESTED(location) \
REPORT_ERROR_UNTESTED("Consistency", location)
#define INTERNAL_WRITE_ERROR_UNTESTED(location) \
REPORT_ERROR_UNTESTED("Write", location)
} // namespace indexed_db
} // namespace content
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment