OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 class TimelineEvent(object): | 5 class TimelineEvent(object): |
6 """Represents a timeline event.""" | 6 """Represents a timeline event.""" |
7 def __init__(self, name, start_time_ms, duration_ms, args=None): | 7 def __init__(self, name, start_time_ms, duration_ms, args=None): |
8 self.name = name | 8 self.name = name |
9 self.start_time_ms = start_time_ms | 9 self.start_time_ms = start_time_ms |
10 self.duration_ms = duration_ms | 10 self.duration_ms = duration_ms |
(...skipping 28 matching lines...) Expand all Loading... |
39 events.append(item) | 39 events.append(item) |
40 for child in item.children: | 40 for child in item.children: |
41 TimelineEvent._GetAllChildrenRecursive(events, child) | 41 TimelineEvent._GetAllChildrenRecursive(events, child) |
42 | 42 |
43 def GetAllChildrenRecursive(self, include_self=False): | 43 def GetAllChildrenRecursive(self, include_self=False): |
44 events = [] | 44 events = [] |
45 TimelineEvent._GetAllChildrenRecursive(events, self) | 45 TimelineEvent._GetAllChildrenRecursive(events, self) |
46 if not include_self: | 46 if not include_self: |
47 del events[0] | 47 del events[0] |
48 return events | 48 return events |
OLD | NEW |