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

Side by Side Diff: content/browser/indexed_db/indexed_db_transaction_coordinator.h

Issue 15659013: Revert "Migrate the IndexedDB backend from Blink to Chromium" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_TRANSACTION_COORDINATOR_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_TRANSACTION_COORDINATOR_H_
7
8 #include <map>
9 #include <set>
10
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "content/browser/indexed_db/list_set.h"
14
15 namespace content {
16
17 class IndexedDBTransaction;
18
19 // Transactions are executed in the order the were created.
20 class IndexedDBTransactionCoordinator {
21 public:
22 IndexedDBTransactionCoordinator();
23 ~IndexedDBTransactionCoordinator();
24
25 // Called by transactions as they start and finish.
26 void DidCreateTransaction(IndexedDBTransaction* transaction);
27 void DidStartTransaction(IndexedDBTransaction* transaction);
28 void DidFinishTransaction(IndexedDBTransaction* transaction);
29
30 #ifndef NDEBUG
31 bool IsActive(IndexedDBTransaction* transaction);
32 #endif
33
34 // TODO(jsbell): API to handle closed connections. http://crbug.com/241821
35
36 private:
37 void ProcessStartedTransactions();
38 bool CanRunTransaction(IndexedDBTransaction* transaction);
39
40 // This is just an efficient way to keep references to all transactions.
41 std::map<IndexedDBTransaction*, scoped_refptr<IndexedDBTransaction> >
42 transactions_;
43 // Transactions in different states are grouped below.
44 list_set<IndexedDBTransaction*> queued_transactions_;
45 std::set<IndexedDBTransaction*> started_transactions_;
46 };
47
48 } // namespace content
49
50 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_TRANSACTION_COORDINATOR_H_
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_transaction.cc ('k') | content/browser/indexed_db/indexed_db_transaction_coordinator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698