OLD | NEW |
---|---|
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 from telemetry.value import trace as trace_value_module | |
6 | |
5 class TimelineImporter(object): | 7 class TimelineImporter(object): |
6 """Interface for classes that can add events to | 8 """Reads TracedValue and populates timeline model with what it finds.""" |
nednguyen
2014/08/05 14:34:34
nit: TraceValue
| |
7 a timeline model from an TimelineData.""" | 9 def __init__(self, model, trace_value, import_order): |
8 def __init__(self, model, timeline_data, import_priority=0): | |
9 self._model = model | 10 self._model = model |
10 self._timeline_data = timeline_data | 11 self.import_order = import_order |
11 self.import_priority = import_priority | |
12 | 12 |
13 @staticmethod | 13 @staticmethod |
14 def CanImport(event_data_wrapper): | 14 def GetSupportedPart(): |
15 """Returns true if the importer can process the given event data in the | |
16 wrapper.""" | |
17 raise NotImplementedError | 15 raise NotImplementedError |
18 | 16 |
19 def ImportEvents(self): | 17 def ImportEvents(self): |
20 """Processes the event data in the wrapper and creates and adds | 18 """Processes the event data in the wrapper and creates and adds |
21 new timeline events to the model""" | 19 new timeline events to the model""" |
22 raise NotImplementedError | 20 raise NotImplementedError |
23 | 21 |
24 def FinalizeImport(self): | 22 def FinalizeImport(self): |
25 """Called after all other importers for the model are run.""" | 23 """Called after all other importers for the model are run.""" |
26 raise NotImplementedError | 24 raise NotImplementedError |
OLD | NEW |