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

Unified Diff: base/debug/stack_trace_posix.cc

Issue 2632643004: Remove WTFReportAssertionFailure and WTFReportBacktrace. (Closed)
Patch Set: Address review comments Created 3 years, 11 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/debug/stack_trace_android.cc ('k') | base/debug/stack_trace_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/stack_trace_posix.cc
diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc
index da86bdc059b303634fb4db5e9eb957cc7a10e6a7..ebd18525b9ae73675995bc4d44af960f378627a7 100644
--- a/base/debug/stack_trace_posix.cc
+++ b/base/debug/stack_trace_posix.cc
@@ -16,6 +16,7 @@
#include <sys/types.h>
#include <unistd.h>
+#include <algorithm>
#include <map>
#include <memory>
#include <ostream>
@@ -716,14 +717,16 @@ bool EnableInProcessStackDumping() {
return success;
}
-StackTrace::StackTrace() {
- // NOTE: This code MUST be async-signal safe (it's used by in-process
- // stack dumping signal handler). NO malloc or stdio is allowed here.
+StackTrace::StackTrace(size_t count) {
+// NOTE: This code MUST be async-signal safe (it's used by in-process
+// stack dumping signal handler). NO malloc or stdio is allowed here.
#if !defined(__UCLIBC__)
+ count = std::min(arraysize(trace_), count);
+
// Though the backtrace API man page does not list any possible negative
// return values, we take no chance.
- count_ = base::saturated_cast<size_t>(backtrace(trace_, arraysize(trace_)));
+ count_ = base::saturated_cast<size_t>(backtrace(trace_, count));
#else
count_ = 0;
#endif
« no previous file with comments | « base/debug/stack_trace_android.cc ('k') | base/debug/stack_trace_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698