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

Unified Diff: chrome/browser/metrics/metrics_log.cc

Issue 8468018: chrome: Remove 10 exit time destructors and 2 static initializers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: duh Created 9 years, 1 month 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 | « chrome/browser/metrics/metrics_log.h ('k') | chrome/common/extensions/extension_file_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/metrics_log.cc
diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc
index 4526893fb51759fded13b2f891f346c8d1d9ab1f..0f5f514bec75f14eb2d3f1f051f5214d450f9ceb 100644
--- a/chrome/browser/metrics/metrics_log.cc
+++ b/chrome/browser/metrics/metrics_log.cc
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "base/file_util.h"
+#include "base/lazy_instance.h"
#include "base/memory/scoped_ptr.h"
#include "base/perftimer.h"
#include "base/string_util.h"
@@ -37,6 +38,10 @@
extern "C" IMAGE_DOS_HEADER __ImageBase;
#endif
+static base::LazyInstance<std::string,
+ base::LeakyLazyInstanceTraits<std::string > >
+ g_version_extension = LAZY_INSTANCE_INITIALIZER;
+
MetricsLog::MetricsLog(const std::string& client_id, int session_id)
: MetricsLogBase(client_id, session_id, MetricsLog::GetVersionString()) {}
@@ -81,8 +86,8 @@ std::string MetricsLog::GetVersionString() {
}
std::string version = version_info.Version();
- if (!version_extension_.empty())
- version += version_extension_;
+ if (!version_extension().empty())
+ version += version_extension();
if (!version_info.IsOfficialBuild())
version.append("-devel");
return version;
@@ -92,6 +97,16 @@ MetricsLog* MetricsLog::AsMetricsLog() {
return this;
}
+// static
+void MetricsLog::set_version_extension(const std::string& extension) {
+ g_version_extension.Get() = extension;
+}
+
+// static
+const std::string& MetricsLog::version_extension() {
+ return g_version_extension.Get();
+}
+
void MetricsLog::RecordIncrementalStabilityElements() {
DCHECK(!locked_);
« no previous file with comments | « chrome/browser/metrics/metrics_log.h ('k') | chrome/common/extensions/extension_file_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698