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

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

Issue 2472213003: [IndexedDB] Refactoring to remove ref ptrs and host transaction ids. (Closed)
Patch Set: updated unittests Created 4 years, 1 month 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_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 c7d171bca65a63123176d77225b04db123773408..5617628e619fdda92e753bc24377f814bb897324 100644
--- a/content/browser/indexed_db/indexed_db_transaction_coordinator.cc
+++ b/content/browser/indexed_db/indexed_db_transaction_coordinator.cc
@@ -18,7 +18,7 @@ IndexedDBTransactionCoordinator::~IndexedDBTransactionCoordinator() {
}
void IndexedDBTransactionCoordinator::DidCreateTransaction(
- scoped_refptr<IndexedDBTransaction> transaction) {
+ IndexedDBTransaction* transaction) {
DCHECK(!queued_transactions_.count(transaction));
DCHECK(!started_transactions_.count(transaction));
DCHECK_EQ(IndexedDBTransaction::CREATED, transaction->state());
@@ -65,11 +65,12 @@ bool IndexedDBTransactionCoordinator::IsActive(
std::vector<const IndexedDBTransaction*>
IndexedDBTransactionCoordinator::GetTransactions() const {
std::vector<const IndexedDBTransaction*> result;
+ result.reserve(started_transactions_.size() + queued_transactions_.size());
for (const auto& transaction : started_transactions_)
- result.push_back(transaction.get());
+ result.push_back(transaction);
jsbell 2016/11/04 17:48:19 Now that both types are raw pointers can this be r
dmurph 2016/11/04 22:52:25 Done.
for (const auto& transaction : queued_transactions_)
- result.push_back(transaction.get());
+ result.push_back(transaction);
return result;
}
@@ -98,9 +99,9 @@ void IndexedDBTransactionCoordinator::ProcessQueuedTransactions() {
auto it = queued_transactions_.begin();
while (it != queued_transactions_.end()) {
- scoped_refptr<IndexedDBTransaction> transaction = *it;
+ IndexedDBTransaction* transaction = *it;
++it;
- if (CanStartTransaction(transaction.get(), locked_scope)) {
+ if (CanStartTransaction(transaction, locked_scope)) {
DCHECK_EQ(IndexedDBTransaction::CREATED, transaction->state());
queued_transactions_.erase(transaction);
started_transactions_.insert(transaction);

Powered by Google App Engine
This is Rietveld 408576698