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

Unified Diff: base/build_time.cc

Issue 1641413002: Makes GetBuildTime behave identically on all build types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Follows rename. Created 4 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
Index: base/build_time.cc
diff --git a/base/build_time.cc b/base/build_time.cc
index b8b42966908fb47e696f01a2709bb9a90f2bd448..166f0025b3dc50e53409160d14266d7e83ee19ba 100644
--- a/base/build_time.cc
+++ b/base/build_time.cc
@@ -7,6 +7,11 @@
#include "base/logging.h"
#include "base/time/time.h"
+// Allow the build date to be set by a define if desired.
+#ifndef BUILD_DATE
+#define BUILD_DATE __DATE__
+#endif
+
namespace base {
Time GetBuildTime() {
@@ -16,11 +21,7 @@ Time GetBuildTime() {
//
// __DATE__ is exactly "Mmm DD YYYY".
// __TIME__ is exactly "hh:mm:ss".
M-A Ruel 2016/01/30 02:58:14 Remove this, this is confusing.
Zachary Forman 2016/02/01 07:28:30 Done
-#if defined(DONT_EMBED_BUILD_METADATA) && !defined(OFFICIAL_BUILD)
- const char kDateTime[] = "Sep 02 2008 08:00:00 PST";
-#else
- const char kDateTime[] = __DATE__ " " __TIME__ " PST";
-#endif
+ const char kDateTime[] = BUILD_DATE " 00:00:00 UTC";
bool result = Time::FromString(kDateTime, &integral_build_time);
DCHECK(result);
return integral_build_time;

Powered by Google App Engine
This is Rietveld 408576698