| 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 <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 bool IsRunningVersionChangeTransaction() const; | 30 bool IsRunningVersionChangeTransaction() const; |
| 31 | 31 |
| 32 #ifndef NDEBUG | 32 #ifndef NDEBUG |
| 33 bool IsActive(IndexedDBTransaction* transaction); | 33 bool IsActive(IndexedDBTransaction* transaction); |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 // Makes a snapshot of the transaction queue. For diagnostics only. | 36 // Makes a snapshot of the transaction queue. For diagnostics only. |
| 37 std::vector<const IndexedDBTransaction*> GetTransactions() const; | 37 std::vector<const IndexedDBTransaction*> GetTransactions() const; |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 typedef list_set<scoped_refptr<IndexedDBTransaction> > TransactionSet; |
| 41 |
| 40 void ProcessQueuedTransactions(); | 42 void ProcessQueuedTransactions(); |
| 41 bool CanStartTransaction(IndexedDBTransaction* const transaction, | 43 bool CanStartTransaction(IndexedDBTransaction* const transaction, |
| 42 const std::set<int64>& locked_scope) const; | 44 const std::set<int64>& locked_scope) const; |
| 43 | 45 |
| 44 // Transactions in different states are grouped below. | 46 // Transactions in different states are grouped below. |
| 45 // list_set is used to provide stable ordering; required by spec | 47 // list_set is used to provide stable ordering; required by spec |
| 46 // for the queue, convenience for diagnostics for the rest. | 48 // for the queue, convenience for diagnostics for the rest. |
| 47 typedef list_set<scoped_refptr<IndexedDBTransaction> > TransactionSet; | |
| 48 TransactionSet queued_transactions_; | 49 TransactionSet queued_transactions_; |
| 49 TransactionSet started_transactions_; | 50 TransactionSet started_transactions_; |
| 50 | 51 |
| 51 DISALLOW_COPY_AND_ASSIGN(IndexedDBTransactionCoordinator); | 52 DISALLOW_COPY_AND_ASSIGN(IndexedDBTransactionCoordinator); |
| 52 }; | 53 }; |
| 53 | 54 |
| 54 } // namespace content | 55 } // namespace content |
| 55 | 56 |
| 56 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_TRANSACTION_COORDINATOR_H_ | 57 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_TRANSACTION_COORDINATOR_H_ |
| OLD | NEW |