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

Unified Diff: components/metrics/metrics_log.cc

Issue 693493006: Use base::GetBuildTime in MetricsLog::GetBuildTime instead of reimplementing it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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: components/metrics/metrics_log.cc
diff --git a/components/metrics/metrics_log.cc b/components/metrics/metrics_log.cc
index 28ed57b177cfbd19be50308286e7e76e01ac9943..8764a739fcd6af29cff51e3f6f6022fd16bcbe2b 100644
--- a/components/metrics/metrics_log.cc
+++ b/components/metrics/metrics_log.cc
@@ -10,6 +10,7 @@
#include "base/base64.h"
#include "base/basictypes.h"
+#include "base/build_time.h"
#include "base/cpu.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram.h"
@@ -156,13 +157,8 @@ uint64 MetricsLog::Hash(const std::string& value) {
// static
int64 MetricsLog::GetBuildTime() {
static int64 integral_build_time = 0;
- if (!integral_build_time) {
- base::Time time;
- static const char kDateTime[] = __DATE__ " " __TIME__ " GMT";
M-A Ruel 2014/10/31 14:09:14 Note that the PST / GMT difference was pure hack;
- bool result = base::Time::FromString(kDateTime, &time);
- DCHECK(result);
- integral_build_time = static_cast<int64>(time.ToTimeT());
- }
+ if (!integral_build_time)
+ integral_build_time = static_cast<int64>(base::GetBuildTime().ToTimeT());
return integral_build_time;
}
« 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