Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 module tracing; | 5 module tracing; |
| 6 | 6 |
| 7 // To participate in the tracing ecosystem, implement the TraceProvider | 7 // To participate in the tracing ecosystem, implement the TraceProvider |
| 8 // interface and connect to the tracing app. Then, when the provider's Start() | 8 // interface and connect to the tracing app. Then, when the provider's Start() |
| 9 // function is called collect tracing data and pass it back via the provided | 9 // function is called collect tracing data and pass it back via the provided |
| 10 // TraceRecorder interface up until Stop() is called. | 10 // TraceRecorder interface up until Stop() is called. |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 // Request tracing data from all connected providers to stream to | 24 // Request tracing data from all connected providers to stream to |
| 25 // |stream|. | 25 // |stream|. |
| 26 Start(handle<data_pipe_producer> stream, string categories); | 26 Start(handle<data_pipe_producer> stream, string categories); |
| 27 | 27 |
| 28 // Stop tracing and flush results to the |stream| passed in to Start(). | 28 // Stop tracing and flush results to the |stream| passed in to Start(). |
| 29 // Closes |stream| when all data is collected. | 29 // Closes |stream| when all data is collected. |
| 30 StopAndFlush(); | 30 StopAndFlush(); |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 // These times are used to determine startup performance metrics. | 33 // These times are used to determine startup performance metrics. |
| 34 // TODO(msw): Use TimeTicks to avoid system clock changes: crbug.com/521164 | |
| 35 struct StartupPerformanceTimes { | 34 struct StartupPerformanceTimes { |
| 36 // TODO(msw): Rename to match "BrowserMainEntryTimeAbsolute" metric? | 35 // TODO(msw): Rename to match "BrowserMainEntryTimeAbsolute" metric? |
| 37 int64 shell_process_creation_time; | 36 int64 shell_process_creation_time; |
|
msw
2015/11/10 18:58:38
Hmm, I guess we might want to convert these times
gab
2015/11/10 19:18:49
Right having the TimeTicks value ASAP is better, h
| |
| 38 int64 shell_main_entry_point_time; | 37 int64 shell_main_entry_point_time; |
| 39 int64 browser_message_loop_start_time; | 38 int64 browser_message_loop_start_ticks; |
| 40 int64 browser_window_display_time; | 39 int64 browser_window_display_ticks; |
| 41 int64 browser_open_tabs_time_delta; | 40 int64 browser_open_tabs_time_delta; |
| 42 // TODO(msw): Rename to avoid "web contents"? | 41 // TODO(msw): Rename to avoid "web contents"? |
| 43 int64 first_web_contents_main_frame_load_time; | 42 int64 first_web_contents_main_frame_load_ticks; |
| 44 // TODO(msw): Rename to match "FirstWebContents.NonEmptyPaint" metric? | 43 // TODO(msw): Rename to match "FirstWebContents.NonEmptyPaint" metric? |
| 45 int64 first_visually_non_empty_layout_time; | 44 int64 first_visually_non_empty_layout_ticks; |
| 46 }; | 45 }; |
| 47 | 46 |
| 48 // This interface accepts startup performance timing from a variety of sources. | 47 // This interface accepts startup performance timing from a variety of sources. |
| 49 interface StartupPerformanceDataCollector { | 48 interface StartupPerformanceDataCollector { |
| 50 // These setters may be called many times, only the first time is recorded. | 49 // These setters may be called many times, only the first time is recorded. |
| 51 SetShellProcessCreationTime(int64 time); | 50 SetShellProcessCreationTime(int64 time); |
| 52 SetShellMainEntryPointTime(int64 time); | 51 SetShellMainEntryPointTime(int64 time); |
| 53 SetBrowserMessageLoopStartTime(int64 time); | 52 SetBrowserMessageLoopStartTicks(int64 ticks); |
| 54 SetBrowserWindowDisplayTime(int64 time); | 53 SetBrowserWindowDisplayTicks(int64 ticks); |
| 55 SetBrowserOpenTabsTimeDelta(int64 delta); | 54 SetBrowserOpenTabsTimeDelta(int64 delta); |
| 56 SetFirstWebContentsMainFrameLoadTime(int64 time); | 55 SetFirstWebContentsMainFrameLoadTicks(int64 ticks); |
| 57 SetFirstVisuallyNonEmptyLayoutTime(int64 time); | 56 SetFirstVisuallyNonEmptyLayoutTicks(int64 ticks); |
| 58 | 57 |
| 59 // Get the currently available startup performance times. | 58 // Get the currently available startup performance times. |
| 60 GetStartupPerformanceTimes() => (StartupPerformanceTimes times); | 59 GetStartupPerformanceTimes() => (StartupPerformanceTimes times); |
| 61 }; | 60 }; |
| OLD | NEW |