1<!DOCTYPE html> 2<!-- 3Copyright (c) 2016 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/model/event_container.html"> 9 10<script> 11'use strict'; 12 13tr.exportTo('tr.model.um', function() { 14 function UserModel(parentModel) { 15 tr.model.EventContainer.call(this); 16 this.parentModel_ = parentModel; 17 this.expectations_ = new tr.model.EventSet(); 18 } 19 20 UserModel.prototype = { 21 __proto__: tr.model.EventContainer.prototype, 22 23 get stableId() { 24 return 'UserModel'; 25 }, 26 27 get parentModel() { 28 return this.parentModel_; 29 }, 30 31 sortExpectations: function() { 32 Array.prototype.sort.call(this.expectations_, function(x, y) { 33 return x.start - y.start; 34 }); 35 }, 36 37 get expectations() { 38 return this.expectations_; 39 }, 40 41 shiftTimestampsForward: function(amount) { 42 }, 43 44 addCategoriesToDict: function(categoriesDict) { 45 }, 46 47 iterateAllEventsInThisContainer: function(eventTypePredicate, 48 callback, opt_this) { 49 if (eventTypePredicate.call(opt_this, tr.model.um.UserExpectation)) 50 this.expectations.forEach(callback, opt_this); 51 }, 52 53 iterateAllChildEventContainers: function(callback, opt_this) { 54 }, 55 56 updateBounds: function() { 57 this.bounds.reset(); 58 this.expectations.forEach(function(expectation) { 59 expectation.addBoundsToRange(this.bounds); 60 }, this); 61 } 62 }; 63 64 return { 65 UserModel: UserModel 66 }; 67}); 68</script> 69 70