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 "components/html_viewer/stats_collection_controller.h" | 5 #include "components/html_viewer/stats_collection_controller.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/metrics/statistics_recorder.h" | 10 #include "base/metrics/statistics_recorder.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 tracing::StartupPerformanceTimesPtr times) { | 26 tracing::StartupPerformanceTimesPtr times) { |
27 base::StatisticsRecorder::Initialize(); | 27 base::StatisticsRecorder::Initialize(); |
28 | 28 |
29 startup_metric_utils::RecordStartupProcessCreationTime( | 29 startup_metric_utils::RecordStartupProcessCreationTime( |
30 base::Time::FromInternalValue(times->shell_process_creation_time)); | 30 base::Time::FromInternalValue(times->shell_process_creation_time)); |
31 | 31 |
32 // TODO(msw): Record the MojoMain() entry point time of mojo:browser instead? | 32 // TODO(msw): Record the MojoMain() entry point time of mojo:browser instead? |
33 startup_metric_utils::RecordMainEntryPointTime( | 33 startup_metric_utils::RecordMainEntryPointTime( |
34 base::Time::FromInternalValue(times->shell_main_entry_point_time)); | 34 base::Time::FromInternalValue(times->shell_main_entry_point_time)); |
35 | 35 |
36 // TODO(msw): Determine if this is the first run. | 36 // TODO(msw): Determine if this is the first run and provide a PrefService |
| 37 // to generate stats that span multiple startups. |
37 startup_metric_utils::RecordBrowserMainMessageLoopStart( | 38 startup_metric_utils::RecordBrowserMainMessageLoopStart( |
38 base::TimeTicks::FromInternalValue( | 39 base::TimeTicks::FromInternalValue( |
39 times->browser_message_loop_start_ticks), | 40 times->browser_message_loop_start_ticks), |
40 false); | 41 false, nullptr); |
41 | 42 |
42 startup_metric_utils::RecordBrowserWindowDisplay( | 43 startup_metric_utils::RecordBrowserWindowDisplay( |
43 base::TimeTicks::FromInternalValue(times->browser_window_display_ticks)); | 44 base::TimeTicks::FromInternalValue(times->browser_window_display_ticks)); |
44 | 45 |
45 startup_metric_utils::RecordBrowserOpenTabsDelta( | 46 startup_metric_utils::RecordBrowserOpenTabsDelta( |
46 base::TimeDelta::FromInternalValue(times->browser_open_tabs_time_delta)); | 47 base::TimeDelta::FromInternalValue(times->browser_open_tabs_time_delta)); |
47 | 48 |
48 startup_metric_utils::RecordFirstWebContentsMainFrameLoad( | 49 startup_metric_utils::RecordFirstWebContentsMainFrameLoad( |
49 base::TimeTicks::FromInternalValue( | 50 base::TimeTicks::FromInternalValue( |
50 times->first_web_contents_main_frame_load_ticks)); | 51 times->first_web_contents_main_frame_load_ticks)); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 histogram->WriteJSON(&histogram_json); | 154 histogram->WriteJSON(&histogram_json); |
154 return histogram_json; | 155 return histogram_json; |
155 } | 156 } |
156 | 157 |
157 std::string StatsCollectionController::GetBrowserHistogram( | 158 std::string StatsCollectionController::GetBrowserHistogram( |
158 const std::string& histogram_name) { | 159 const std::string& histogram_name) { |
159 return GetHistogram(histogram_name); | 160 return GetHistogram(histogram_name); |
160 } | 161 } |
161 | 162 |
162 } // namespace html_viewer | 163 } // namespace html_viewer |
OLD | NEW |