| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ash/metrics/task_switch_metrics_recorder.h" | 5 #include "ash/metrics/task_switch_metrics_recorder.h" |
| 6 | 6 |
| 7 #include "ash/metrics/task_switch_time_tracker.h" | 7 #include "ash/metrics/task_switch_time_tracker.h" |
| 8 #include "base/memory/ptr_util.h" |
| 8 | 9 |
| 9 namespace ash { | 10 namespace ash { |
| 10 | 11 |
| 11 namespace { | 12 namespace { |
| 12 | 13 |
| 13 const char kAshTaskSwitchHistogramName[] = "Ash.TimeBetweenTaskSwitches"; | 14 const char kAshTaskSwitchHistogramName[] = "Ash.TimeBetweenTaskSwitches"; |
| 14 | 15 |
| 15 const char kDesktopHistogramName[] = | 16 const char kDesktopHistogramName[] = |
| 16 "Ash.Desktop.TimeBetweenNavigateToTaskSwitches"; | 17 "Ash.Desktop.TimeBetweenNavigateToTaskSwitches"; |
| 17 | 18 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 90 |
| 90 void TaskSwitchMetricsRecorder::AddTaskSwitchTimeTracker( | 91 void TaskSwitchMetricsRecorder::AddTaskSwitchTimeTracker( |
| 91 TaskSwitchSource task_switch_source) { | 92 TaskSwitchSource task_switch_source) { |
| 92 CHECK(histogram_map_.find(task_switch_source) == histogram_map_.end()); | 93 CHECK(histogram_map_.find(task_switch_source) == histogram_map_.end()); |
| 93 | 94 |
| 94 const char* histogram_name = GetHistogramName(task_switch_source); | 95 const char* histogram_name = GetHistogramName(task_switch_source); |
| 95 DCHECK(histogram_name); | 96 DCHECK(histogram_name); |
| 96 | 97 |
| 97 histogram_map_.add( | 98 histogram_map_.add( |
| 98 task_switch_source, | 99 task_switch_source, |
| 99 make_scoped_ptr(new TaskSwitchTimeTracker(histogram_name))); | 100 base::WrapUnique(new TaskSwitchTimeTracker(histogram_name))); |
| 100 } | 101 } |
| 101 | 102 |
| 102 } // namespace ash | 103 } // namespace ash |
| OLD | NEW |