summaryrefslogtreecommitdiffstats
path: root/base/tracked_objects.cc
diff options
context:
space:
mode:
authorjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-07 20:27:08 +0000
committerjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-07 20:27:08 +0000
commit24f1756baceb15fec9b84482bf3ea69718d4760b (patch)
treef407096520964d4867fed4ec7f02c64c87a92be3 /base/tracked_objects.cc
parentcf20483084539712d2898cd43dbec7247ea15f38 (diff)
downloadchromium_src-24f1756baceb15fec9b84482bf3ea69718d4760b.zip
chromium_src-24f1756baceb15fec9b84482bf3ea69718d4760b.tar.gz
chromium_src-24f1756baceb15fec9b84482bf3ea69718d4760b.tar.bz2
Revert 120789 - Propogate status setting for profiler to track parents
[There is a TSAN race report... so I'm reverting] This allows child processes to track ancestry, and report it to the browser process. Parent tracking is only turned on based on an environment variable. r=rtenneti Review URL: https://chromiumcodereview.appspot.com/9181002 TBR=jar@chromium.org Review URL: https://chromiumcodereview.appspot.com/9348028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120818 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/tracked_objects.cc')
-rw-r--r--base/tracked_objects.cc31
1 files changed, 14 insertions, 17 deletions
diff --git a/base/tracked_objects.cc b/base/tracked_objects.cc
index 87af8dc..e7d7bd1 100644
--- a/base/tracked_objects.cc
+++ b/base/tracked_objects.cc
@@ -393,7 +393,7 @@ Births* ThreadData::TallyABirthIfActive(const Location& location) {
if (!kTrackAllTaskObjects)
return NULL; // Not compiled in.
- if (!TrackingStatus())
+ if (!tracking_status())
return NULL;
ThreadData* current_thread_data = Get();
if (!current_thread_data)
@@ -622,31 +622,28 @@ bool ThreadData::Initialize() {
}
// static
-bool ThreadData::InitializeAndSetTrackingStatus(Status status) {
- DCHECK_GE(status, DEACTIVATED);
- DCHECK_LE(status, PROFILING_CHILDREN_ACTIVE);
-
+bool ThreadData::InitializeAndSetTrackingStatus(bool status) {
if (!Initialize()) // No-op if already initialized.
return false; // Not compiled in.
- if (!kTrackParentChildLinks && status > DEACTIVATED)
- status = PROFILING_ACTIVE;
- status_ = status;
+ if (!status) {
+ status_ = DEACTIVATED;
+ } else {
+ if (kTrackParentChildLinks)
+ status_ = PROFILING_CHILDREN_ACTIVE;
+ else
+ status_ = PROFILING_ACTIVE;
+ }
return true;
}
// static
-ThreadData::Status ThreadData::status() {
- return status_;
-}
-
-// static
-bool ThreadData::TrackingStatus() {
+bool ThreadData::tracking_status() {
return status_ > DEACTIVATED;
}
// static
-bool ThreadData::TrackingParentChildStatus() {
+bool ThreadData::tracking_parent_child_status() {
return status_ >= PROFILING_CHILDREN_ACTIVE;
}
@@ -667,7 +664,7 @@ TrackedTime ThreadData::NowForEndOfRun() {
// static
TrackedTime ThreadData::Now() {
- if (kTrackAllTaskObjects && TrackingStatus())
+ if (kTrackAllTaskObjects && tracking_status())
return TrackedTime::Now();
return TrackedTime(); // Super fast when disabled, or not compiled.
}
@@ -689,7 +686,7 @@ void ThreadData::ShutdownSingleThreadedCleanup(bool leak) {
// This is only called from test code, where we need to cleanup so that
// additional tests can be run.
// We must be single threaded... but be careful anyway.
- if (!InitializeAndSetTrackingStatus(DEACTIVATED))
+ if (!InitializeAndSetTrackingStatus(false))
return;
ThreadData* thread_data_list;
{