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

Unified Diff: base/metrics/persistent_memory_allocator.cc

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 months 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 | « base/metrics/persistent_memory_allocator.h ('k') | base/metrics/persistent_memory_allocator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/persistent_memory_allocator.cc
diff --git a/base/metrics/persistent_memory_allocator.cc b/base/metrics/persistent_memory_allocator.cc
index a1a960c9bbc907601d83c461810d1c60ab0de1c8..1d5df333d04e68d0e9ccacb819a8a1afa79985fd 100644
--- a/base/metrics/persistent_memory_allocator.cc
+++ b/base/metrics/persistent_memory_allocator.cc
@@ -668,12 +668,16 @@ LocalPersistentMemoryAllocator::~LocalPersistentMemoryAllocator() {
//----- SharedPersistentMemoryAllocator ----------------------------------------
SharedPersistentMemoryAllocator::SharedPersistentMemoryAllocator(
- scoped_ptr<SharedMemory> memory,
+ std::unique_ptr<SharedMemory> memory,
uint64_t id,
base::StringPiece name,
bool read_only)
: PersistentMemoryAllocator(static_cast<uint8_t*>(memory->memory()),
- memory->mapped_size(), 0, id, name, read_only),
+ memory->mapped_size(),
+ 0,
+ id,
+ name,
+ read_only),
shared_memory_(std::move(memory)) {}
SharedPersistentMemoryAllocator::~SharedPersistentMemoryAllocator() {}
@@ -688,11 +692,15 @@ bool SharedPersistentMemoryAllocator::IsSharedMemoryAcceptable(
//----- FilePersistentMemoryAllocator ------------------------------------------
FilePersistentMemoryAllocator::FilePersistentMemoryAllocator(
- scoped_ptr<MemoryMappedFile> file,
+ std::unique_ptr<MemoryMappedFile> file,
uint64_t id,
base::StringPiece name)
: PersistentMemoryAllocator(const_cast<uint8_t*>(file->data()),
- file->length(), 0, id, name, true),
+ file->length(),
+ 0,
+ id,
+ name,
+ true),
mapped_file_(std::move(file)) {}
FilePersistentMemoryAllocator::~FilePersistentMemoryAllocator() {}
« no previous file with comments | « base/metrics/persistent_memory_allocator.h ('k') | base/metrics/persistent_memory_allocator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698