| 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 <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 db_->CreateObjectStore(transaction_->id(), | 383 db_->CreateObjectStore(transaction_->id(), |
| 384 store_id, | 384 store_id, |
| 385 ASCIIToUTF16("store"), | 385 ASCIIToUTF16("store"), |
| 386 IndexedDBKeyPath(), | 386 IndexedDBKeyPath(), |
| 387 false /*auto_increment*/); | 387 false /*auto_increment*/); |
| 388 EXPECT_EQ(1ULL, db_->metadata().object_stores.size()); | 388 EXPECT_EQ(1ULL, db_->metadata().object_stores.size()); |
| 389 | 389 |
| 390 | 390 |
| 391 // Put is asynchronous | 391 // Put is asynchronous |
| 392 IndexedDBValue value("value1", std::vector<IndexedDBBlobInfo>()); | 392 IndexedDBValue value("value1", std::vector<IndexedDBBlobInfo>()); |
| 393 ScopedVector<storage::BlobDataHandle> handles; | 393 ScopedVector<storage::BlobDataSnapshotHandle> handles; |
| 394 scoped_ptr<IndexedDBKey> key(new IndexedDBKey("key")); | 394 scoped_ptr<IndexedDBKey> key(new IndexedDBKey("key")); |
| 395 std::vector<IndexedDBDatabase::IndexKeys> index_keys; | 395 std::vector<IndexedDBDatabase::IndexKeys> index_keys; |
| 396 scoped_refptr<MockIndexedDBCallbacks> request( | 396 scoped_refptr<MockIndexedDBCallbacks> request( |
| 397 new MockIndexedDBCallbacks(false)); | 397 new MockIndexedDBCallbacks(false)); |
| 398 db_->Put(transaction_->id(), | 398 db_->Put(transaction_->id(), |
| 399 store_id, | 399 store_id, |
| 400 &value, | 400 &value, |
| 401 &handles, | 401 &handles, |
| 402 key.Pass(), | 402 key.Pass(), |
| 403 blink::WebIDBPutModeAddOnly, | 403 blink::WebIDBPutModeAddOnly, |
| 404 request, | 404 request, |
| 405 index_keys); | 405 index_keys); |
| 406 | 406 |
| 407 // Deletion is asynchronous. | 407 // Deletion is asynchronous. |
| 408 db_->DeleteObjectStore(transaction_->id(), | 408 db_->DeleteObjectStore(transaction_->id(), |
| 409 store_id); | 409 store_id); |
| 410 EXPECT_EQ(1ULL, db_->metadata().object_stores.size()); | 410 EXPECT_EQ(1ULL, db_->metadata().object_stores.size()); |
| 411 | 411 |
| 412 // This will execute the Put then Delete. | 412 // This will execute the Put then Delete. |
| 413 RunPostedTasks(); | 413 RunPostedTasks(); |
| 414 EXPECT_EQ(0ULL, db_->metadata().object_stores.size()); | 414 EXPECT_EQ(0ULL, db_->metadata().object_stores.size()); |
| 415 | 415 |
| 416 transaction_->Commit(); // Cleans up the object hierarchy. | 416 transaction_->Commit(); // Cleans up the object hierarchy. |
| 417 } | 417 } |
| 418 | 418 |
| 419 } // namespace content | 419 } // namespace content |
| OLD | NEW |