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

Unified Diff: storage/browser/blob/blob_data_builder.cc

Issue 1546243002: Convert Pass()→std::move() in //storage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | storage/browser/blob/blob_data_handle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: storage/browser/blob/blob_data_builder.cc
diff --git a/storage/browser/blob/blob_data_builder.cc b/storage/browser/blob/blob_data_builder.cc
index d40d4186f80e4ea6faad15c2818425619abdabdc..b6999104b95107beac45c5ba7de5b8538c435542 100644
--- a/storage/browser/blob/blob_data_builder.cc
+++ b/storage/browser/blob/blob_data_builder.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <utility>
#include "base/numerics/safe_conversions.h"
#include "base/numerics/safe_math.h"
@@ -57,14 +58,14 @@ void BlobDataBuilder::AppendData(const char* data, size_t length) {
return;
scoped_ptr<DataElement> element(new DataElement());
element->SetToBytes(data, length);
- items_.push_back(new BlobDataItem(element.Pass()));
+ items_.push_back(new BlobDataItem(std::move(element)));
}
size_t BlobDataBuilder::AppendFutureData(size_t length) {
CHECK_NE(length, 0u);
scoped_ptr<DataElement> element(new DataElement());
element->SetToBytesDescription(length);
- items_.push_back(new BlobDataItem(element.Pass()));
+ items_.push_back(new BlobDataItem(std::move(element)));
return items_.size() - 1;
}
@@ -107,7 +108,7 @@ size_t BlobDataBuilder::AppendFutureFile(uint64_t offset, uint64_t length) {
element->SetToFilePathRange(base::FilePath::FromUTF8Unsafe(std::string(
kAppendFutureFileTemporaryFileName)),
offset, length, base::Time());
- items_.push_back(new BlobDataItem(element.Pass()));
+ items_.push_back(new BlobDataItem(std::move(element)));
return items_.size() - 1;
}
@@ -131,7 +132,7 @@ bool BlobDataBuilder::PopulateFutureFile(
scoped_ptr<DataElement> element(new DataElement());
element->SetToFilePathRange(file_reference->path(), offset, length,
expected_modification_time);
- items_[index] = new BlobDataItem(element.Pass(), file_reference);
+ items_[index] = new BlobDataItem(std::move(element), file_reference);
return true;
}
@@ -142,8 +143,8 @@ void BlobDataBuilder::AppendFile(const base::FilePath& file_path,
scoped_ptr<DataElement> element(new DataElement());
element->SetToFilePathRange(file_path, offset, length,
expected_modification_time);
- items_.push_back(
- new BlobDataItem(element.Pass(), ShareableFileReference::Get(file_path)));
+ items_.push_back(new BlobDataItem(std::move(element),
+ ShareableFileReference::Get(file_path)));
}
void BlobDataBuilder::AppendBlob(const std::string& uuid,
@@ -152,13 +153,13 @@ void BlobDataBuilder::AppendBlob(const std::string& uuid,
DCHECK_GT(length, 0ul);
scoped_ptr<DataElement> element(new DataElement());
element->SetToBlobRange(uuid, offset, length);
- items_.push_back(new BlobDataItem(element.Pass()));
+ items_.push_back(new BlobDataItem(std::move(element)));
}
void BlobDataBuilder::AppendBlob(const std::string& uuid) {
scoped_ptr<DataElement> element(new DataElement());
element->SetToBlob(uuid);
- items_.push_back(new BlobDataItem(element.Pass()));
+ items_.push_back(new BlobDataItem(std::move(element)));
}
void BlobDataBuilder::AppendFileSystemFile(
@@ -170,7 +171,7 @@ void BlobDataBuilder::AppendFileSystemFile(
scoped_ptr<DataElement> element(new DataElement());
element->SetToFileSystemUrlRange(url, offset, length,
expected_modification_time);
- items_.push_back(new BlobDataItem(element.Pass()));
+ items_.push_back(new BlobDataItem(std::move(element)));
}
void BlobDataBuilder::AppendDiskCacheEntry(
@@ -180,9 +181,8 @@ void BlobDataBuilder::AppendDiskCacheEntry(
scoped_ptr<DataElement> element(new DataElement());
element->SetToDiskCacheEntryRange(
0U, disk_cache_entry->GetDataSize(disk_cache_stream_index));
- items_.push_back(
- new BlobDataItem(element.Pass(), data_handle, disk_cache_entry,
- disk_cache_stream_index));
+ items_.push_back(new BlobDataItem(std::move(element), data_handle,
+ disk_cache_entry, disk_cache_stream_index));
}
void BlobDataBuilder::Clear() {
« no previous file with comments | « no previous file | storage/browser/blob/blob_data_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698