| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_database.h" | 5 #include "content/browser/indexed_db/indexed_db_database.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 db_, callbacks_); | 328 db_, callbacks_); |
| 329 transaction_ = connection_->CreateTransaction( | 329 transaction_ = connection_->CreateTransaction( |
| 330 transaction_id, std::set<int64_t>() /*scope*/, | 330 transaction_id, std::set<int64_t>() /*scope*/, |
| 331 blink::kWebIDBTransactionModeVersionChange, | 331 blink::kWebIDBTransactionModeVersionChange, |
| 332 new IndexedDBFakeBackingStore::FakeTransaction(commit_success_)); | 332 new IndexedDBFakeBackingStore::FakeTransaction(commit_success_)); |
| 333 db_->TransactionCreated(transaction_); | 333 db_->TransactionCreated(transaction_); |
| 334 | 334 |
| 335 // Add a dummy task which takes the place of the VersionChangeOperation | 335 // Add a dummy task which takes the place of the VersionChangeOperation |
| 336 // which kicks off the upgrade. This ensures that the transaction has | 336 // which kicks off the upgrade. This ensures that the transaction has |
| 337 // processed at least one task before the CreateObjectStore call. | 337 // processed at least one task before the CreateObjectStore call. |
| 338 transaction_->ScheduleTask(base::Bind(&DummyOperation)); | 338 transaction_->ScheduleTask(base::BindOnce(&DummyOperation)); |
| 339 } | 339 } |
| 340 | 340 |
| 341 void RunPostedTasks() { base::RunLoop().RunUntilIdle(); } | 341 void RunPostedTasks() { base::RunLoop().RunUntilIdle(); } |
| 342 | 342 |
| 343 private: | 343 private: |
| 344 // Needs to outlive |db_|. | 344 // Needs to outlive |db_|. |
| 345 content::TestBrowserThreadBundle thread_bundle_; | 345 content::TestBrowserThreadBundle thread_bundle_; |
| 346 | 346 |
| 347 protected: | 347 protected: |
| 348 scoped_refptr<IndexedDBFakeBackingStore> backing_store_; | 348 scoped_refptr<IndexedDBFakeBackingStore> backing_store_; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 EXPECT_EQ(1ULL, db_->metadata().object_stores.size()); | 455 EXPECT_EQ(1ULL, db_->metadata().object_stores.size()); |
| 456 | 456 |
| 457 // This will execute the Put then Delete. | 457 // This will execute the Put then Delete. |
| 458 RunPostedTasks(); | 458 RunPostedTasks(); |
| 459 EXPECT_EQ(0ULL, db_->metadata().object_stores.size()); | 459 EXPECT_EQ(0ULL, db_->metadata().object_stores.size()); |
| 460 | 460 |
| 461 transaction_->Commit(); // Cleans up the object hierarchy. | 461 transaction_->Commit(); // Cleans up the object hierarchy. |
| 462 } | 462 } |
| 463 | 463 |
| 464 } // namespace content | 464 } // namespace content |
| OLD | NEW |