Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 class TracingController(object): | |
| 6 def __init__(self, tracing_controller_backend): | |
| 7 """Provides control of the tracing systems supported by telemetry.""" | |
| 8 self._tracing_controller_backend = tracing_controller_backend | |
| 9 | |
| 10 def Start(self, category_filter, trace_options, timeout=10): | |
| 11 """Starts tracing. | |
| 12 | |
| 13 trace_options specifies which tracing systems to activate. Category filter | |
| 14 allows fine-tuning of the data that are collected by the selected tracing | |
| 15 systems. | |
| 16 """ | |
|
nednguyen
2014/08/04 22:12:06
Should we add assert self.AreOptionsSupported(trac
| |
| 17 self._tracing_controller_backend.Start( | |
| 18 category_filter, trace_options, timeout) | |
| 19 | |
| 20 def Stop(self): | |
| 21 """Stops tracing and returns a TraceValue.""" | |
| 22 return self._tracing_controller_backend.Stop() | |
| 23 | |
| 24 @property | |
| 25 def is_tracing_running(self): | |
| 26 return self._tracing_controller_backend.is_tracing_running | |
| 27 | |
| 28 def AreOptionsSupported(self, trace_options): | |
| 29 """Returns whether the tracers requested by trace_options are supported. | |
| 30 | |
| 31 If the browser is not running at the time that this query is issued, then | |
| 32 no answer can be provided. | |
| 33 """ | |
| 34 return self._tracing_controller_backend.AreOptionsSupported(trace_options) | |
| OLD | NEW |