Chromium Code Reviews| 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 80345303ab195efadd7a765b33fb8d8b154033b1..3f7fd4677880796d18693e206e4541b0585f17d9 100644 |
| --- a/content/browser/indexed_db/indexed_db_transaction_coordinator.cc |
| +++ b/content/browser/indexed_db/indexed_db_transaction_coordinator.cc |
| @@ -9,6 +9,15 @@ |
| #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h" |
| namespace content { |
| +namespace { |
| + |
| +// Only this many transactions can be active at any time before they are queued. |
| +// Limited prevent transaction trashing. Ten is chosen to reduce performance |
|
cmumford
2017/02/16 23:36:14
"Limited to prevent"
pwnall
2017/02/16 23:38:28
Is this accurate? I thought we're limiting txns to
dmurph
2017/02/16 23:50:27
That's a side effect of the transaction trashing.
|
| +// regressions. |
| +// TODO(dmurph): Choose this number better, or implement a scheduler. |
|
pwnall
2017/02/16 23:38:28
crbug in the todo?
dmurph
2017/02/16 23:50:27
Done.
|
| +static const size_t kMaxStartedTransactions = 10; |
| + |
| +} // namespace |
| IndexedDBTransactionCoordinator::IndexedDBTransactionCoordinator() {} |
| @@ -146,6 +155,9 @@ static bool DoSetsIntersect(const std::set<T>& set1, |
| bool IndexedDBTransactionCoordinator::CanStartTransaction( |
| IndexedDBTransaction* const transaction, |
| const std::set<int64_t>& locked_scope) const { |
| + if (started_transactions_.size() >= kMaxStartedTransactions) { |
| + return false; |
| + } |
| DCHECK(queued_transactions_.count(transaction)); |
| switch (transaction->mode()) { |
| case blink::WebIDBTransactionModeVersionChange: |