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

Unified Diff: base/logging.h

Issue 171093: Omit DLOGs and DCHECKs from release-mode Google Chrome-branded builds (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/logging.h
===================================================================
--- base/logging.h (revision 23711)
+++ base/logging.h (working copy)
@@ -280,10 +280,18 @@
// foo.CheckThatFoo();
// #endif
-#ifdef OFFICIAL_BUILD
-// We want to have optimized code for an official build so we remove DLOGS and
-// DCHECK from the executable.
+// http://crbug.com/16512 is open for a real fix for this. For now, Windows
+// uses OFFICIAL_BUILD and other platforms use the branding flag when NDEBUG is
+// defined.
+#if ( defined(OS_WIN) && defined(OFFICIAL_BUILD)) || \
+ (!defined(OS_WIN) && defined(NDEBUG) && defined(GOOGLE_CHROME_BUILD))
+// In order to have optimized code for official builds, remove DLOGs and
+// DCHECKs.
+#define OMIT_DLOG_AND_DCHECK 1
+#endif
+#ifdef OMIT_DLOG_AND_DCHECK
+
#define DLOG(severity) \
true ? (void) 0 : logging::LogMessageVoidify() & LOG(severity)
@@ -337,7 +345,8 @@
#define DCHECK_STRCASENE(str1, str2) \
while (false && (str1) == (str2)) NDEBUG_EAT_STREAM_PARAMETERS
-#else
+#else // OMIT_DLOG_AND_DCHECK
+
#ifndef NDEBUG
// On a regular debug build, we want to have DCHECKS and DLOGS enabled.
@@ -490,7 +499,8 @@
#define DCHECK_GE(val1, val2) DCHECK_OP(GE, >=, val1, val2)
#define DCHECK_GT(val1, val2) DCHECK_OP(GT, > , val1, val2)
-#endif // OFFICIAL_BUILD
+#endif // OMIT_DLOG_AND_DCHECK
+#undef OMIT_DLOG_AND_DCHECK
#define NOTREACHED() DCHECK(false)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698