Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: mojo/services/tracing/tracing_app.cc

Issue 1425263003: Use TimeTicks as much as possible in startup_metric_utils. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ifdef thread priority dance out on Mac per lack of support in base Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "mojo/services/tracing/tracing_app.h" 5 #include "mojo/services/tracing/tracing_app.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "mojo/application/public/cpp/application_connection.h" 10 #include "mojo/application/public/cpp/application_connection.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 void TracingApp::SetShellProcessCreationTime(int64 time) { 129 void TracingApp::SetShellProcessCreationTime(int64 time) {
130 if (startup_performance_times_.shell_process_creation_time == 0) 130 if (startup_performance_times_.shell_process_creation_time == 0)
131 startup_performance_times_.shell_process_creation_time = time; 131 startup_performance_times_.shell_process_creation_time = time;
132 } 132 }
133 133
134 void TracingApp::SetShellMainEntryPointTime(int64 time) { 134 void TracingApp::SetShellMainEntryPointTime(int64 time) {
135 if (startup_performance_times_.shell_main_entry_point_time == 0) 135 if (startup_performance_times_.shell_main_entry_point_time == 0)
136 startup_performance_times_.shell_main_entry_point_time = time; 136 startup_performance_times_.shell_main_entry_point_time = time;
137 } 137 }
138 138
139 void TracingApp::SetBrowserMessageLoopStartTime(int64 time) { 139 void TracingApp::SetBrowserMessageLoopStartTicks(int64 ticks) {
140 if (startup_performance_times_.browser_message_loop_start_time == 0) 140 if (startup_performance_times_.browser_message_loop_start_ticks == 0)
141 startup_performance_times_.browser_message_loop_start_time = time; 141 startup_performance_times_.browser_message_loop_start_ticks = ticks;
142 } 142 }
143 143
144 void TracingApp::SetBrowserWindowDisplayTime(int64 time) { 144 void TracingApp::SetBrowserWindowDisplayTicks(int64 ticks) {
145 if (startup_performance_times_.browser_window_display_time == 0) 145 if (startup_performance_times_.browser_window_display_ticks == 0)
146 startup_performance_times_.browser_window_display_time = time; 146 startup_performance_times_.browser_window_display_ticks = ticks;
147 } 147 }
148 148
149 void TracingApp::SetBrowserOpenTabsTimeDelta(int64 delta) { 149 void TracingApp::SetBrowserOpenTabsTimeDelta(int64 delta) {
150 if (startup_performance_times_.browser_open_tabs_time_delta == 0) 150 if (startup_performance_times_.browser_open_tabs_time_delta == 0)
151 startup_performance_times_.browser_open_tabs_time_delta = delta; 151 startup_performance_times_.browser_open_tabs_time_delta = delta;
152 } 152 }
153 153
154 void TracingApp::SetFirstWebContentsMainFrameLoadTime(int64 time) { 154 void TracingApp::SetFirstWebContentsMainFrameLoadTicks(int64 ticks) {
155 if (startup_performance_times_.first_web_contents_main_frame_load_time == 0) 155 if (startup_performance_times_.first_web_contents_main_frame_load_ticks == 0)
156 startup_performance_times_.first_web_contents_main_frame_load_time = time; 156 startup_performance_times_.first_web_contents_main_frame_load_ticks = ticks;
157 } 157 }
158 158
159 void TracingApp::SetFirstVisuallyNonEmptyLayoutTime(int64 time) { 159 void TracingApp::SetFirstVisuallyNonEmptyLayoutTicks(int64 ticks) {
160 if (startup_performance_times_.first_visually_non_empty_layout_time == 0) 160 if (startup_performance_times_.first_visually_non_empty_layout_ticks == 0)
161 startup_performance_times_.first_visually_non_empty_layout_time = time; 161 startup_performance_times_.first_visually_non_empty_layout_ticks = ticks;
162 } 162 }
163 163
164 void TracingApp::GetStartupPerformanceTimes( 164 void TracingApp::GetStartupPerformanceTimes(
165 const GetStartupPerformanceTimesCallback& callback) { 165 const GetStartupPerformanceTimesCallback& callback) {
166 callback.Run(startup_performance_times_.Clone()); 166 callback.Run(startup_performance_times_.Clone());
167 } 167 }
168 168
169 void TracingApp::AllDataCollected() { 169 void TracingApp::AllDataCollected() {
170 recorder_impls_.clear(); 170 recorder_impls_.clear();
171 sink_.reset(); 171 sink_.reset();
172 } 172 }
173 173
174 } // namespace tracing 174 } // namespace tracing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698