| 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 request_ = new MockIndexedDBCallbacks(); | 250 request_ = new MockIndexedDBCallbacks(); |
| 251 callbacks_ = new MockIndexedDBDatabaseCallbacks(); | 251 callbacks_ = new MockIndexedDBDatabaseCallbacks(); |
| 252 const int64_t transaction_id = 1; | 252 const int64_t transaction_id = 1; |
| 253 std::unique_ptr<IndexedDBPendingConnection> connection( | 253 std::unique_ptr<IndexedDBPendingConnection> connection( |
| 254 new IndexedDBPendingConnection( | 254 new IndexedDBPendingConnection( |
| 255 request_, callbacks_, kFakeChildProcessId, transaction_id, | 255 request_, callbacks_, kFakeChildProcessId, transaction_id, |
| 256 IndexedDBDatabaseMetadata::DEFAULT_VERSION)); | 256 IndexedDBDatabaseMetadata::DEFAULT_VERSION)); |
| 257 db_->OpenConnection(std::move(connection)); | 257 db_->OpenConnection(std::move(connection)); |
| 258 EXPECT_EQ(IndexedDBDatabaseMetadata::NO_VERSION, db_->metadata().version); | 258 EXPECT_EQ(IndexedDBDatabaseMetadata::NO_VERSION, db_->metadata().version); |
| 259 | 259 |
| 260 connection_ = base::WrapUnique(new IndexedDBConnection(db_, callbacks_)); | 260 connection_ = base::MakeUnique<IndexedDBConnection>(db_, callbacks_); |
| 261 transaction_ = IndexedDBClassFactory::Get()->CreateIndexedDBTransaction( | 261 transaction_ = IndexedDBClassFactory::Get()->CreateIndexedDBTransaction( |
| 262 transaction_id, connection_->GetWeakPtr(), | 262 transaction_id, connection_->GetWeakPtr(), |
| 263 std::set<int64_t>() /*scope*/, | 263 std::set<int64_t>() /*scope*/, |
| 264 blink::WebIDBTransactionModeVersionChange, | 264 blink::WebIDBTransactionModeVersionChange, |
| 265 new IndexedDBFakeBackingStore::FakeTransaction(commit_success_)); | 265 new IndexedDBFakeBackingStore::FakeTransaction(commit_success_)); |
| 266 db_->TransactionCreated(transaction_.get()); | 266 db_->TransactionCreated(transaction_.get()); |
| 267 | 267 |
| 268 // Add a dummy task which takes the place of the VersionChangeOperation | 268 // Add a dummy task which takes the place of the VersionChangeOperation |
| 269 // which kicks off the upgrade. This ensures that the transaction has | 269 // which kicks off the upgrade. This ensures that the transaction has |
| 270 // processed at least one task before the CreateObjectStore call. | 270 // processed at least one task before the CreateObjectStore call. |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 EXPECT_EQ(1ULL, db_->metadata().object_stores.size()); | 411 EXPECT_EQ(1ULL, db_->metadata().object_stores.size()); |
| 412 | 412 |
| 413 // This will execute the Put then Delete. | 413 // This will execute the Put then Delete. |
| 414 RunPostedTasks(); | 414 RunPostedTasks(); |
| 415 EXPECT_EQ(0ULL, db_->metadata().object_stores.size()); | 415 EXPECT_EQ(0ULL, db_->metadata().object_stores.size()); |
| 416 | 416 |
| 417 transaction_->Commit(); // Cleans up the object hierarchy. | 417 transaction_->Commit(); // Cleans up the object hierarchy. |
| 418 } | 418 } |
| 419 | 419 |
| 420 } // namespace content | 420 } // namespace content |
| OLD | NEW |