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

Unified Diff: content/browser/indexed_db/indexed_db_database.cc

Issue 320833002: [IndexedDB] Use consistent enums on both sides of IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
Index: content/browser/indexed_db/indexed_db_database.cc
diff --git a/content/browser/indexed_db/indexed_db_database.cc b/content/browser/indexed_db/indexed_db_database.cc
index 5ba4e4839e70b7c91c417f7d538a2c43a9e62dcf..e54ddb7b3c01f1e5c1b0036a3f9fb5f15b9ad72c 100644
--- a/content/browser/indexed_db/indexed_db_database.cc
+++ b/content/browser/indexed_db/indexed_db_database.cc
@@ -271,7 +271,7 @@ void IndexedDBDatabase::CreateObjectStore(int64 transaction_id,
IndexedDBTransaction* transaction = GetTransaction(transaction_id);
if (!transaction)
return;
- DCHECK_EQ(transaction->mode(), indexed_db::TRANSACTION_VERSION_CHANGE);
+ DCHECK_EQ(transaction->mode(), blink::TransactionVersionChange);
if (ContainsKey(metadata_.object_stores, object_store_id)) {
DLOG(ERROR) << "Invalid object_store_id";
@@ -320,7 +320,7 @@ void IndexedDBDatabase::DeleteObjectStore(int64 transaction_id,
IndexedDBTransaction* transaction = GetTransaction(transaction_id);
if (!transaction)
return;
- DCHECK_EQ(transaction->mode(), indexed_db::TRANSACTION_VERSION_CHANGE);
+ DCHECK_EQ(transaction->mode(), blink::TransactionVersionChange);
if (!ValidateObjectStoreId(object_store_id))
return;
@@ -342,7 +342,7 @@ void IndexedDBDatabase::CreateIndex(int64 transaction_id,
IndexedDBTransaction* transaction = GetTransaction(transaction_id);
if (!transaction)
return;
- DCHECK_EQ(transaction->mode(), indexed_db::TRANSACTION_VERSION_CHANGE);
+ DCHECK_EQ(transaction->mode(), blink::TransactionVersionChange);
if (!ValidateObjectStoreIdAndNewIndexId(object_store_id, index_id))
return;
@@ -392,7 +392,7 @@ void IndexedDBDatabase::DeleteIndex(int64 transaction_id,
IndexedDBTransaction* transaction = GetTransaction(transaction_id);
if (!transaction)
return;
- DCHECK_EQ(transaction->mode(), indexed_db::TRANSACTION_VERSION_CHANGE);
+ DCHECK_EQ(transaction->mode(), blink::TransactionVersionChange);
if (!ValidateObjectStoreIdAndIndexId(object_store_id, index_id))
return;
@@ -530,7 +530,7 @@ void IndexedDBDatabase::GetOperation(
id(),
object_store_id,
*key_range,
- indexed_db::CURSOR_NEXT,
+ blink::Next,
&s);
} else if (cursor_type == indexed_db::CURSOR_KEY_ONLY) {
// Index Value Retrieval Operation
@@ -540,7 +540,7 @@ void IndexedDBDatabase::GetOperation(
object_store_id,
index_id,
*key_range,
- indexed_db::CURSOR_NEXT,
+ blink::Next,
&s);
} else {
// Index Referenced Value Retrieval Operation
@@ -550,7 +550,7 @@ void IndexedDBDatabase::GetOperation(
object_store_id,
index_id,
*key_range,
- indexed_db::CURSOR_NEXT,
+ blink::Next,
&s);
}
@@ -727,7 +727,7 @@ void IndexedDBDatabase::Put(int64 transaction_id,
IndexedDBTransaction* transaction = GetTransaction(transaction_id);
if (!transaction)
return;
- DCHECK_NE(transaction->mode(), indexed_db::TRANSACTION_READ_ONLY);
+ DCHECK_NE(transaction->mode(), blink::TransactionReadOnly);
if (!ValidateObjectStoreId(object_store_id))
return;
@@ -749,7 +749,7 @@ void IndexedDBDatabase::Put(int64 transaction_id,
void IndexedDBDatabase::PutOperation(scoped_ptr<PutOperationParams> params,
IndexedDBTransaction* transaction) {
IDB_TRACE("IndexedDBDatabase::PutOperation");
- DCHECK_NE(transaction->mode(), indexed_db::TRANSACTION_READ_ONLY);
+ DCHECK_NE(transaction->mode(), blink::TransactionReadOnly);
bool key_was_generated = false;
DCHECK(metadata_.object_stores.find(params->object_store_id) !=
@@ -890,7 +890,7 @@ void IndexedDBDatabase::SetIndexKeys(int64 transaction_id,
IndexedDBTransaction* transaction = GetTransaction(transaction_id);
if (!transaction)
return;
- DCHECK_EQ(transaction->mode(), indexed_db::TRANSACTION_VERSION_CHANGE);
+ DCHECK_EQ(transaction->mode(), blink::TransactionVersionChange);
// TODO(alecflett): This method could be asynchronous, but we need to
// evaluate if it's worth the extra complexity.
@@ -965,10 +965,10 @@ void IndexedDBDatabase::SetIndexesReady(int64 transaction_id,
IndexedDBTransaction* transaction = GetTransaction(transaction_id);
if (!transaction)
return;
- DCHECK_EQ(transaction->mode(), indexed_db::TRANSACTION_VERSION_CHANGE);
+ DCHECK_EQ(transaction->mode(), blink::TransactionVersionChange);
transaction->ScheduleTask(
- IndexedDBDatabase::PREEMPTIVE_TASK,
+ blink::PreemptiveTask,
base::Bind(&IndexedDBDatabase::SetIndexesReadyOperation,
this,
index_ids.size()));
@@ -987,9 +987,9 @@ struct IndexedDBDatabase::OpenCursorOperationParams {
int64 object_store_id;
int64 index_id;
scoped_ptr<IndexedDBKeyRange> key_range;
- indexed_db::CursorDirection direction;
+ blink::Direction direction;
indexed_db::CursorType cursor_type;
- IndexedDBDatabase::TaskType task_type;
+ blink::TaskType task_type;
scoped_refptr<IndexedDBCallbacks> callbacks;
private:
@@ -1001,9 +1001,9 @@ void IndexedDBDatabase::OpenCursor(
int64 object_store_id,
int64 index_id,
scoped_ptr<IndexedDBKeyRange> key_range,
- indexed_db::CursorDirection direction,
+ blink::Direction direction,
bool key_only,
- TaskType task_type,
+ blink::TaskType task_type,
scoped_refptr<IndexedDBCallbacks> callbacks) {
IDB_TRACE("IndexedDBDatabase::OpenCursor");
IndexedDBTransaction* transaction = GetTransaction(transaction_id);
@@ -1035,14 +1035,14 @@ void IndexedDBDatabase::OpenCursorOperation(
// until the indexing is complete. This can't happen any earlier
// because we don't want to switch to early mode in case multiple
// indexes are being created in a row, with Put()'s in between.
- if (params->task_type == IndexedDBDatabase::PREEMPTIVE_TASK)
+ if (params->task_type == blink::PreemptiveTask)
transaction->AddPreemptiveEvent();
leveldb::Status s;
scoped_ptr<IndexedDBBackingStore::Cursor> backing_store_cursor;
if (params->index_id == IndexedDBIndexMetadata::kInvalidId) {
if (params->cursor_type == indexed_db::CURSOR_KEY_ONLY) {
- DCHECK_EQ(params->task_type, IndexedDBDatabase::NORMAL_TASK);
+ DCHECK_EQ(params->task_type, blink::NormalTask);
backing_store_cursor = backing_store_->OpenObjectStoreKeyCursor(
transaction->BackingStoreTransaction(),
id(),
@@ -1060,7 +1060,7 @@ void IndexedDBDatabase::OpenCursorOperation(
&s);
}
} else {
- DCHECK_EQ(params->task_type, IndexedDBDatabase::NORMAL_TASK);
+ DCHECK_EQ(params->task_type, blink::NormalTask);
if (params->cursor_type == indexed_db::CURSOR_KEY_ONLY) {
backing_store_cursor = backing_store_->OpenIndexKeyCursor(
transaction->BackingStoreTransaction(),
@@ -1145,7 +1145,7 @@ void IndexedDBDatabase::CountOperation(
id(),
object_store_id,
*key_range,
- indexed_db::CURSOR_NEXT,
+ blink::Next,
&s);
} else {
backing_store_cursor = backing_store_->OpenIndexKeyCursor(
@@ -1154,7 +1154,7 @@ void IndexedDBDatabase::CountOperation(
object_store_id,
index_id,
*key_range,
- indexed_db::CURSOR_NEXT,
+ blink::Next,
&s);
}
if (!s.ok()) {
@@ -1189,7 +1189,7 @@ void IndexedDBDatabase::DeleteRange(
IndexedDBTransaction* transaction = GetTransaction(transaction_id);
if (!transaction)
return;
- DCHECK_NE(transaction->mode(), indexed_db::TRANSACTION_READ_ONLY);
+ DCHECK_NE(transaction->mode(), blink::TransactionReadOnly);
if (!ValidateObjectStoreId(object_store_id))
return;
@@ -1234,7 +1234,7 @@ void IndexedDBDatabase::Clear(int64 transaction_id,
IndexedDBTransaction* transaction = GetTransaction(transaction_id);
if (!transaction)
return;
- DCHECK_NE(transaction->mode(), indexed_db::TRANSACTION_READ_ONLY);
+ DCHECK_NE(transaction->mode(), blink::TransactionReadOnly);
if (!ValidateObjectStoreId(object_store_id))
return;
@@ -1335,7 +1335,7 @@ void IndexedDBDatabase::TransactionFinished(IndexedDBTransaction* transaction,
DCHECK_EQ(transactions_[transaction->id()], transaction);
transactions_.erase(transaction->id());
- if (transaction->mode() == indexed_db::TRANSACTION_VERSION_CHANGE) {
+ if (transaction->mode() == blink::TransactionVersionChange) {
if (pending_second_half_open_) {
if (committed) {
DCHECK_EQ(pending_second_half_open_->version(), metadata_.int_version);
@@ -1450,7 +1450,7 @@ void IndexedDBDatabase::CreateTransaction(
transaction_id,
connection->callbacks(),
std::set<int64>(object_store_ids.begin(), object_store_ids.end()),
- static_cast<indexed_db::TransactionMode>(mode),
+ static_cast<blink::TransactionMode>(mode),
this,
new IndexedDBBackingStore::Transaction(backing_store_)));
}
@@ -1603,7 +1603,7 @@ void IndexedDBDatabase::RunVersionChangeTransactionFinal(
CreateTransaction(transaction_id,
connection.get(),
object_store_ids,
- indexed_db::TRANSACTION_VERSION_CHANGE);
+ blink::TransactionVersionChange);
transactions_[transaction_id]->ScheduleTask(
base::Bind(&IndexedDBDatabase::VersionChangeOperation,

Powered by Google App Engine
This is Rietveld 408576698