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

Unified Diff: content/browser/indexed_db/indexed_db_transaction.cc

Issue 277583002: IndexedDB: Prevent store/index deletion from racing ahead of use (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added tests 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/indexed_db/indexed_db_transaction.cc
diff --git a/content/browser/indexed_db/indexed_db_transaction.cc b/content/browser/indexed_db/indexed_db_transaction.cc
index bb7fc03c5bf07f4461db299134a56c5a417d4694..457a7807726c54bac4326ca933793ec79c38d5d4 100644
--- a/content/browser/indexed_db/indexed_db_transaction.cc
+++ b/content/browser/indexed_db/indexed_db_transaction.cc
@@ -86,18 +86,6 @@ IndexedDBTransaction::~IndexedDBTransaction() {
DCHECK(abort_task_stack_.empty());
}
-void IndexedDBTransaction::ScheduleTask(Operation task, Operation abort_task) {
- if (state_ == FINISHED)
- return;
-
- timeout_timer_.Stop();
- used_ = true;
- task_queue_.push(task);
- ++diagnostics_.tasks_scheduled;
- abort_task_stack_.push(abort_task);
- RunTasksIfStarted();
-}
-
void IndexedDBTransaction::ScheduleTask(IndexedDBDatabase::TaskType type,
Operation task) {
if (state_ == FINISHED)
@@ -114,6 +102,12 @@ void IndexedDBTransaction::ScheduleTask(IndexedDBDatabase::TaskType type,
RunTasksIfStarted();
cmumford 2014/05/13 21:56:24 Will PostTask (run by RunTasksIfStarted) ever run
ericu 2014/05/14 01:08:00 No, PostTask always queues a task for asynchronous
}
+void IndexedDBTransaction::ScheduleAbortTask(Operation abort_task) {
+ DCHECK_NE(FINISHED, state_);
+ DCHECK(used_);
+ abort_task_stack_.push(abort_task);
+}
+
void IndexedDBTransaction::RunTasksIfStarted() {
DCHECK(used_);

Powered by Google App Engine
This is Rietveld 408576698