<commit_before><!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() {
      this.expectations_.sortEvents((x, y) => (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,
  };
});
</script><commit_msg>Update UserModel to an ES6 class.<commit_after><!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() {
  class UserModel extends tr.model.EventContainer {
    constructor(parentModel) {
      super();
      this.parentModel_ = parentModel;
      this.expectations_ = new tr.model.EventSet();
    }

    get stableId() {
      return 'UserModel';
    }

    get parentModel() {
      return this.parentModel_;
    }

    sortExpectations() {
      this.expectations_.sortEvents((x, y) => (x.start - y.start));
    }

    get expectations() {
      return this.expectations_;
    }

    shiftTimestampsForward(amount) {
    }

    addCategoriesToDict(categoriesDict) {
    }

    * childEvents() {
      yield* this.expectations;
    }

    * childEventContainers() {
    }

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

  return {
    UserModel,
  };
});
</script>
{'fraction_non_alphanumeric': 0.13169984686064318, 'fraction_numerical': 0.003445635528330781, 'mean_word_length': 2.876854599406528, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3742172', 'n_tokens_mistral': 823, 'n_tokens_neox': 787, 'n_words': 170}