1<!DOCTYPE html> 2<!-- 3Copyright (c) 2015 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 8<link rel="import" href="/tracing/base/base.html"> 9 10<script> 11'use strict'; 12 13tr.exportTo('tr.ui.tracks', function() { 14 15 /** 16 * EventToTrackMap provides a mapping mechanism between events and the 17 * tracks those events belong on. 18 * @constructor 19 */ 20 function EventToTrackMap() {} 21 22 EventToTrackMap.prototype = { 23 addEvent: function(event, track) { 24 if (!track) 25 throw new Error('Must provide a track.'); 26 this[event.guid] = track; 27 } 28 }; 29 30 return { 31 EventToTrackMap: EventToTrackMap 32 }; 33}); 34</script> 35