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

Unified Diff: base/debug/stack_trace_android.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.cc ('k') | base/debug/stack_trace_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/stack_trace_android.cc
diff --git a/base/debug/stack_trace_android.cc b/base/debug/stack_trace_android.cc
index 1e8038568e13bc5058d9d154d22d2110bc52b2cb..329204c8c6a3824fbac6b102a25ab7152ef3addb 100644
--- a/base/debug/stack_trace_android.cc
+++ b/base/debug/stack_trace_android.cc
@@ -7,6 +7,8 @@
#include <android/log.h>
#include <stddef.h>
#include <unwind.h>
+
+#include <algorithm>
#include <ostream>
#include "base/debug/proc_maps_linux.h"
@@ -67,8 +69,10 @@ bool EnableInProcessStackDumping() {
return (sigaction(SIGPIPE, &action, NULL) == 0);
}
-StackTrace::StackTrace() {
- StackCrawlState state(reinterpret_cast<uintptr_t*>(trace_), kMaxTraces);
+StackTrace::StackTrace(size_t count) {
+ count = std::min(arraysize(trace_), count);
+
+ StackCrawlState state(reinterpret_cast<uintptr_t*>(trace_), count);
_Unwind_Backtrace(&TraceStackFrame, &state);
count_ = state.frame_count;
}
« no previous file with comments | « base/debug/stack_trace.cc ('k') | base/debug/stack_trace_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698