Chromium Code Reviews| Index: tools/profile_chrome/chrome_controller.py |
| diff --git a/tools/profile_chrome/chrome_controller.py b/tools/profile_chrome/chrome_controller.py |
| index 91c2504a54c4e34583644db055ad6cd543dd6fb7..c48c53b103145db5b230062bb094c814f1548bff 100644 |
| --- a/tools/profile_chrome/chrome_controller.py |
| +++ b/tools/profile_chrome/chrome_controller.py |
| @@ -47,14 +47,15 @@ class ChromeTracingController(controllers.BaseController): |
| raise RuntimeError('Performance trace category list marker not found. ' |
| 'Is the correct version of the browser running?') |
| - record_categories = [] |
| - disabled_by_default_categories = [] |
| + record_categories = set() |
|
dsinclair
2014/11/10 14:10:13
Does a set() work the same way as [] for access? W
Sami
2014/11/10 14:39:45
You can iterate over sets the same way as lists (f
|
| + disabled_by_default_categories = set() |
| json_data = json.loads(json_category_list)['traceCategoriesList'] |
| for item in json_data: |
| - if item.startswith('disabled-by-default'): |
| - disabled_by_default_categories.append(item) |
| - else: |
| - record_categories.append(item) |
| + for category in item.split(','): |
| + if category.startswith('disabled-by-default'): |
| + disabled_by_default_categories.add(category) |
| + else: |
| + record_categories.add(category) |
| return record_categories, disabled_by_default_categories |