metrics: Consolidate constants in constants.h.
Instead of hardcoding system specific constants (like path) in
every file, consolidate them into the constants.h.
BUG: 22879597
Change-Id: I615be017774db629bf43398db7f70e9ef7263a52
diff --git a/metrics/persistent_integer.cc b/metrics/persistent_integer.cc
index c6b2176..0dcd52a 100644
--- a/metrics/persistent_integer.cc
+++ b/metrics/persistent_integer.cc
@@ -9,14 +9,9 @@
#include <base/logging.h>
#include <base/posix/eintr_wrapper.h>
+#include "constants.h"
#include "metrics/metrics_library.h"
-namespace {
-
-// The directory for the persistent storage.
-const char kBackingFilesDirectory[] = "/var/lib/metrics/";
-
-}
namespace chromeos_metrics {
@@ -31,7 +26,7 @@
if (testing_) {
backing_file_name_ = name_;
} else {
- backing_file_name_ = kBackingFilesDirectory + name_;
+ backing_file_name_ = metrics::kMetricsDirectory + name_;
}
}