| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 import json | 5 import json |
| 6 | 6 |
| 7 | 7 |
| 8 class TracingConfig(object): | 8 class TracingConfig(object): |
| 9 """Tracing config is the configuration for Chrome tracing. | 9 """Tracing config is the configuration for Chrome tracing. |
| 10 | 10 |
| 11 This produces the trace config JSON string for Chrome tracing. For the details | 11 This produces the trace config JSON string for Chrome tracing. For the details |
| 12 about the JSON string format, see base/trace_event/trace_config.h. | 12 about the JSON string format, see base/trace_event/trace_config.h. |
| 13 """ | 13 """ |
| 14 def __init__(self, tracing_options, tracing_category_filter): | 14 def __init__(self, tracing_options, tracing_category_filter): |
| 15 self._tracing_options = tracing_options | 15 self._tracing_options = tracing_options |
| 16 self._tracing_category_filter = tracing_category_filter | 16 self._tracing_category_filter = tracing_category_filter |
| 17 | 17 |
| 18 @property |
| 19 def tracing_options(self): |
| 20 return self._tracing_options |
| 21 |
| 22 @property |
| 23 def tracing_category_filter(self): |
| 24 return self._tracing_category_filter |
| 25 |
| 18 def GetTraceConfigJsonString(self): | 26 def GetTraceConfigJsonString(self): |
| 19 result = {} | 27 result = {} |
| 20 result.update(self._tracing_options.GetDictForChromeTracing()) | 28 result.update(self._tracing_options.GetDictForChromeTracing()) |
| 21 result.update(self._tracing_category_filter.GetDictForChromeTracing()) | 29 result.update(self._tracing_category_filter.GetDictForChromeTracing()) |
| 22 return json.dumps(result, sort_keys=True) | 30 return json.dumps(result, sort_keys=True) |
| OLD | NEW |