| 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 #include "base/memory/ptr_util.h" |
| 9 | 9 |
| 10 namespace ash { | 10 namespace ash { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 return kTabStripHistogramName; | 48 return kTabStripHistogramName; |
| 49 case TaskSwitchMetricsRecorder::WINDOW_CYCLE_CONTROLLER: | 49 case TaskSwitchMetricsRecorder::WINDOW_CYCLE_CONTROLLER: |
| 50 return kAcceleratorWindowCycleHistogramName; | 50 return kAcceleratorWindowCycleHistogramName; |
| 51 } | 51 } |
| 52 NOTREACHED(); | 52 NOTREACHED(); |
| 53 return nullptr; | 53 return nullptr; |
| 54 } | 54 } |
| 55 | 55 |
| 56 } // namespace | 56 } // namespace |
| 57 | 57 |
| 58 TaskSwitchMetricsRecorder::TaskSwitchMetricsRecorder() { | 58 TaskSwitchMetricsRecorder::TaskSwitchMetricsRecorder() {} |
| 59 } | |
| 60 | 59 |
| 61 TaskSwitchMetricsRecorder::~TaskSwitchMetricsRecorder() { | 60 TaskSwitchMetricsRecorder::~TaskSwitchMetricsRecorder() {} |
| 62 } | |
| 63 | 61 |
| 64 void TaskSwitchMetricsRecorder::OnTaskSwitch( | 62 void TaskSwitchMetricsRecorder::OnTaskSwitch( |
| 65 TaskSwitchSource task_switch_source) { | 63 TaskSwitchSource task_switch_source) { |
| 66 DCHECK_NE(task_switch_source, ANY); | 64 DCHECK_NE(task_switch_source, ANY); |
| 67 if (task_switch_source != ANY) { | 65 if (task_switch_source != ANY) { |
| 68 OnTaskSwitchInternal(task_switch_source); | 66 OnTaskSwitchInternal(task_switch_source); |
| 69 OnTaskSwitchInternal(ANY); | 67 OnTaskSwitchInternal(ANY); |
| 70 } | 68 } |
| 71 } | 69 } |
| 72 | 70 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 94 | 92 |
| 95 const char* histogram_name = GetHistogramName(task_switch_source); | 93 const char* histogram_name = GetHistogramName(task_switch_source); |
| 96 DCHECK(histogram_name); | 94 DCHECK(histogram_name); |
| 97 | 95 |
| 98 histogram_map_.add( | 96 histogram_map_.add( |
| 99 task_switch_source, | 97 task_switch_source, |
| 100 base::WrapUnique(new TaskSwitchTimeTracker(histogram_name))); | 98 base::WrapUnique(new TaskSwitchTimeTracker(histogram_name))); |
| 101 } | 99 } |
| 102 | 100 |
| 103 } // namespace ash | 101 } // namespace ash |
| OLD | NEW |