summaryrefslogtreecommitdiff
path: root/chromium/third_party/catapult/tracing/tracing/model/user_model/user_model.html
blob: fd30d6a610b113da9c1da2557e0e0d2201b7c108 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html>
<!--
Copyright (c) 2016 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/model/event_container.html">

<script>
'use strict';

tr.exportTo('tr.model.um', function() {
  function UserModel(parentModel) {
    tr.model.EventContainer.call(this);
    this.parentModel_ = parentModel;
    this.expectations_ = new tr.model.EventSet();
  }

  UserModel.prototype = {
    __proto__: tr.model.EventContainer.prototype,

    get stableId() {
      return 'UserModel';
    },

    get parentModel() {
      return this.parentModel_;
    },

    sortExpectations: function() {
      Array.prototype.sort.call(this.expectations_, function(x, y) {
        return x.start - y.start;
      });
    },

    get expectations() {
      return this.expectations_;
    },

    shiftTimestampsForward: function(amount) {
    },

    addCategoriesToDict: function(categoriesDict) {
    },

    childEvents: function*() {
      yield * this.expectations;
    },

    childEventContainers: function*() {
    },

    updateBounds: function() {
      this.bounds.reset();
      this.expectations.forEach(function(expectation) {
        expectation.addBoundsToRange(this.bounds);
      }, this);
    }
  };

  return {
    UserModel: UserModel
  };
});
</script>