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

Unified Diff: content/common/host_discardable_shared_memory_manager.cc

Issue 1544293002: Convert Pass()→std::move() in //content (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: content/common/host_discardable_shared_memory_manager.cc
diff --git a/content/common/host_discardable_shared_memory_manager.cc b/content/common/host_discardable_shared_memory_manager.cc
index d897b7134ee8173decd8c4904bc3b2d94402539d..a97cf7a9350bc75200cd6be72ba98241c7708fc2 100644
--- a/content/common/host_discardable_shared_memory_manager.cc
+++ b/content/common/host_discardable_shared_memory_manager.cc
@@ -5,6 +5,7 @@
#include "content/common/host_discardable_shared_memory_manager.h"
#include <algorithm>
+#include <utility>
#include "base/atomic_sequence_num.h"
#include "base/bind.h"
@@ -34,7 +35,7 @@ class DiscardableMemoryImpl : public base::DiscardableMemory {
public:
DiscardableMemoryImpl(scoped_ptr<base::DiscardableSharedMemory> shared_memory,
const base::Closure& deleted_callback)
- : shared_memory_(shared_memory.Pass()),
+ : shared_memory_(std::move(shared_memory)),
deleted_callback_(deleted_callback),
is_locked_(true) {}
@@ -106,8 +107,7 @@ base::StaticAtomicSequenceNumber g_next_discardable_shared_memory_id;
HostDiscardableSharedMemoryManager::MemorySegment::MemorySegment(
scoped_ptr<base::DiscardableSharedMemory> memory)
- : memory_(memory.Pass()) {
-}
+ : memory_(std::move(memory)) {}
HostDiscardableSharedMemoryManager::MemorySegment::~MemorySegment() {
}
@@ -167,7 +167,7 @@ HostDiscardableSharedMemoryManager::AllocateLockedDiscardableMemory(
// Close file descriptor to avoid running out.
memory->Close();
return make_scoped_ptr(new DiscardableMemoryImpl(
- memory.Pass(),
+ std::move(memory),
base::Bind(
&HostDiscardableSharedMemoryManager::DeletedDiscardableSharedMemory,
base::Unretained(this), new_id, ChildProcessHost::kInvalidUniqueID)));
@@ -346,7 +346,7 @@ void HostDiscardableSharedMemoryManager::AllocateLockedDiscardableSharedMemory(
bytes_allocated_ = checked_bytes_allocated.ValueOrDie();
BytesAllocatedChanged(bytes_allocated_);
- scoped_refptr<MemorySegment> segment(new MemorySegment(memory.Pass()));
+ scoped_refptr<MemorySegment> segment(new MemorySegment(std::move(memory)));
process_segments[id] = segment.get();
segments_.push_back(segment.get());
std::push_heap(segments_.begin(), segments_.end(), CompareMemoryUsageTime);
« no previous file with comments | « content/common/gpu/media/gpu_video_encode_accelerator.cc ('k') | content/common/host_shared_bitmap_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698