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

Unified Diff: base/profiler/alternate_timer.cc

Issue 9702015: [UMA] Add performance profile data to UMA uploads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Be careful with the time source Created 8 years, 8 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 | base/tracked_objects.cc » ('j') | base/tracked_objects.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/profiler/alternate_timer.cc
diff --git a/base/profiler/alternate_timer.cc b/base/profiler/alternate_timer.cc
index 05a983c4be41214639d2d5c37007e3af173bfbe8..9658a3b10e68df2a638e142415fc69f1197803ca 100644
--- a/base/profiler/alternate_timer.cc
+++ b/base/profiler/alternate_timer.cc
@@ -6,20 +6,25 @@
#include "base/logging.h"
-namespace tracked_objects {
+namespace {
+
+tracked_objects::NowFunction* g_time_function = NULL;
-static NowFunction* g_time_function = NULL;
+} // anonymous namespace
+
+namespace tracked_objects {
const char kAlternateProfilerTime[] = "CHROME_PROFILER_TIME";
// Set an alternate timer function to replace the OS time function when
// profiling.
void SetAlternateTimeSource(NowFunction* now_function) {
- DCHECK_EQ(g_time_function, reinterpret_cast<NowFunction*>(NULL));
+ DCHECK_EQ(reinterpret_cast<NowFunction*>(NULL), g_time_function);
g_time_function = now_function;
}
extern NowFunction* GetAlternateTimeSource() {
return g_time_function;
}
-} // tracked_objects
+
+} // namespace tracked_objects
« no previous file with comments | « no previous file | base/tracked_objects.cc » ('j') | base/tracked_objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698