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

Side by Side Diff: base/tracked_objects.cc

Issue 8548005: Adjust interfaces to indicate when tracking is in progress (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« base/tracked_objects.h ('K') | « base/tracked_objects.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/tracked_objects.h" 5 #include "base/tracked_objects.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 status_ = status ? ACTIVE : DEACTIVATED; 611 status_ = status ? ACTIVE : DEACTIVATED;
612 return true; 612 return true;
613 } 613 }
614 614
615 // static 615 // static
616 bool ThreadData::tracking_status() { 616 bool ThreadData::tracking_status() {
617 return status_ == ACTIVE; 617 return status_ == ACTIVE;
618 } 618 }
619 619
620 // static 620 // static
621 TrackedTime ThreadData::NowForStartOfRun() {
622 return Now();
623 }
624
625 // static
626 TrackedTime ThreadData::NowForEndOfRun() {
627 return Now();
628 }
629
630 // static
621 TrackedTime ThreadData::Now() { 631 TrackedTime ThreadData::Now() {
622 if (kTrackAllTaskObjects && tracking_status()) 632 if (kTrackAllTaskObjects && tracking_status())
623 return TrackedTime::Now(); 633 return TrackedTime::Now();
624 return TrackedTime(); // Super fast when disabled, or not compiled. 634 return TrackedTime(); // Super fast when disabled, or not compiled.
625 } 635 }
626 636
627 // static 637 // static
628 void ThreadData::ShutdownSingleThreadedCleanup(bool leak) { 638 void ThreadData::ShutdownSingleThreadedCleanup(bool leak) {
629 // This is only called from test code, where we need to cleanup so that 639 // This is only called from test code, where we need to cleanup so that
630 // additional tests can be run. 640 // additional tests can be run.
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 (combined_selectors_ & BIRTH_THREAD) ? "*" : 1257 (combined_selectors_ & BIRTH_THREAD) ? "*" :
1248 sample.birth().birth_thread()->thread_name().c_str(), 1258 sample.birth().birth_thread()->thread_name().c_str(),
1249 (combined_selectors_ & DEATH_THREAD) ? "*" : 1259 (combined_selectors_ & DEATH_THREAD) ? "*" :
1250 sample.DeathThreadName().c_str()); 1260 sample.DeathThreadName().c_str());
1251 sample.birth().location().Write(!(combined_selectors_ & BIRTH_FILE), 1261 sample.birth().location().Write(!(combined_selectors_ & BIRTH_FILE),
1252 !(combined_selectors_ & BIRTH_FUNCTION), 1262 !(combined_selectors_ & BIRTH_FUNCTION),
1253 output); 1263 output);
1254 } 1264 }
1255 1265
1256 } // namespace tracked_objects 1266 } // namespace tracked_objects
OLDNEW
« base/tracked_objects.h ('K') | « base/tracked_objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698