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

Unified Diff: base/profiler/alternate_timer.h

Issue 10248001: Explicitly track the time source type in base/profiler/alternate_timer.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « base/allocator/allocator_shim.cc ('k') | base/profiler/alternate_timer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/profiler/alternate_timer.h
diff --git a/base/profiler/alternate_timer.h b/base/profiler/alternate_timer.h
index 778dc62e658722595492b505dfe6d2fce49ca0ca..eb0022d01eaaac79ff01773b9009ba55b1447a4c 100644
--- a/base/profiler/alternate_timer.h
+++ b/base/profiler/alternate_timer.h
@@ -12,6 +12,11 @@
namespace tracked_objects {
+enum BASE_EXPORT TimeSourceType {
+ TIME_SOURCE_TYPE_WALL_TIME,
+ TIME_SOURCE_TYPE_TCMALLOC
+};
+
// Provide type for an alternate timer function.
typedef unsigned int NowFunction();
@@ -24,11 +29,14 @@ extern const char kAlternateProfilerTime[];
// profiling. Typically this is called by an allocator that is providing a
// function that indicates how much memory has been allocated on any given
// thread.
-void SetAlternateTimeSource(NowFunction* now_function);
+void SetAlternateTimeSource(NowFunction* now_function, TimeSourceType type);
// Gets the pointer to a function that was set via SetAlternateTimeSource().
// Returns NULL if no set was done prior to calling GetAlternateTimeSource.
-BASE_EXPORT NowFunction* GetAlternateTimeSource();
+NowFunction* GetAlternateTimeSource();
+
+// Returns the type of the currently set time source.
+BASE_EXPORT TimeSourceType GetTimeSourceType();
} // namespace tracked_objects
« no previous file with comments | « base/allocator/allocator_shim.cc ('k') | base/profiler/alternate_timer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698