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 #ifndef ASH_METRICS_TASK_SWITCH_METRIC_RECORDER_H_ | 5 #ifndef ASH_METRICS_TASK_SWITCH_METRIC_RECORDER_H_ |
6 #define ASH_METRICS_TASK_SWITCH_METRIC_RECORDER_H_ | 6 #define ASH_METRICS_TASK_SWITCH_METRIC_RECORDER_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
11 #include "base/containers/scoped_ptr_hash_map.h" | 12 #include "base/containers/scoped_ptr_hash_map.h" |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 | 14 |
15 namespace aura { | 15 namespace aura { |
16 class Window; | 16 class Window; |
17 } // namespace aura | 17 } // namespace aura |
18 | 18 |
19 namespace ash { | 19 namespace ash { |
20 | 20 |
21 class TaskSwitchTimeTracker; | 21 class TaskSwitchTimeTracker; |
22 | 22 |
23 // The TaskSwitchMetricsRecorder class records UMA metrics related to task | 23 // The TaskSwitchMetricsRecorder class records UMA metrics related to task |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 TaskSwitchSource task_switch_source); | 80 TaskSwitchSource task_switch_source); |
81 | 81 |
82 // Adds a TaskSwitchTimeTracker to |histogram_map_| for the specified | 82 // Adds a TaskSwitchTimeTracker to |histogram_map_| for the specified |
83 // |task_switch_source|. Behavior is undefined if a TaskSwitchTimeTracker | 83 // |task_switch_source|. Behavior is undefined if a TaskSwitchTimeTracker |
84 // |histogram_map_| already has an entry for |task_switch_source|. | 84 // |histogram_map_| already has an entry for |task_switch_source|. |
85 void AddTaskSwitchTimeTracker(TaskSwitchSource task_switch_source); | 85 void AddTaskSwitchTimeTracker(TaskSwitchSource task_switch_source); |
86 | 86 |
87 // Tracks TaskSwitchSource to TaskSwitchTimeTracker mappings. The | 87 // Tracks TaskSwitchSource to TaskSwitchTimeTracker mappings. The |
88 // |histogram_map_| is populated on demand the first time a | 88 // |histogram_map_| is populated on demand the first time a |
89 // TaskSwitchTimeTracker is needed for a given source. | 89 // TaskSwitchTimeTracker is needed for a given source. |
90 base::ScopedPtrHashMap<int, scoped_ptr<TaskSwitchTimeTracker>> histogram_map_; | 90 base::ScopedPtrHashMap<int, std::unique_ptr<TaskSwitchTimeTracker>> |
| 91 histogram_map_; |
91 | 92 |
92 DISALLOW_COPY_AND_ASSIGN(TaskSwitchMetricsRecorder); | 93 DISALLOW_COPY_AND_ASSIGN(TaskSwitchMetricsRecorder); |
93 }; | 94 }; |
94 | 95 |
95 } // namespace ash | 96 } // namespace ash |
96 | 97 |
97 #endif // ASH_METRICS_TASK_SWITCH_METRIC_RECORDER_H_ | 98 #endif // ASH_METRICS_TASK_SWITCH_METRIC_RECORDER_H_ |
OLD | NEW |