blob: dc5f867b3ffdea79b9c47fb913ff19c2eca098d4 [file] [log] [blame]
<!DOCTYPE html>
<!--
Copyright (c) 2013 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="/tracing/base/base.html">
<link rel="import" href="/tracing/importer/importer.html">
<script>
'use strict';
/**
* @fileoverview Base class for trace data importers.
*/
tr.exportTo('tr.importer', function() {
/**
* Importer for empty strings and arrays.
* @constructor
*/
function EmptyImporter(events) {
this.importPriority = 0;
};
EmptyImporter.canImport = function(eventData) {
if (eventData instanceof Array && eventData.length == 0)
return true;
if (typeof(eventData) === 'string' || eventData instanceof String) {
return eventData.length == 0;
}
return false;
};
EmptyImporter.prototype = {
__proto__: tr.importer.Importer.prototype,
get importerName() {
return 'EmptyImporter';
}
};
tr.importer.Importer.register(EmptyImporter);
return {
EmptyImporter: EmptyImporter
};
});
</script>