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

Unified Diff: base/metrics/persistent_histogram_allocator.cc

Issue 2258713003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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/histogram.cc ('k') | base/metrics/persistent_histogram_allocator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/persistent_histogram_allocator.cc
diff --git a/base/metrics/persistent_histogram_allocator.cc b/base/metrics/persistent_histogram_allocator.cc
index cad464227d20276a07aee857aa7b4aef02a0aa6d..c4d8c95d68da1bf7f36eba9c8538e3d790728486 100644
--- a/base/metrics/persistent_histogram_allocator.cc
+++ b/base/metrics/persistent_histogram_allocator.cc
@@ -117,7 +117,7 @@ PersistentSparseHistogramDataManager::GetSampleMapRecordsWhileLocked(
return found->second.get();
std::unique_ptr<PersistentSampleMapRecords>& samples = sample_records_[id];
- samples = WrapUnique(new PersistentSampleMapRecords(this, id));
+ samples = MakeUnique<PersistentSampleMapRecords>(this, id);
return samples.get();
}
@@ -670,9 +670,9 @@ void GlobalHistogramAllocator::CreateWithPersistentMemory(
size_t page_size,
uint64_t id,
StringPiece name) {
- Set(WrapUnique(new GlobalHistogramAllocator(
- WrapUnique(new PersistentMemoryAllocator(
- base, size, page_size, id, name, false)))));
+ Set(WrapUnique(
+ new GlobalHistogramAllocator(MakeUnique<PersistentMemoryAllocator>(
+ base, size, page_size, id, name, false))));
}
// static
@@ -681,7 +681,7 @@ void GlobalHistogramAllocator::CreateWithLocalMemory(
uint64_t id,
StringPiece name) {
Set(WrapUnique(new GlobalHistogramAllocator(
- WrapUnique(new LocalPersistentMemoryAllocator(size, id, name)))));
+ MakeUnique<LocalPersistentMemoryAllocator>(size, id, name))));
}
#if !defined(OS_NACL)
@@ -709,9 +709,9 @@ void GlobalHistogramAllocator::CreateWithFile(
return;
}
- Set(WrapUnique(new GlobalHistogramAllocator(
- WrapUnique(new FilePersistentMemoryAllocator(
- std::move(mmfile), size, id, name, false)))));
+ Set(WrapUnique(
+ new GlobalHistogramAllocator(MakeUnique<FilePersistentMemoryAllocator>(
+ std::move(mmfile), size, id, name, false))));
}
#endif
@@ -728,9 +728,9 @@ void GlobalHistogramAllocator::CreateWithSharedMemory(
}
DCHECK_LE(memory->mapped_size(), size);
- Set(WrapUnique(new GlobalHistogramAllocator(
- WrapUnique(new SharedPersistentMemoryAllocator(
- std::move(memory), 0, StringPiece(), /*readonly=*/false)))));
+ Set(WrapUnique(
+ new GlobalHistogramAllocator(MakeUnique<SharedPersistentMemoryAllocator>(
+ std::move(memory), 0, StringPiece(), /*readonly=*/false))));
}
// static
@@ -745,9 +745,9 @@ void GlobalHistogramAllocator::CreateWithSharedMemoryHandle(
return;
}
- Set(WrapUnique(new GlobalHistogramAllocator(
- WrapUnique(new SharedPersistentMemoryAllocator(
- std::move(shm), 0, StringPiece(), /*readonly=*/false)))));
+ Set(WrapUnique(
+ new GlobalHistogramAllocator(MakeUnique<SharedPersistentMemoryAllocator>(
+ std::move(shm), 0, StringPiece(), /*readonly=*/false))));
}
// static
« no previous file with comments | « base/metrics/histogram.cc ('k') | base/metrics/persistent_histogram_allocator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698