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 3# found in the LICENSE file. 4 5class TimelineImporter(object): 6 """Interface for classes that can add events to 7 a timeline model from raw event data.""" 8 def __init__(self, model, event_data, import_priority=0): 9 self._model = model 10 self._event_data = event_data 11 self.import_priority = import_priority 12 13 @staticmethod 14 def CanImport(event_data): 15 """Returns true if the importer can process the given event data.""" 16 raise NotImplementedError 17 18 def ImportEvents(self): 19 """Processes the event data and creates and adds 20 new timeline events to the model""" 21 raise NotImplementedError 22 23 def FinalizeImport(self): 24 """Called after all other importers for the model are run.""" 25 raise NotImplementedError 26