Chromium Code Reviews| 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/location.h" | 8 #include "base/location.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 308 CloseOpenCursors(); | 308 CloseOpenCursors(); |
| 309 transaction_->Reset(); | 309 transaction_->Reset(); |
| 310 | 310 |
| 311 // Transactions must also be marked as completed before the | 311 // Transactions must also be marked as completed before the |
| 312 // front-end is notified, as the transaction completion unblocks | 312 // front-end is notified, as the transaction completion unblocks |
| 313 // operations like closing connections. | 313 // operations like closing connections. |
| 314 database_->transaction_coordinator().DidFinishTransaction(this); | 314 database_->transaction_coordinator().DidFinishTransaction(this); |
| 315 | 315 |
| 316 if (committed) { | 316 if (committed) { |
| 317 abort_task_stack_.clear(); | 317 abort_task_stack_.clear(); |
| 318 callbacks_->OnComplete(id_); | 318 { |
| 319 IDB_TRACE1("IndexedDBTransaction:TransactionCompleteCallbacks:", "txn.id", | |
|
cmumford
2015/08/03 17:31:33
colon in wrong place.
dmurph
2015/08/05 15:30:32
Done.
| |
| 320 id()); | |
| 321 callbacks_->OnComplete(id_); | |
| 322 } | |
| 319 database_->TransactionFinished(this, true); | 323 database_->TransactionFinished(this, true); |
| 320 } else { | 324 } else { |
| 321 while (!abort_task_stack_.empty()) | 325 while (!abort_task_stack_.empty()) |
| 322 abort_task_stack_.pop().Run(NULL); | 326 abort_task_stack_.pop().Run(NULL); |
| 323 | 327 |
| 324 IndexedDBDatabaseError error; | 328 IndexedDBDatabaseError error; |
| 325 if (leveldb_env::IndicatesDiskFull(s)) { | 329 if (leveldb_env::IndicatesDiskFull(s)) { |
| 326 error = IndexedDBDatabaseError( | 330 error = IndexedDBDatabaseError( |
| 327 blink::WebIDBDatabaseExceptionQuotaError, | 331 blink::WebIDBDatabaseExceptionQuotaError, |
| 328 "Encountered disk full while committing transaction."); | 332 "Encountered disk full while committing transaction."); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 400 } | 404 } |
| 401 } | 405 } |
| 402 | 406 |
| 403 void IndexedDBTransaction::Timeout() { | 407 void IndexedDBTransaction::Timeout() { |
| 404 Abort(IndexedDBDatabaseError( | 408 Abort(IndexedDBDatabaseError( |
| 405 blink::WebIDBDatabaseExceptionTimeoutError, | 409 blink::WebIDBDatabaseExceptionTimeoutError, |
| 406 base::ASCIIToUTF16("Transaction timed out due to inactivity."))); | 410 base::ASCIIToUTF16("Transaction timed out due to inactivity."))); |
| 407 } | 411 } |
| 408 | 412 |
| 409 void IndexedDBTransaction::CloseOpenCursors() { | 413 void IndexedDBTransaction::CloseOpenCursors() { |
| 414 IDB_TRACE1("IndexedDBTransaction::CloseOpenCursors", "txn.id", id()); | |
| 410 for (auto* cursor : open_cursors_) | 415 for (auto* cursor : open_cursors_) |
| 411 cursor->Close(); | 416 cursor->Close(); |
| 412 open_cursors_.clear(); | 417 open_cursors_.clear(); |
| 413 } | 418 } |
| 414 | 419 |
| 415 } // namespace content | 420 } // namespace content |
| OLD | NEW |