1<!DOCTYPE html> 2<!-- 3Copyright (c) 2013 The Chromium Authors. All rights reserved. 4Use of this source code is governed by a BSD-style license that can be 5found in the LICENSE file. 6--> 7<link rel="import" href="/tracing/base/base.html"> 8<link rel="import" href="/tracing/importer/importer.html"> 9 10<script> 11'use strict'; 12 13/** 14 * @fileoverview Base class for trace data importers. 15 */ 16tr.exportTo('tr.importer', function() { 17 /** 18 * Importer for empty strings and arrays. 19 * @constructor 20 */ 21 function EmptyImporter(events) { 22 this.importPriority = 0; 23 }; 24 25 EmptyImporter.canImport = function(eventData) { 26 if (eventData instanceof Array && eventData.length == 0) 27 return true; 28 if (typeof(eventData) === 'string' || eventData instanceof String) { 29 return eventData.length == 0; 30 } 31 return false; 32 }; 33 34 EmptyImporter.prototype = { 35 __proto__: tr.importer.Importer.prototype, 36 37 get importerName() { 38 return 'EmptyImporter'; 39 } 40 }; 41 42 tr.importer.Importer.register(EmptyImporter); 43 44 return { 45 EmptyImporter: EmptyImporter 46 }; 47}); 48</script> 49