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

Side by Side Diff: base/tracked.h

Issue 4081003: Added task to Observer methods (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Made default birthplace a local static Created 10 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
« no previous file with comments | « base/message_loop_unittest.cc ('k') | base/tracked.cc » ('j') | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 //------------------------------------------------------------------------------ 5 //------------------------------------------------------------------------------
6 // Tracked is the base class for all tracked objects. During construction, it 6 // Tracked is the base class for all tracked objects. During construction, it
7 // registers the fact that an instance was created, and at destruction time, it 7 // registers the fact that an instance was created, and at destruction time, it
8 // records that event. The instance may be tagged with a name, which is refered 8 // records that event. The instance may be tagged with a name, which is refered
9 // to as its Location. The Location is a file and line number, most 9 // to as its Location. The Location is a file and line number, most
10 // typically indicated where the object was constructed. In some cases, as the 10 // typically indicated where the object was constructed. In some cases, as the
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 class Births; 88 class Births;
89 89
90 class Tracked { 90 class Tracked {
91 public: 91 public:
92 Tracked(); 92 Tracked();
93 virtual ~Tracked(); 93 virtual ~Tracked();
94 94
95 // Used to record the FROM_HERE location of a caller. 95 // Used to record the FROM_HERE location of a caller.
96 void SetBirthPlace(const Location& from_here); 96 void SetBirthPlace(const Location& from_here);
97 const Location GetBirthPlace() const;
97 98
98 // When a task sits around a long time, such as in a timer, or object watcher, 99 // When a task sits around a long time, such as in a timer, or object watcher,
99 // this method should be called when the task becomes active, and its 100 // this method should be called when the task becomes active, and its
100 // significant lifetime begins (and its waiting to be woken up has passed). 101 // significant lifetime begins (and its waiting to be woken up has passed).
101 void ResetBirthTime(); 102 void ResetBirthTime();
102 103
103 bool MissingBirthplace() const; 104 bool MissingBirthplace() const;
104 105
105 #if defined(TRACK_ALL_TASK_OBJECTS) 106 #if defined(TRACK_ALL_TASK_OBJECTS)
106 base::TimeTicks tracked_birth_time() const { return tracked_birth_time_; } 107 base::TimeTicks tracked_birth_time() const { return tracked_birth_time_; }
(...skipping 13 matching lines...) Expand all
120 base::TimeTicks tracked_birth_time_; 121 base::TimeTicks tracked_birth_time_;
121 122
122 #endif // defined(TRACK_ALL_TASK_OBJECTS) 123 #endif // defined(TRACK_ALL_TASK_OBJECTS)
123 124
124 DISALLOW_COPY_AND_ASSIGN(Tracked); 125 DISALLOW_COPY_AND_ASSIGN(Tracked);
125 }; 126 };
126 127
127 } // namespace tracked_objects 128 } // namespace tracked_objects
128 129
129 #endif // BASE_TRACKED_H_ 130 #endif // BASE_TRACKED_H_
OLDNEW
« no previous file with comments | « base/message_loop_unittest.cc ('k') | base/tracked.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698