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

Unified Diff: sync/internal_api/attachments/on_disk_attachment_store.cc

Issue 1539843002: Convert Pass()→std::move() in sync/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaned up 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
Index: sync/internal_api/attachments/on_disk_attachment_store.cc
diff --git a/sync/internal_api/attachments/on_disk_attachment_store.cc b/sync/internal_api/attachments/on_disk_attachment_store.cc
index c579c4598d83ac29957b61070c6342193f660991..ebdc3f82a7186f8b281d050303897bfd6878736a 100644
--- a/sync/internal_api/attachments/on_disk_attachment_store.cc
+++ b/sync/internal_api/attachments/on_disk_attachment_store.cc
@@ -5,8 +5,8 @@
#include "sync/internal_api/public/attachments/on_disk_attachment_store.h"
#include <stdint.h>
-
#include <string>
+#include <utility>
#include "base/bind.h"
#include "base/callback.h"
@@ -399,7 +399,7 @@ AttachmentStore::Result OnDiskAttachmentStore::OpenOrCreate(
return AttachmentStore::UNSPECIFIED_ERROR;
}
- db_ = db.Pass();
+ db_ = std::move(db);
return AttachmentStore::SUCCESS;
}
@@ -409,11 +409,11 @@ scoped_ptr<Attachment> OnDiskAttachmentStore::ReadSingleAttachment(
scoped_ptr<Attachment> attachment;
attachment_store_pb::RecordMetadata record_metadata;
if (!ReadSingleRecordMetadata(attachment_id, &record_metadata)) {
- return attachment.Pass();
+ return attachment;
}
if (!AttachmentHasReferenceFromComponent(record_metadata,
ComponentToProto(component)))
- return attachment.Pass();
+ return attachment;
const std::string key = MakeDataKeyFromAttachmentId(attachment_id);
std::string data_str;
@@ -421,7 +421,7 @@ scoped_ptr<Attachment> OnDiskAttachmentStore::ReadSingleAttachment(
MakeNonCachingReadOptions(), key, &data_str);
if (!status.ok()) {
DVLOG(1) << "DB::Get for data failed: status=" << status.ToString();
- return attachment.Pass();
+ return attachment;
}
scoped_refptr<base::RefCountedMemory> data =
base::RefCountedString::TakeString(&data_str);
@@ -429,16 +429,16 @@ scoped_ptr<Attachment> OnDiskAttachmentStore::ReadSingleAttachment(
if (record_metadata.has_crc32c()) {
if (record_metadata.crc32c() != crc32c) {
DVLOG(1) << "Attachment crc32c does not match value read from store";
- return attachment.Pass();
+ return attachment;
}
if (record_metadata.crc32c() != attachment_id.GetCrc32c()) {
DVLOG(1) << "Attachment crc32c does not match value in AttachmentId";
- return attachment.Pass();
+ return attachment;
}
}
attachment.reset(
new Attachment(Attachment::CreateFromParts(attachment_id, data)));
- return attachment.Pass();
+ return attachment;
}
bool OnDiskAttachmentStore::WriteSingleAttachment(

Powered by Google App Engine
This is Rietveld 408576698