1<!DOCTYPE html>
2<!--
3Copyright (c) 2013 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/extras/chrome/cc/util.html">
9
10<script>
11'use strict';
12
13tr.exportTo('tr.e.system_stats', function() {
14  var ObjectSnapshot = tr.model.ObjectSnapshot;
15
16  /**
17   * @constructor
18   */
19  function SystemStatsSnapshot(objectInstance, ts, args) {
20    ObjectSnapshot.apply(this, arguments);
21    this.objectInstance = objectInstance;
22    this.ts = ts;
23    this.args = args;
24    this.stats = args;
25  }
26
27  SystemStatsSnapshot.prototype = {
28    __proto__: ObjectSnapshot.prototype,
29
30    initialize: function() {
31      if (this.args.length == 0)
32        throw new Error('No system stats snapshot data.');
33      this.stats_ = this.args;
34    },
35
36    getStats: function() {
37      return this.stats_;
38    },
39
40    setStats: function(stats) {
41      this.stats_ = stats;
42    }
43  };
44
45  ObjectSnapshot.register(
46    SystemStatsSnapshot,
47    {typeName: 'base::TraceEventSystemStatsMonitor::SystemStats'});
48
49  return {
50    SystemStatsSnapshot: SystemStatsSnapshot
51  };
52});
53</script>
54