Chromium Code Reviews| Index: base/profiler/scoped_profile.cc |
| diff --git a/base/profiler/scoped_profile.cc b/base/profiler/scoped_profile.cc |
| index 93c86e92cce5452e81e3b5d16e71e82e99c443a0..e049dd994471adbba694f958993bb967de95054c 100644 |
| --- a/base/profiler/scoped_profile.cc |
| +++ b/base/profiler/scoped_profile.cc |
| @@ -12,8 +12,8 @@ namespace tracked_objects { |
| ScopedProfile::ScopedProfile(const Location& location) |
| - : birth_(ThreadData::TallyABirthIfActive(location)), |
| - start_of_run_(ThreadData::NowForStartOfRun(birth_)) { |
| + : birth_(ThreadData::TallyABirthIfActive(location)) { |
| + stopwatch_.Start(ThreadData::NowForStartOfRun(birth_)); |
| } |
| ScopedProfile::~ScopedProfile() { |
| @@ -21,10 +21,11 @@ ScopedProfile::~ScopedProfile() { |
| } |
| void ScopedProfile::StopClockAndTally() { |
| + stopwatch_.Stop(ThreadData::NowForEndOfRun()); |
|
jar (doing other things)
2014/08/27 15:25:18
Why do you need to stop the stopwatch if it is nev
vadimt
2014/08/27 19:14:20
Because Start and Stop should be strictly paired.
|
| + |
| if (!birth_) |
| return; |
| - ThreadData::TallyRunInAScopedRegionIfTracking(birth_, start_of_run_, |
| - ThreadData::NowForEndOfRun()); |
| + ThreadData::TallyRunInAScopedRegionIfTracking(birth_, stopwatch_); |
| birth_ = NULL; |
| } |