Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: content/browser/indexed_db/indexed_db_database_unittest.cc

Issue 2255853003: IndexedDB: ScopedVector<T> -> vector<unique_ptr<T>> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review feedback Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 db_->CreateObjectStore(transaction_->id(), 390 db_->CreateObjectStore(transaction_->id(),
391 store_id, 391 store_id,
392 ASCIIToUTF16("store"), 392 ASCIIToUTF16("store"),
393 IndexedDBKeyPath(), 393 IndexedDBKeyPath(),
394 false /*auto_increment*/); 394 false /*auto_increment*/);
395 EXPECT_EQ(1ULL, db_->metadata().object_stores.size()); 395 EXPECT_EQ(1ULL, db_->metadata().object_stores.size());
396 396
397 397
398 // Put is asynchronous 398 // Put is asynchronous
399 IndexedDBValue value("value1", std::vector<IndexedDBBlobInfo>()); 399 IndexedDBValue value("value1", std::vector<IndexedDBBlobInfo>());
400 ScopedVector<storage::BlobDataHandle> handles; 400 std::vector<std::unique_ptr<storage::BlobDataHandle>> handles;
401 std::unique_ptr<IndexedDBKey> key(base::MakeUnique<IndexedDBKey>("key")); 401 std::unique_ptr<IndexedDBKey> key(base::MakeUnique<IndexedDBKey>("key"));
402 std::vector<IndexedDBDatabase::IndexKeys> index_keys; 402 std::vector<IndexedDBDatabase::IndexKeys> index_keys;
403 scoped_refptr<MockIndexedDBCallbacks> request( 403 scoped_refptr<MockIndexedDBCallbacks> request(
404 new MockIndexedDBCallbacks(false)); 404 new MockIndexedDBCallbacks(false));
405 db_->Put(transaction_->id(), store_id, &value, &handles, std::move(key), 405 db_->Put(transaction_->id(), store_id, &value, &handles, std::move(key),
406 blink::WebIDBPutModeAddOnly, request, index_keys); 406 blink::WebIDBPutModeAddOnly, request, index_keys);
407 407
408 // Deletion is asynchronous. 408 // Deletion is asynchronous.
409 db_->DeleteObjectStore(transaction_->id(), 409 db_->DeleteObjectStore(transaction_->id(),
410 store_id); 410 store_id);
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
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_database.cc ('k') | content/browser/indexed_db/indexed_db_dispatcher_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698