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

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

Issue 277583002: IndexedDB: Prevent store/index deletion from racing ahead of use (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: base::Closure copies const-refs, so this is better Created 6 years, 7 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
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_H_ 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_TRANSACTION_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_TRANSACTION_H_ 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_TRANSACTION_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <set> 9 #include <set>
10 #include <stack> 10 #include <stack>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 // Called by the transaction coordinator when this transaction is unblocked. 43 // Called by the transaction coordinator when this transaction is unblocked.
44 void Start(); 44 void Start();
45 45
46 indexed_db::TransactionMode mode() const { return mode_; } 46 indexed_db::TransactionMode mode() const { return mode_; }
47 const std::set<int64>& scope() const { return object_store_ids_; } 47 const std::set<int64>& scope() const { return object_store_ids_; }
48 48
49 void ScheduleTask(Operation task) { 49 void ScheduleTask(Operation task) {
50 ScheduleTask(IndexedDBDatabase::NORMAL_TASK, task); 50 ScheduleTask(IndexedDBDatabase::NORMAL_TASK, task);
51 } 51 }
52 void ScheduleTask(Operation task, Operation abort_task);
53 void ScheduleTask(IndexedDBDatabase::TaskType, Operation task); 52 void ScheduleTask(IndexedDBDatabase::TaskType, Operation task);
53 void ScheduleAbortTask(Operation abort_task);
54 void RegisterOpenCursor(IndexedDBCursor* cursor); 54 void RegisterOpenCursor(IndexedDBCursor* cursor);
55 void UnregisterOpenCursor(IndexedDBCursor* cursor); 55 void UnregisterOpenCursor(IndexedDBCursor* cursor);
56 void AddPreemptiveEvent() { pending_preemptive_events_++; } 56 void AddPreemptiveEvent() { pending_preemptive_events_++; }
57 void DidCompletePreemptiveEvent() { 57 void DidCompletePreemptiveEvent() {
58 pending_preemptive_events_--; 58 pending_preemptive_events_--;
59 DCHECK_GE(pending_preemptive_events_, 0); 59 DCHECK_GE(pending_preemptive_events_, 0);
60 } 60 }
61 IndexedDBBackingStore::Transaction* BackingStoreTransaction() { 61 IndexedDBBackingStore::Transaction* BackingStoreTransaction() {
62 return transaction_.get(); 62 return transaction_.get();
63 } 63 }
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 // requests are processed before the timer fires, assume the script is 156 // requests are processed before the timer fires, assume the script is
157 // unresponsive and abort to unblock the transaction queue. 157 // unresponsive and abort to unblock the transaction queue.
158 base::OneShotTimer<IndexedDBTransaction> timeout_timer_; 158 base::OneShotTimer<IndexedDBTransaction> timeout_timer_;
159 159
160 Diagnostics diagnostics_; 160 Diagnostics diagnostics_;
161 }; 161 };
162 162
163 } // namespace content 163 } // namespace content
164 164
165 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_TRANSACTION_H_ 165 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_TRANSACTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698