OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_TRANSACTION_COORDINATOR_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_TRANSACTION_COORDINATOR_H_ |
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_TRANSACTION_COORDINATOR_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_TRANSACTION_COORDINATOR_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 25 matching lines...) Expand all Loading... |
36 #ifndef NDEBUG | 36 #ifndef NDEBUG |
37 bool IsActive(IndexedDBTransaction* transaction); | 37 bool IsActive(IndexedDBTransaction* transaction); |
38 #endif | 38 #endif |
39 | 39 |
40 // Makes a snapshot of the transaction queue. For diagnostics only. | 40 // Makes a snapshot of the transaction queue. For diagnostics only. |
41 std::vector<const IndexedDBTransaction*> GetTransactions() const; | 41 std::vector<const IndexedDBTransaction*> GetTransactions() const; |
42 | 42 |
43 private: | 43 private: |
44 friend class IndexedDBTransactionCoordinatorTest; | 44 friend class IndexedDBTransactionCoordinatorTest; |
45 | 45 |
| 46 void RecordMetrics() const; |
| 47 |
46 void ProcessQueuedTransactions(); | 48 void ProcessQueuedTransactions(); |
47 bool CanStartTransaction(IndexedDBTransaction* const transaction, | 49 bool CanStartTransaction(IndexedDBTransaction* const transaction, |
48 const std::set<int64_t>& locked_scope) const; | 50 const std::set<int64_t>& locked_scope, |
| 51 size_t num_started_txns) const; |
49 | 52 |
50 // Transactions in different states are grouped below. | 53 // Transactions in different states are grouped below. |
51 // list_set is used to provide stable ordering; required by spec | 54 // list_set is used to provide stable ordering; required by spec |
52 // for the queue, convenience for diagnostics for the rest. | 55 // for the queue, convenience for diagnostics for the rest. |
53 list_set<IndexedDBTransaction*> queued_transactions_; | 56 list_set<IndexedDBTransaction*> queued_transactions_; |
54 list_set<IndexedDBTransaction*> started_transactions_; | 57 list_set<IndexedDBTransaction*> started_transactions_; |
55 | 58 |
56 DISALLOW_COPY_AND_ASSIGN(IndexedDBTransactionCoordinator); | 59 DISALLOW_COPY_AND_ASSIGN(IndexedDBTransactionCoordinator); |
57 }; | 60 }; |
58 | 61 |
59 } // namespace content | 62 } // namespace content |
60 | 63 |
61 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_TRANSACTION_COORDINATOR_H_ | 64 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_TRANSACTION_COORDINATOR_H_ |
OLD | NEW |