summaryrefslogtreecommitdiffstats
path: root/base/logging.cc
diff options
context:
space:
mode:
authortnagel <tnagel@chromium.org>2015-07-12 07:19:28 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-12 14:20:11 +0000
commit4a045d3f48f6d4e19414f6d24a62a61d1e7cac29 (patch)
tree18b34b011e4f3cc0dbb0cc9694b52b41d98dd375 /base/logging.cc
parentbe15c56b700d2f16523a22d5bdf8ab163b49112c (diff)
downloadchromium_src-4a045d3f48f6d4e19414f6d24a62a61d1e7cac29.zip
chromium_src-4a045d3f48f6d4e19414f6d24a62a61d1e7cac29.tar.gz
chromium_src-4a045d3f48f6d4e19414f6d24a62a61d1e7cac29.tar.bz2
Reduce inline code size for CHECK() on Android builds.
Create a separate LogMessage constructor for CHECK() which includes the "Check failed: ..." message and thus trims a function call from the inline code. This also allows to fold "Check failed: " into a single string instead of having one "Check failed: foo. " string per call site. Saves 74k from libchrome_public.so (27k from ChromePublic.apk). For the record: PCHECK() doesn't seems to be used in the Android part of the code, thus there's no need to optimize it. BUG=484684 Review URL: https://codereview.chromium.org/1232463008 Cr-Commit-Position: refs/heads/master@{#338453}
Diffstat (limited to 'base/logging.cc')
-rw-r--r--base/logging.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/base/logging.cc b/base/logging.cc
index 71528ad..559cb08 100644
--- a/base/logging.cc
+++ b/base/logging.cc
@@ -521,6 +521,12 @@ LogMessage::LogMessage(const char* file, int line, LogSeverity severity)
Init(file, line);
}
+LogMessage::LogMessage(const char* file, int line, const char* condition)
+ : severity_(LOG_FATAL), file_(file), line_(line) {
+ Init(file, line);
+ stream_ << "Check failed: " << condition << ". ";
+}
+
LogMessage::LogMessage(const char* file, int line, std::string* result)
: severity_(LOG_FATAL), file_(file), line_(line) {
Init(file, line);