 Chromium Code Reviews
 Chromium Code Reviews Issue 19772005:
  [telemetry] Timeline model cleanups  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 19772005:
  [telemetry] Timeline model cleanups  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| Index: tools/telemetry/telemetry/core/timeline/async_slice.py | 
| diff --git a/tools/telemetry/telemetry/core/timeline/tracing/async_slice.py b/tools/telemetry/telemetry/core/timeline/async_slice.py | 
| similarity index 54% | 
| rename from tools/telemetry/telemetry/core/timeline/tracing/async_slice.py | 
| rename to tools/telemetry/telemetry/core/timeline/async_slice.py | 
| index 03031c1e6e43bb5afdcd66c5444f37086507a965..140eadc651b7893e16c64b71b993b16b8e3e0514 100644 | 
| --- a/tools/telemetry/telemetry/core/timeline/tracing/async_slice.py | 
| +++ b/tools/telemetry/telemetry/core/timeline/async_slice.py | 
| @@ -2,20 +2,27 @@ | 
| # Use of this source code is governed by a BSD-style license that can be | 
| # found in the LICENSE file. | 
| -import telemetry.core.timeline.tracing.slice as tracing_slice | 
| +import telemetry.core.timeline.event as event | 
| -class AsyncSlice(tracing_slice.Slice): | 
| +class AsyncSlice(event.TimelineEvent): | 
| ''' A AsyncSlice represents an interval of time during which an | 
| asynchronous operation is in progress. An AsyncSlice consumes no CPU time | 
| itself and so is only associated with Threads at its start and end point. | 
| ''' | 
| - def __init__(self, category, name, timestamp, args=None, parent=None): | 
| + def __init__(self, category, name, timestamp, args=None): | 
| super(AsyncSlice, self).__init__( | 
| - category, name, timestamp, args=args, parent=parent) | 
| + category, name, timestamp, duration=0, args=args) | 
| + self.parent_slice = None | 
| self.start_thread = None | 
| self.end_thread = None | 
| + self.sub_slices = [] | 
| self.id = None | 
| def AddSubSlice(self, sub_slice): | 
| 
Tim Song
2013/07/18 22:56:36
We should just assign the parent_slice here instea
 
nduca
2013/07/18 23:03:40
No.
 | 
| - super(AsyncSlice, self).AddSubSlice(sub_slice) | 
| - self.children.append(sub_slice) | 
| + assert sub_slice.parent_slice == self | 
| + self.sub_slices.append(sub_slice) | 
| + | 
| + | 
| + def IterEventsInThisContainerRecrusively(self): | 
| + for sub_slice in self.sub_slices: | 
| + yield sub_slice |