base: Refactor function to collect stack traces

Currently base::debug::StackTrace collects a stack trace in its
constructor; however, this doesn't allow users to control the amount of
memory allocated per stack trace. The maximum stack trace length is
currently has each StackTrace consuming 2kb of memory on non-Windows
platforms. This is far too much for GWP-ASan which currently stores
hundreds of StackTraces.

Instead, have StackTrace use a publicly exposed function that allows
callers to specify the size of the stack trace.

Bug: 912286
Change-Id: Ib0ba0ec645df8801568b983fe86ee156259ecb84
Reviewed-on: https://chromium-review.googlesource.com/c/1408218
Commit-Queue: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
Reviewed-by: Albert J. Wong <ajwong@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625067}
6 files changed