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 [DartPackage="mojo_services"] |
5 module tracing; | 6 module tracing; |
6 | 7 |
7 // To participate in the tracing ecosystem, implement the TraceController | 8 // To participate in the tracing ecosystem, implement the TraceProvider |
8 // interface and connect to the tracing app. Then, when the controller's Start() | 9 // 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 | 10 // function is called collect tracing data and pass it back via the provided |
10 // TraceDataCollector interface up until Stop() is called. | 11 // TraceRecorder interface up until Stop() is called. |
11 | 12 |
12 interface TraceController { | 13 [ServiceName="tracing::TraceProvider"] |
| 14 interface TraceProvider { |
13 // Categories can either be the empty string to mean the default set of | 15 // Categories can either be the empty string to mean the default set of |
14 // categories or a comma-delimited list of categories to trace. | 16 // categories or a comma-delimited list of categories to trace. |
15 StartTracing(string categories, TraceDataCollector collector); | 17 StartTracing(string categories, TraceRecorder recorder); |
16 StopTracing(); | 18 StopTracing(); |
17 }; | 19 }; |
18 | 20 |
19 interface TraceDataCollector { | 21 interface TraceRecorder { |
20 DataCollected(string json); | 22 Record(string json); |
21 }; | 23 }; |
22 | 24 |
23 interface TraceCoordinator { | 25 [ServiceName="tracing::TraceCollector"] |
24 // Request tracing data from all connected TraceControllers to stream to | 26 interface TraceCollector { |
| 27 // Request tracing data from all connected providers to stream to |
25 // |stream|. | 28 // |stream|. |
26 Start(handle<data_pipe_producer> stream, string categories); | 29 Start(handle<data_pipe_producer> stream, string categories); |
27 | 30 |
28 // Stop tracing and flush results to the |stream| passed in to Start(). | 31 // Stop tracing and flush results to the |stream| passed in to Start(). |
29 // Closes |stream| when all data is collected. | 32 // Closes |stream| when all data is collected. |
30 StopAndFlush(); | 33 StopAndFlush(); |
31 }; | 34 }; |
OLD | NEW |