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

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: comments Created 4 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
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..68e01728813500240ba1625873519d9073cc87ea 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,12 +65,11 @@ bool IndexedDBTransactionCoordinator::IsActive(
std::vector<const IndexedDBTransaction*>
IndexedDBTransactionCoordinator::GetTransactions() const {
std::vector<const IndexedDBTransaction*> result;
-
- for (const auto& transaction : started_transactions_)
- result.push_back(transaction.get());
- for (const auto& transaction : queued_transactions_)
- result.push_back(transaction.get());
-
+ result.reserve(started_transactions_.size() + queued_transactions_.size());
+ result.insert(result.end(), started_transactions_.begin(),
sof 2016/12/05 20:00:20 Somewhat odd, but I'm running into compilation bre
jsbell 2016/12/06 00:00:47 Weird - I haven't heard any other reports. list_
+ started_transactions_.end());
+ result.insert(result.end(), queued_transactions_.begin(),
+ queued_transactions_.end());
return result;
}
@@ -98,9 +97,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