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

Unified Diff: content/browser/indexed_db/indexed_db_backing_store.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 side-by-side diff with in-line comments
Download patch
Index: content/browser/indexed_db/indexed_db_backing_store.cc
diff --git a/content/browser/indexed_db/indexed_db_backing_store.cc b/content/browser/indexed_db/indexed_db_backing_store.cc
index 4ecceeb49c940ecf890135ea18cd301f7390f063..935d1909a60d513064f7c614ff0e6f9f86f00cb3 100644
--- a/content/browser/indexed_db/indexed_db_backing_store.cc
+++ b/content/browser/indexed_db/indexed_db_backing_store.cc
@@ -1902,7 +1902,7 @@ leveldb::Status IndexedDBBackingStore::PutRecord(
int64_t object_store_id,
const IndexedDBKey& key,
IndexedDBValue* value,
- ScopedVector<storage::BlobDataHandle>* handles,
+ std::vector<std::unique_ptr<storage::BlobDataHandle>>* handles,
RecordIdentifier* record_identifier) {
IDB_TRACE("IndexedDBBackingStore::PutRecord");
if (!KeyPrefix::ValidIds(database_id, object_store_id))
@@ -4367,7 +4367,7 @@ void IndexedDBBackingStore::BlobChangeRecord::SetBlobInfo(
}
void IndexedDBBackingStore::BlobChangeRecord::SetHandles(
- ScopedVector<storage::BlobDataHandle>* handles) {
+ std::vector<std::unique_ptr<storage::BlobDataHandle>>* handles) {
handles_.clear();
if (handles)
handles_.swap(*handles);
@@ -4379,8 +4379,10 @@ IndexedDBBackingStore::BlobChangeRecord::Clone() const {
new BlobChangeRecord(key_, object_store_id_));
record->blob_info_ = blob_info_;
- for (const auto* handle : handles_)
- record->handles_.push_back(new storage::BlobDataHandle(*handle));
+ for (const auto& handle : handles_) {
+ record->handles_.push_back(
+ base::MakeUnique<storage::BlobDataHandle>(*handle));
+ }
return record;
}
@@ -4389,7 +4391,7 @@ leveldb::Status IndexedDBBackingStore::Transaction::PutBlobInfoIfNeeded(
int64_t object_store_id,
const std::string& object_store_data_key,
std::vector<IndexedDBBlobInfo>* blob_info,
- ScopedVector<storage::BlobDataHandle>* handles) {
+ std::vector<std::unique_ptr<storage::BlobDataHandle>>* handles) {
if (!blob_info || blob_info->empty()) {
blob_change_map_.erase(object_store_data_key);
incognito_blob_map_.erase(object_store_data_key);
@@ -4424,7 +4426,7 @@ void IndexedDBBackingStore::Transaction::PutBlobInfo(
int64_t object_store_id,
const std::string& object_store_data_key,
std::vector<IndexedDBBlobInfo>* blob_info,
- ScopedVector<storage::BlobDataHandle>* handles) {
+ std::vector<std::unique_ptr<storage::BlobDataHandle>>* handles) {
DCHECK_GT(object_store_data_key.size(), 0UL);
if (database_id_ < 0)
database_id_ = database_id;
« no previous file with comments | « content/browser/indexed_db/indexed_db_backing_store.h ('k') | content/browser/indexed_db/indexed_db_backing_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698