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

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: 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 a9bab4783dd2bcc49150d9a03d343d1ef89b37d3..505982649f18cdb173be3f547f808b5177fb89a1 100644
--- a/sync/internal_api/attachments/on_disk_attachment_store.cc
+++ b/sync/internal_api/attachments/on_disk_attachment_store.cc
@@ -2,9 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "sync/internal_api/public/attachments/on_disk_attachment_store.h"
-
#include <string>
+#include <utility>
#include "base/bind.h"
#include "base/callback.h"
@@ -14,6 +13,7 @@
#include "base/sequenced_task_runner.h"
#include "sync/internal_api/attachments/proto/attachment_store.pb.h"
#include "sync/internal_api/public/attachments/attachment_util.h"
+#include "sync/internal_api/public/attachments/on_disk_attachment_store.h"
Nicolas Zea 2015/12/18 23:46:55 keep up top
#include "sync/protocol/attachments.pb.h"
#include "third_party/leveldatabase/env_chromium.h"
#include "third_party/leveldatabase/src/include/leveldb/db.h"
@@ -397,7 +397,7 @@ AttachmentStore::Result OnDiskAttachmentStore::OpenOrCreate(
return AttachmentStore::UNSPECIFIED_ERROR;
}
- db_ = db.Pass();
+ db_ = std::move(db);
return AttachmentStore::SUCCESS;
}
@@ -407,11 +407,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;
@@ -419,7 +419,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);
@@ -427,16 +427,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