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.e.deep_reports', function() {
14  function ScalarValue(page, name, units, value,
15                       opt_important, opt_description) {
16    this.type = 'scalar';
17    this.page = page;
18    this.name = name;
19    this.units = units;
20    this.value = value;
21    this.important = opt_important !== undefined ? opt_important : false;
22    this.description = opt_description || '';
23  }
24  ScalarValue.fromDict = function(page, dict) {
25    if (dict.type !== 'scalar')
26      throw new Error('wat');
27    var v = new ScalarValue(page, dict.name, dict.units, dict.value);
28    v.important = dict.important;
29    v.description = dict.description;
30    v.value = dict.value;
31    return v;
32  }
33
34  ScalarValue.prototype = {
35
36  };
37
38  return {
39    ScalarValue: ScalarValue
40  };
41});
42</script>
43