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

Side by Side Diff: base/tracked.cc

Issue 7029038: Remove default initializtion of BirthPlace in Tracked. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | 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) 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 #include "base/tracked.h" 5 #include "base/tracked.h"
6 6
7 #include "base/stringprintf.h" 7 #include "base/stringprintf.h"
8 #include "base/tracked_objects.h" 8 #include "base/tracked_objects.h"
9 9
10 using base::TimeTicks; 10 using base::TimeTicks;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 bool Tracked::MissingBirthplace() const { return false; } 72 bool Tracked::MissingBirthplace() const { return false; }
73 void Tracked::ResetBirthTime() {} 73 void Tracked::ResetBirthTime() {}
74 74
75 #else 75 #else
76 76
77 Tracked::Tracked() 77 Tracked::Tracked()
78 : tracked_births_(NULL), 78 : tracked_births_(NULL),
79 tracked_birth_time_(TimeTicks::Now()) { 79 tracked_birth_time_(TimeTicks::Now()) {
80 if (!ThreadData::IsActive()) 80 if (!ThreadData::IsActive())
81 return; 81 return;
82 SetBirthPlace(Location("NoFunctionName", "NeedToSetBirthPlace", -1));
jar (doing other things) 2011/05/18 20:46:08 Line 80 has no side effects... so it too can go.
83 } 82 }
84 83
85 Tracked::~Tracked() { 84 Tracked::~Tracked() {
86 if (!ThreadData::IsActive() || !tracked_births_) 85 if (!ThreadData::IsActive() || !tracked_births_)
87 return; 86 return;
88 ThreadData::current()->TallyADeath(*tracked_births_, 87 ThreadData::current()->TallyADeath(*tracked_births_,
89 TimeTicks::Now() - tracked_birth_time_); 88 TimeTicks::Now() - tracked_birth_time_);
90 } 89 }
91 90
92 void Tracked::SetBirthPlace(const Location& from_here) { 91 void Tracked::SetBirthPlace(const Location& from_here) {
(...skipping 15 matching lines...) Expand all
108 tracked_birth_time_ = TimeTicks::Now(); 107 tracked_birth_time_ = TimeTicks::Now();
109 } 108 }
110 109
111 bool Tracked::MissingBirthplace() const { 110 bool Tracked::MissingBirthplace() const {
112 return -1 == tracked_births_->location().line_number(); 111 return -1 == tracked_births_->location().line_number();
113 } 112 }
114 113
115 #endif // NDEBUG 114 #endif // NDEBUG
116 115
117 } // namespace tracked_objects 116 } // namespace tracked_objects
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698