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 class TimelineImporter(object): | 5 class TimelineImporter(object): |
6 """Interface for classes that can add events to | 6 """Reads TraceData and populates timeline model with what it finds.""" |
7 a timeline model from an TimelineData.""" | 7 def __init__(self, model, trace_data, import_order): |
8 def __init__(self, model, timeline_data, import_priority=0): | |
9 self._model = model | 8 self._model = model |
10 self._timeline_data = timeline_data | 9 self._trace_data = trace_data |
11 self.import_priority = import_priority | 10 self.import_order = import_order |
12 | 11 |
13 @staticmethod | 12 @staticmethod |
14 def CanImport(event_data_wrapper): | 13 def GetSupportedPart(): |
15 """Returns true if the importer can process the given event data in the | |
16 wrapper.""" | |
17 raise NotImplementedError | 14 raise NotImplementedError |
18 | 15 |
19 def ImportEvents(self): | 16 def ImportEvents(self): |
20 """Processes the event data in the wrapper and creates and adds | 17 """Processes the event data in the wrapper and creates and adds |
21 new timeline events to the model""" | 18 new timeline events to the model""" |
22 raise NotImplementedError | 19 raise NotImplementedError |
23 | 20 |
24 def FinalizeImport(self): | 21 def FinalizeImport(self): |
25 """Called after all other importers for the model are run.""" | 22 """Called after all other importers for the model are run.""" |
26 raise NotImplementedError | 23 raise NotImplementedError |
OLD | NEW |