summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authordpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-26 01:55:40 +0000
committerdpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-26 01:55:40 +0000
commit00209ad3482468f2eb3fd9853f3ce75123ad5ff0 (patch)
tree0c35444c52f7b022b617353605b533a609b89350 /base
parentb55d498ba0de0a6469c994158b38b7cd0ea7cc28 (diff)
downloadchromium_src-00209ad3482468f2eb3fd9853f3ce75123ad5ff0.zip
chromium_src-00209ad3482468f2eb3fd9853f3ce75123ad5ff0.tar.gz
chromium_src-00209ad3482468f2eb3fd9853f3ce75123ad5ff0.tar.bz2
Revert 134041 - Explicitly track the time source type in base/profiler/alternate_timer.h
Caused Linux ChromiumOS Builder compile failure. We were previously implicitly tracking the time source as either default or tcmalloc-based; but as we add more time sources (e.g. cpu time), we'll want to have explicit tracking for this. BUG=none TEST=none Review URL: http://codereview.chromium.org/10225017 TBR=isherman@chromium.org Review URL: https://chromiumcodereview.appspot.com/10174038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134042 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/allocator/allocator_shim.cc3
-rw-r--r--base/profiler/alternate_timer.cc9
-rw-r--r--base/profiler/alternate_timer.h12
3 files changed, 4 insertions, 20 deletions
diff --git a/base/allocator/allocator_shim.cc b/base/allocator/allocator_shim.cc
index 075828d..d61a9a4 100644
--- a/base/allocator/allocator_shim.cc
+++ b/base/allocator/allocator_shim.cc
@@ -270,8 +270,7 @@ extern "C" int _heap_init() {
GetenvBeforeMain(tracked_objects::kAlternateProfilerTime);
if (profiling && *profiling == '1') {
tracked_objects::SetAlternateTimeSource(
- tcmalloc::ThreadCache::GetBytesAllocatedOnCurrentThread,
- tracked_objects::TIME_SOURCE_TYPE_TCMALLOC);
+ tcmalloc::ThreadCache::GetBytesAllocatedOnCurrentThread);
}
return 1;
diff --git a/base/profiler/alternate_timer.cc b/base/profiler/alternate_timer.cc
index 4eba89c..abf9180 100644
--- a/base/profiler/alternate_timer.cc
+++ b/base/profiler/alternate_timer.cc
@@ -9,8 +9,6 @@
namespace {
tracked_objects::NowFunction* g_time_function = NULL;
-tracked_objects::TimeSourceType g_time_source_type =
- tracked_objects::TIME_SOURCE_TYPE_WALL_TIME;
} // anonymous namespace
@@ -20,18 +18,13 @@ const char kAlternateProfilerTime[] = "CHROME_PROFILER_TIME";
// Set an alternate timer function to replace the OS time function when
// profiling.
-void SetAlternateTimeSource(NowFunction* now_function, TimeSourceType type) {
+void SetAlternateTimeSource(NowFunction* now_function) {
DCHECK_EQ(reinterpret_cast<NowFunction*>(NULL), g_time_function);
g_time_function = now_function;
- g_time_source_type = type;
}
NowFunction* GetAlternateTimeSource() {
return g_time_function;
}
-TimeSourceType GetTimeSourceType() {
- return g_time_source_type;
-}
-
} // namespace tracked_objects
diff --git a/base/profiler/alternate_timer.h b/base/profiler/alternate_timer.h
index 5397e19..778dc62 100644
--- a/base/profiler/alternate_timer.h
+++ b/base/profiler/alternate_timer.h
@@ -12,11 +12,6 @@
namespace tracked_objects {
-BASE_EXPORT enum TimeSourceType {
- TIME_SOURCE_TYPE_WALL_TIME,
- TIME_SOURCE_TYPE_TCMALLOC
-};
-
// Provide type for an alternate timer function.
typedef unsigned int NowFunction();
@@ -29,14 +24,11 @@ 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, TimeSourceType type);
+void SetAlternateTimeSource(NowFunction* now_function);
// Gets the pointer to a function that was set via SetAlternateTimeSource().
// Returns NULL if no set was done prior to calling GetAlternateTimeSource.
-NowFunction* GetAlternateTimeSource();
-
-// Returns the type of the currently set time source.
-BASE_EXPORT TimeSourceType GetTimeSourceType();
+BASE_EXPORT NowFunction* GetAlternateTimeSource();
} // namespace tracked_objects