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

Unified Diff: base/debug/stack_trace_posix.cc

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove redundant base:: prefix 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
Index: base/debug/stack_trace_posix.cc
diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc
index 0551784ebe4f09c98ac4557da63f833c77537f3c..791b1eff051f08a80b6d5184dc9a4c04ace3e6df 100644
--- a/base/debug/stack_trace_posix.cc
+++ b/base/debug/stack_trace_posix.cc
@@ -17,6 +17,7 @@
#include <unistd.h>
#include <map>
+#include <memory>
#include <ostream>
#include <string>
#include <vector>
@@ -38,7 +39,6 @@
#include "base/debug/proc_maps_linux.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
#include "base/numerics/safe_conversions.h"
#include "base/posix/eintr_wrapper.h"
@@ -99,7 +99,7 @@ void DemangleSymbols(std::string* text) {
// Try to demangle the mangled symbol candidate.
int status = 0;
- scoped_ptr<char, base::FreeDeleter> demangled_symbol(
+ std::unique_ptr<char, base::FreeDeleter> demangled_symbol(
abi::__cxa_demangle(mangled_symbol.c_str(), NULL, 0, &status));
if (status == 0) { // Demangling is successful.
// Remove the mangled symbol.
@@ -180,8 +180,8 @@ void ProcessBacktrace(void *const *trace,
// Below part is async-signal unsafe (uses malloc), so execute it only
// when we are not executing the signal handler.
if (in_signal_handler == 0) {
- scoped_ptr<char*, FreeDeleter>
- trace_symbols(backtrace_symbols(trace, size));
+ std::unique_ptr<char*, FreeDeleter> trace_symbols(
Nico 2016/04/04 17:14:55 (file doesn't iwyu for freedeleter i think)
dcheng 2016/04/04 17:43:38 Note that this CL isn't attempt to address IWYU gl
+ backtrace_symbols(trace, size));
if (trace_symbols.get()) {
for (size_t i = 0; i < size; ++i) {
std::string trace_symbol = trace_symbols.get()[i];

Powered by Google App Engine
This is Rietveld 408576698