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 #include "content/browser/indexed_db/indexed_db_transaction.h" | 5 #include "content/browser/indexed_db/indexed_db_transaction.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 database_->transaction_coordinator().DidFinishTransaction(this); | 252 database_->transaction_coordinator().DidFinishTransaction(this); |
253 | 253 |
254 if (committed) { | 254 if (committed) { |
255 abort_task_stack_.clear(); | 255 abort_task_stack_.clear(); |
256 callbacks_->OnComplete(id_); | 256 callbacks_->OnComplete(id_); |
257 database_->TransactionFinished(this, true); | 257 database_->TransactionFinished(this, true); |
258 } else { | 258 } else { |
259 while (!abort_task_stack_.empty()) | 259 while (!abort_task_stack_.empty()) |
260 abort_task_stack_.pop().Run(NULL); | 260 abort_task_stack_.pop().Run(NULL); |
261 | 261 |
262 callbacks_->OnAbort( | 262 IndexedDBDatabaseError error(blink::WebIDBDatabaseExceptionUnknownError, |
263 id_, | 263 "Internal error committing transaction."); |
264 IndexedDBDatabaseError(blink::WebIDBDatabaseExceptionUnknownError, | 264 callbacks_->OnAbort(id_, error); |
265 "Internal error committing transaction.")); | |
266 database_->TransactionFinished(this, false); | 265 database_->TransactionFinished(this, false); |
267 database_->TransactionCommitFailed(); | 266 database_->TransactionCommitFailed(); |
268 } | 267 } |
269 | 268 |
270 database_ = NULL; | 269 database_ = NULL; |
271 } | 270 } |
272 | 271 |
273 void IndexedDBTransaction::ProcessTaskQueue() { | 272 void IndexedDBTransaction::ProcessTaskQueue() { |
274 IDB_TRACE("IndexedDBTransaction::ProcessTaskQueue"); | 273 IDB_TRACE("IndexedDBTransaction::ProcessTaskQueue"); |
275 | 274 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 | 335 |
337 void IndexedDBTransaction::CloseOpenCursors() { | 336 void IndexedDBTransaction::CloseOpenCursors() { |
338 for (std::set<IndexedDBCursor*>::iterator i = open_cursors_.begin(); | 337 for (std::set<IndexedDBCursor*>::iterator i = open_cursors_.begin(); |
339 i != open_cursors_.end(); | 338 i != open_cursors_.end(); |
340 ++i) | 339 ++i) |
341 (*i)->Close(); | 340 (*i)->Close(); |
342 open_cursors_.clear(); | 341 open_cursors_.clear(); |
343 } | 342 } |
344 | 343 |
345 } // namespace content | 344 } // namespace content |
OLD | NEW |