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

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: copyright fix Created 9 years, 6 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 | base/tracked_objects_unittest.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) 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(COMPILER_MSVC) 7 #if defined(COMPILER_MSVC)
8 // MSDN says to #include <intrin.h>, but that breaks the VS2005 build. 8 // MSDN says to #include <intrin.h>, but that breaks the VS2005 build.
9 extern "C" { 9 extern "C" {
10 void* _ReturnAddress(); 10 void* _ReturnAddress();
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 return kNone; 100 return kNone;
101 } 101 }
102 bool Tracked::MissingBirthplace() const { return false; } 102 bool Tracked::MissingBirthplace() const { return false; }
103 void Tracked::ResetBirthTime() {} 103 void Tracked::ResetBirthTime() {}
104 104
105 #else 105 #else
106 106
107 Tracked::Tracked() 107 Tracked::Tracked()
108 : tracked_births_(NULL), 108 : tracked_births_(NULL),
109 tracked_birth_time_(TimeTicks::Now()) { 109 tracked_birth_time_(TimeTicks::Now()) {
110 if (!ThreadData::IsActive())
111 return;
112 SetBirthPlace(Location("NoFunctionName", "NeedToSetBirthPlace", -1, NULL));
113 } 110 }
114 111
115 Tracked::~Tracked() { 112 Tracked::~Tracked() {
116 if (!ThreadData::IsActive() || !tracked_births_) 113 if (!ThreadData::IsActive() || !tracked_births_)
117 return; 114 return;
118 ThreadData::current()->TallyADeath(*tracked_births_, 115 ThreadData::current()->TallyADeath(*tracked_births_,
119 TimeTicks::Now() - tracked_birth_time_); 116 TimeTicks::Now() - tracked_birth_time_);
120 } 117 }
121 118
122 void Tracked::SetBirthPlace(const Location& from_here) { 119 void Tracked::SetBirthPlace(const Location& from_here) {
(...skipping 17 matching lines...) Expand all
140 tracked_birth_time_ = TimeTicks::Now(); 137 tracked_birth_time_ = TimeTicks::Now();
141 } 138 }
142 139
143 bool Tracked::MissingBirthplace() const { 140 bool Tracked::MissingBirthplace() const {
144 return -1 == tracked_births_->location().line_number(); 141 return -1 == tracked_births_->location().line_number();
145 } 142 }
146 143
147 #endif // NDEBUG 144 #endif // NDEBUG
148 145
149 } // namespace tracked_objects 146 } // namespace tracked_objects
OLDNEW
« no previous file with comments | « no previous file | base/tracked_objects_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698