| // Copyright 2014 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| module tracing; |
| |
| // To participate in the tracing ecosystem, implement the TraceController |
| // interface and connect to the tracing app. Then, when the controller's Start() |
| // function is called collect tracing data and pass it back via the provided |
| // TraceDataCollector interface up until Stop() is called. |
| |
| interface TraceController { |
| StartTracing(string categories, TraceDataCollector collector); |
| StopTracing(); |
| }; |
| |
| interface TraceDataCollector { |
| DataCollected(string json); |
| }; |
| |
| interface TraceCoordinator { |
| // Request tracing data from all connected TraceControllers to stream to |
| // |stream|. |
| Start(handle<data_pipe_producer> stream, string categories); |
| |
| // Stop tracing and flush results to file. |
| StopAndFlush(); |
| }; |