| 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.mojom; |
| 6 | 6 |
| 7 // To participate in the tracing ecosystem, implement the TraceProvider | 7 // To participate in the tracing ecosystem, implement the Provider interface |
| 8 // interface and connect to the tracing app. Then, when the provider's Start() | 8 // connect to the tracing service & create a Recorder. Then, when the provider's |
| 9 // function is called collect tracing data and pass it back via the provided | 9 // Start() function is called collect tracing data and pass it back via the |
| 10 // TraceRecorder interface up until Stop() is called. | 10 // provided Recorder interface up until Stop() is called. |
| 11 | 11 |
| 12 interface TraceProvider { | 12 interface Provider { |
| 13 // Categories can either be the empty string to mean the default set of | 13 // Categories can either be the empty string to mean the default set of |
| 14 // categories or a comma-delimited list of categories to trace. | 14 // categories or a comma-delimited list of categories to trace. |
| 15 StartTracing(string categories, TraceRecorder recorder); | 15 StartTracing(string categories, Recorder recorder); |
| 16 StopTracing(); | 16 StopTracing(); |
| 17 }; | 17 }; |
| 18 | 18 |
| 19 interface TraceRecorder { | 19 interface Recorder { |
| 20 Record(string json); | 20 Record(string json); |
| 21 }; | 21 }; |
| 22 | 22 |
| 23 interface TraceCollector { | 23 interface Collector { |
| 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. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 53 SetShellMainEntryPointTime(int64 time); | 53 SetShellMainEntryPointTime(int64 time); |
| 54 SetBrowserMessageLoopStartTicks(int64 ticks); | 54 SetBrowserMessageLoopStartTicks(int64 ticks); |
| 55 SetBrowserWindowDisplayTicks(int64 ticks); | 55 SetBrowserWindowDisplayTicks(int64 ticks); |
| 56 SetBrowserOpenTabsTimeDelta(int64 delta); | 56 SetBrowserOpenTabsTimeDelta(int64 delta); |
| 57 SetFirstWebContentsMainFrameLoadTicks(int64 ticks); | 57 SetFirstWebContentsMainFrameLoadTicks(int64 ticks); |
| 58 SetFirstVisuallyNonEmptyLayoutTicks(int64 ticks); | 58 SetFirstVisuallyNonEmptyLayoutTicks(int64 ticks); |
| 59 | 59 |
| 60 // Get the currently available startup performance times. | 60 // Get the currently available startup performance times. |
| 61 GetStartupPerformanceTimes() => (StartupPerformanceTimes times); | 61 GetStartupPerformanceTimes() => (StartupPerformanceTimes times); |
| 62 }; | 62 }; |
| 63 |
| 64 interface Factory { |
| 65 CreateRecorder(Provider provider); |
| 66 }; |
| OLD | NEW |