Chromium Code Reviews| Index: chrome/browser/mac/mac_startup_profiler.cc |
| diff --git a/chrome/browser/mac/mac_startup_profiler.cc b/chrome/browser/mac/mac_startup_profiler.cc |
| index 95aa7d8da005bf710baa1282b5c995a3bc0d6ba7..795dbbd2e7c2e2f9f8f14497d184ab76bc69c3c6 100644 |
| --- a/chrome/browser/mac/mac_startup_profiler.cc |
| +++ b/chrome/browser/mac/mac_startup_profiler.cc |
| @@ -20,23 +20,21 @@ MacStartupProfiler::~MacStartupProfiler() { |
| } |
| void MacStartupProfiler::Profile(Location location) { |
| - profiled_times_[location] = base::Time::Now(); |
| + profiled_ticks_[location] = base::TimeTicks::Now(); |
| } |
| void MacStartupProfiler::RecordMetrics() { |
| - const base::Time main_entry_time = startup_metric_utils::MainEntryPointTime(); |
| - DCHECK(!main_entry_time.is_null()); |
| + const base::TimeTicks main_entry_ticks = |
| + startup_metric_utils::MainEntryPointTicks(); |
| + DCHECK(!main_entry_ticks.is_null()); |
| DCHECK(!recorded_metrics_); |
| recorded_metrics_ = true; |
| - for (std::map<Location, base::Time>::const_iterator it = |
| - profiled_times_.begin(); |
| - it != profiled_times_.end(); |
| - ++it) { |
| - const base::Time& location_time = it->second; |
| - base::TimeDelta delta = location_time - main_entry_time; |
| - RecordHistogram(it->first, delta); |
| + for (const auto& entry : profiled_ticks_) { |
| + const Location location = entry.first; |
|
msw
2015/11/10 18:58:37
nit: could this also be a const ref? (or inline [b
gab
2015/11/10 19:18:49
It's an enum, refs for enums don't make much sense
|
| + const base::TimeTicks& location_ticks = entry.second; |
| + RecordHistogram(location, location_ticks - main_entry_ticks); |
| } |
| } |