Second attempt at introducing SafeSPrintf().
See original discussion at https://codereview.chromium.org/18656004/
Reverted as: https://codereview.chromium.org/23463010/
Added a new base::strings::SafeSPrintf() function that can
safely be called from all restricted (e.g. async-signal-safe)
environments. It is roughly equivalent to snprintf(). But
it is easier to use, as it uses C++ to be type-safe.
In release builds, this function is guaranteed to never call
any other library function nor any system calls. In debug
builds, we call RAW_CHECK() in some circumstances.
This code is needed for (at least) the seccomp sandbox and
to clean up code in the stack tracer. Those changes are
pending and will be submitted as separate CLs.
BUG=285499
TEST=base_unittests
TBR=willchan@chromium.org
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/23777003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221322 0039d316-1c4b-4281-b951-d872f2087c98
CrOS-Libchrome-Original-Commit: b845301df8b1069dc2870cece425f5d8e2b37593
5 files changed