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

Unified Diff: base/tracked_objects.cc

Issue 9348028: Revert 120789 - Propogate status setting for profiler to track parents (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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/tracked_objects.h ('k') | base/tracked_objects_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/tracked_objects.cc
===================================================================
--- base/tracked_objects.cc (revision 120816)
+++ base/tracked_objects.cc (working copy)
@@ -393,7 +393,7 @@
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 @@
}
// 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 @@
// 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 @@
// 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;
{
Property changes on: base/tracked_objects.cc
___________________________________________________________________
Added: svn:mergeinfo
« no previous file with comments | « base/tracked_objects.h ('k') | base/tracked_objects_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698