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

Side by Side Diff: base/debug/stack_trace_posix.cc

Issue 169193002: Convert scoped_ptr_malloc -> scoped_ptr, part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/common/net/x509_certificate_model_nss.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/debug/stack_trace.h" 5 #include "base/debug/stack_trace.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <execinfo.h> 8 #include <execinfo.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <signal.h> 10 #include <signal.h>
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 handler->HandleOutput("<unknown>"); 144 handler->HandleOutput("<unknown>");
145 145
146 handler->HandleOutput("\n"); 146 handler->HandleOutput("\n");
147 } 147 }
148 #else 148 #else
149 bool printed = false; 149 bool printed = false;
150 150
151 // Below part is async-signal unsafe (uses malloc), so execute it only 151 // Below part is async-signal unsafe (uses malloc), so execute it only
152 // when we are not executing the signal handler. 152 // when we are not executing the signal handler.
153 if (in_signal_handler == 0) { 153 if (in_signal_handler == 0) {
154 scoped_ptr_malloc<char*> trace_symbols(backtrace_symbols(trace, size)); 154 scoped_ptr<char*, FreeDeleter>
155 trace_symbols(backtrace_symbols(trace, size));
155 if (trace_symbols.get()) { 156 if (trace_symbols.get()) {
156 for (int i = 0; i < size; ++i) { 157 for (int i = 0; i < size; ++i) {
157 std::string trace_symbol = trace_symbols.get()[i]; 158 std::string trace_symbol = trace_symbols.get()[i];
158 DemangleSymbols(&trace_symbol); 159 DemangleSymbols(&trace_symbol);
159 handler->HandleOutput(trace_symbol.c_str()); 160 handler->HandleOutput(trace_symbol.c_str());
160 handler->HandleOutput("\n"); 161 handler->HandleOutput("\n");
161 } 162 }
162 163
163 printed = true; 164 printed = true;
164 } 165 }
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 *ptr = *start; 548 *ptr = *start;
548 *start++ = ch; 549 *start++ = ch;
549 } 550 }
550 return buf; 551 return buf;
551 } 552 }
552 553
553 } // namespace internal 554 } // namespace internal
554 555
555 } // namespace debug 556 } // namespace debug
556 } // namespace base 557 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | chrome/common/net/x509_certificate_model_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698