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

Side by Side Diff: base/trace_event/process_memory_dump.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 unified diff | Download patch
« no previous file with comments | « base/trace_event/memory_dump_manager.cc ('k') | base/trace_event/trace_config.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/trace_event/process_memory_dump.h" 5 #include "base/trace_event/process_memory_dump.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 : has_process_totals_(false), 157 : has_process_totals_(false),
158 has_process_mmaps_(false), 158 has_process_mmaps_(false),
159 session_state_(std::move(session_state)), 159 session_state_(std::move(session_state)),
160 dump_args_(dump_args) {} 160 dump_args_(dump_args) {}
161 161
162 ProcessMemoryDump::~ProcessMemoryDump() {} 162 ProcessMemoryDump::~ProcessMemoryDump() {}
163 163
164 MemoryAllocatorDump* ProcessMemoryDump::CreateAllocatorDump( 164 MemoryAllocatorDump* ProcessMemoryDump::CreateAllocatorDump(
165 const std::string& absolute_name) { 165 const std::string& absolute_name) {
166 return AddAllocatorDumpInternal( 166 return AddAllocatorDumpInternal(
167 WrapUnique(new MemoryAllocatorDump(absolute_name, this))); 167 MakeUnique<MemoryAllocatorDump>(absolute_name, this));
168 } 168 }
169 169
170 MemoryAllocatorDump* ProcessMemoryDump::CreateAllocatorDump( 170 MemoryAllocatorDump* ProcessMemoryDump::CreateAllocatorDump(
171 const std::string& absolute_name, 171 const std::string& absolute_name,
172 const MemoryAllocatorDumpGuid& guid) { 172 const MemoryAllocatorDumpGuid& guid) {
173 return AddAllocatorDumpInternal( 173 return AddAllocatorDumpInternal(
174 WrapUnique(new MemoryAllocatorDump(absolute_name, this, guid))); 174 MakeUnique<MemoryAllocatorDump>(absolute_name, this, guid));
175 } 175 }
176 176
177 MemoryAllocatorDump* ProcessMemoryDump::AddAllocatorDumpInternal( 177 MemoryAllocatorDump* ProcessMemoryDump::AddAllocatorDumpInternal(
178 std::unique_ptr<MemoryAllocatorDump> mad) { 178 std::unique_ptr<MemoryAllocatorDump> mad) {
179 // In background mode return the black hole dump, if invalid dump name is 179 // In background mode return the black hole dump, if invalid dump name is
180 // given. 180 // given.
181 if (dump_args_.level_of_detail == MemoryDumpLevelOfDetail::BACKGROUND && 181 if (dump_args_.level_of_detail == MemoryDumpLevelOfDetail::BACKGROUND &&
182 !IsMemoryAllocatorDumpNameWhitelisted(mad->absolute_name())) { 182 !IsMemoryAllocatorDumpNameWhitelisted(mad->absolute_name())) {
183 return GetBlackHoleMad(); 183 return GetBlackHoleMad();
184 } 184 }
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 364
365 MemoryAllocatorDump* ProcessMemoryDump::GetBlackHoleMad() { 365 MemoryAllocatorDump* ProcessMemoryDump::GetBlackHoleMad() {
366 DCHECK(is_black_hole_non_fatal_for_testing_); 366 DCHECK(is_black_hole_non_fatal_for_testing_);
367 if (!black_hole_mad_) 367 if (!black_hole_mad_)
368 black_hole_mad_.reset(new MemoryAllocatorDump("discarded", this)); 368 black_hole_mad_.reset(new MemoryAllocatorDump("discarded", this));
369 return black_hole_mad_.get(); 369 return black_hole_mad_.get();
370 } 370 }
371 371
372 } // namespace trace_event 372 } // namespace trace_event
373 } // namespace base 373 } // namespace base
OLDNEW
« no previous file with comments | « base/trace_event/memory_dump_manager.cc ('k') | base/trace_event/trace_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698