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

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

Issue 110983004: IndexedDB: More database<->transaction relationship simplification (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years 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 | « content/browser/indexed_db/indexed_db_transaction_coordinator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/indexed_db/indexed_db_transaction_coordinator.cc
diff --git a/content/browser/indexed_db/indexed_db_transaction_coordinator.cc b/content/browser/indexed_db/indexed_db_transaction_coordinator.cc
index be47624cf4a0d26d637692a959f44e86477e0afe..852eb9dd4bc9b507f72c7381dcf65e967c401e6c 100644
--- a/content/browser/indexed_db/indexed_db_transaction_coordinator.cc
+++ b/content/browser/indexed_db/indexed_db_transaction_coordinator.cc
@@ -28,7 +28,7 @@ void IndexedDBTransactionCoordinator::DidCreateTransaction(
}
void IndexedDBTransactionCoordinator::DidFinishTransaction(
- scoped_refptr<IndexedDBTransaction> transaction) {
+ IndexedDBTransaction* transaction) {
if (queued_transactions_.count(transaction)) {
DCHECK(!started_transactions_.count(transaction));
queued_transactions_.erase(transaction);
@@ -40,6 +40,13 @@ void IndexedDBTransactionCoordinator::DidFinishTransaction(
ProcessQueuedTransactions();
}
+bool IndexedDBTransactionCoordinator::IsRunningVersionChangeTransaction()
+ const {
+ return !started_transactions_.empty() &&
+ (*started_transactions_.begin())->mode() ==
+ indexed_db::TRANSACTION_VERSION_CHANGE;
+}
+
#ifndef NDEBUG
// Verifies internal consistency while returning whether anything is found.
bool IndexedDBTransactionCoordinator::IsActive(
@@ -77,9 +84,7 @@ void IndexedDBTransactionCoordinator::ProcessQueuedTransactions() {
if (queued_transactions_.empty())
return;
- DCHECK(started_transactions_.empty() ||
- (*started_transactions_.begin())->mode() !=
- indexed_db::TRANSACTION_VERSION_CHANGE);
+ DCHECK(!IsRunningVersionChangeTransaction());
// The locked_scope set accumulates the ids of object stores in the scope of
// running read/write transactions. Other read-write transactions with
« no previous file with comments | « content/browser/indexed_db/indexed_db_transaction_coordinator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698