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

Unified Diff: storage/browser/blob/blob_storage_context.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 | « storage/browser/blob/blob_reader.cc ('k') | storage/browser/blob/blob_url_request_job_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: storage/browser/blob/blob_storage_context.cc
diff --git a/storage/browser/blob/blob_storage_context.cc b/storage/browser/blob/blob_storage_context.cc
index e9e9601cdb43571586a6c8b59205cc8ed509f311..e8fc0085cdf19852b6a8d4376051f4e96cd41ff6 100644
--- a/storage/browser/blob/blob_storage_context.cc
+++ b/storage/browser/blob/blob_storage_context.cc
@@ -6,9 +6,9 @@
#include <stddef.h>
#include <stdint.h>
-
#include <algorithm>
#include <limits>
+#include <utility>
#include "base/bind.h"
#include "base/location.h"
@@ -75,15 +75,15 @@ scoped_ptr<BlobDataHandle> BlobStorageContext::GetBlobDataFromUUID(
scoped_ptr<BlobDataHandle> result;
BlobMap::iterator found = blob_map_.find(uuid);
if (found == blob_map_.end())
- return result.Pass();
+ return result;
auto* entry = found->second;
if (entry->flags & EXCEEDED_MEMORY)
- return result.Pass();
+ return result;
DCHECK(!entry->IsBeingBuilt());
result.reset(new BlobDataHandle(uuid, entry->data->content_type(),
entry->data->content_disposition(), this,
base::ThreadTaskRunnerHandle::Get().get()));
- return result.Pass();
+ return result;
}
scoped_ptr<BlobDataHandle> BlobStorageContext::GetBlobDataFromPublicURL(
@@ -119,7 +119,7 @@ scoped_ptr<BlobDataHandle> BlobStorageContext::AddFinishedBlob(
scoped_ptr<BlobDataHandle> handle =
GetBlobDataFromUUID(external_builder.uuid_);
DecrementBlobRefCount(external_builder.uuid_);
- return handle.Pass();
+ return handle;
}
scoped_ptr<BlobDataHandle> BlobStorageContext::AddFinishedBlob(
@@ -273,25 +273,25 @@ scoped_refptr<BlobDataItem> BlobStorageContext::AllocateBlobItem(
case DataElement::TYPE_BYTES:
DCHECK(!ipc_data.offset());
element->SetToBytes(ipc_data.bytes(), length);
- blob_item = new BlobDataItem(element.Pass());
+ blob_item = new BlobDataItem(std::move(element));
break;
case DataElement::TYPE_FILE:
element->SetToFilePathRange(ipc_data.path(), ipc_data.offset(), length,
ipc_data.expected_modification_time());
blob_item = new BlobDataItem(
- element.Pass(), ShareableFileReference::Get(ipc_data.path()));
+ std::move(element), ShareableFileReference::Get(ipc_data.path()));
break;
case DataElement::TYPE_FILE_FILESYSTEM:
element->SetToFileSystemUrlRange(ipc_data.filesystem_url(),
ipc_data.offset(), length,
ipc_data.expected_modification_time());
- blob_item = new BlobDataItem(element.Pass());
+ blob_item = new BlobDataItem(std::move(element));
break;
case DataElement::TYPE_BLOB:
// This is a temporary item that will be deconstructed later.
element->SetToBlobRange(ipc_data.blob_uuid(), ipc_data.offset(),
ipc_data.length());
- blob_item = new BlobDataItem(element.Pass());
+ blob_item = new BlobDataItem(std::move(element));
break;
case DataElement::TYPE_DISK_CACHE_ENTRY: // This type can't be sent by IPC.
NOTREACHED();
@@ -447,7 +447,7 @@ bool BlobStorageContext::AppendBlob(
static_cast<int64_t>(new_length));
memory_usage_ += new_length;
target_blob_builder->AppendSharedBlobItem(new ShareableBlobDataItem(
- target_blob_uuid, new BlobDataItem(element.Pass())));
+ target_blob_uuid, new BlobDataItem(std::move(element))));
} break;
case DataElement::TYPE_FILE: {
DCHECK_NE(item.length(), std::numeric_limits<uint64_t>::max())
@@ -460,7 +460,7 @@ bool BlobStorageContext::AppendBlob(
item.expected_modification_time());
target_blob_builder->AppendSharedBlobItem(new ShareableBlobDataItem(
target_blob_uuid,
- new BlobDataItem(element.Pass(), item.data_handle_)));
+ new BlobDataItem(std::move(element), item.data_handle_)));
} break;
case DataElement::TYPE_FILE_FILESYSTEM: {
UMA_HISTOGRAM_COUNTS("Storage.BlobItemSize.BlobSlice.FileSystem",
@@ -470,7 +470,7 @@ bool BlobStorageContext::AppendBlob(
item.offset() + offset, new_length,
item.expected_modification_time());
target_blob_builder->AppendSharedBlobItem(new ShareableBlobDataItem(
- target_blob_uuid, new BlobDataItem(element.Pass())));
+ target_blob_uuid, new BlobDataItem(std::move(element))));
} break;
case DataElement::TYPE_DISK_CACHE_ENTRY: {
scoped_ptr<DataElement> element(new DataElement());
@@ -478,7 +478,7 @@ bool BlobStorageContext::AppendBlob(
new_length);
target_blob_builder->AppendSharedBlobItem(new ShareableBlobDataItem(
target_blob_uuid,
- new BlobDataItem(element.Pass(), item.data_handle_,
+ new BlobDataItem(std::move(element), item.data_handle_,
item.disk_cache_entry(),
item.disk_cache_stream_index())));
} break;
« no previous file with comments | « storage/browser/blob/blob_reader.cc ('k') | storage/browser/blob/blob_url_request_job_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698