Chromium Code Reviews| 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..7569f09b0febdd6280d0e0f7b0eb88b9b4896ae3 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::WebIDBTransactionModeVersionChange); |
| 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::WebIDBTransactionModeVersionChange); |
| 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::WebIDBTransactionModeVersionChange); |
| 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::WebIDBTransactionModeVersionChange); |
| 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::WebIDBCursorDirectionNext, |
| &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::WebIDBCursorDirectionNext, |
| &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::WebIDBCursorDirectionNext, |
| &s); |
| } |
| @@ -707,7 +707,7 @@ struct IndexedDBDatabase::PutOperationParams { |
| IndexedDBValue value; |
| ScopedVector<webkit_blob::BlobDataHandle> handles; |
| scoped_ptr<IndexedDBKey> key; |
| - IndexedDBDatabase::PutMode put_mode; |
| + blink::WebIDBPutMode put_mode; |
| scoped_refptr<IndexedDBCallbacks> callbacks; |
| std::vector<IndexKeys> index_keys; |
| @@ -720,14 +720,14 @@ void IndexedDBDatabase::Put(int64 transaction_id, |
| IndexedDBValue* value, |
| ScopedVector<webkit_blob::BlobDataHandle>* handles, |
| scoped_ptr<IndexedDBKey> key, |
| - PutMode put_mode, |
| + blink::WebIDBPutMode put_mode, |
| scoped_refptr<IndexedDBCallbacks> callbacks, |
| const std::vector<IndexKeys>& index_keys) { |
| IDB_TRACE("IndexedDBDatabase::Put"); |
| IndexedDBTransaction* transaction = GetTransaction(transaction_id); |
| if (!transaction) |
| return; |
| - DCHECK_NE(transaction->mode(), indexed_db::TRANSACTION_READ_ONLY); |
| + DCHECK_NE(transaction->mode(), blink::WebIDBTransactionModeReadOnly); |
| 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::WebIDBTransactionModeReadOnly); |
| bool key_was_generated = false; |
| DCHECK(metadata_.object_stores.find(params->object_store_id) != |
| @@ -759,7 +759,7 @@ void IndexedDBDatabase::PutOperation(scoped_ptr<PutOperationParams> params, |
| DCHECK(object_store.auto_increment || params->key->IsValid()); |
| scoped_ptr<IndexedDBKey> key; |
| - if (params->put_mode != IndexedDBDatabase::CURSOR_UPDATE && |
| + if (params->put_mode != blink::WebIDBPutModeCursorUpdate && |
| object_store.auto_increment && !params->key->IsValid()) { |
| scoped_ptr<IndexedDBKey> auto_inc_key = GenerateKey( |
| backing_store_.get(), transaction, id(), params->object_store_id); |
| @@ -778,7 +778,7 @@ void IndexedDBDatabase::PutOperation(scoped_ptr<PutOperationParams> params, |
| DCHECK(key->IsValid()); |
| IndexedDBBackingStore::RecordIdentifier record_identifier; |
| - if (params->put_mode == IndexedDBDatabase::ADD_ONLY) { |
| + if (params->put_mode == blink::WebIDBPutModeAddOnly) { |
| bool found = false; |
| leveldb::Status s = backing_store_->KeyExistsInObjectStore( |
| transaction->BackingStoreTransaction(), |
| @@ -860,7 +860,7 @@ void IndexedDBDatabase::PutOperation(scoped_ptr<PutOperationParams> params, |
| } |
| if (object_store.auto_increment && |
| - params->put_mode != IndexedDBDatabase::CURSOR_UPDATE && |
| + params->put_mode != blink::WebIDBPutModeCursorUpdate && |
| key->type() == WebIDBKeyTypeNumber) { |
| leveldb::Status s = UpdateKeyGenerator(backing_store_.get(), |
| transaction, |
| @@ -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::WebIDBTransactionModeVersionChange); |
| // 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::WebIDBTransactionModeVersionChange); |
| transaction->ScheduleTask( |
| - IndexedDBDatabase::PREEMPTIVE_TASK, |
| + blink::WebIDBTaskTypePreemptive, |
| 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::WebIDBCursorDirection direction; |
| indexed_db::CursorType cursor_type; |
| - IndexedDBDatabase::TaskType task_type; |
| + blink::WebIDBTaskType 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::WebIDBCursorDirection direction, |
| bool key_only, |
| - TaskType task_type, |
| + blink::WebIDBTaskType 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::WebIDBTaskTypePreemptive) |
| 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::WebIDBTaskTypeNormal); |
| 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::WebIDBTaskTypeNormal); |
| 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::WebIDBCursorDirectionNext, |
| &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::WebIDBCursorDirectionNext, |
| &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::WebIDBTransactionModeReadOnly); |
| 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::WebIDBTransactionModeReadOnly); |
| 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::WebIDBTransactionModeVersionChange) { |
| 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::WebIDBTransactionMode>(mode), |
|
jsbell
2014/06/11 16:42:01
... and then this cast can go away.
Pritam Nikam
2014/06/12 11:19:20
Done.
|
| 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::WebIDBTransactionModeVersionChange); |
| transactions_[transaction_id]->ScheduleTask( |
| base::Bind(&IndexedDBDatabase::VersionChangeOperation, |