blob: f44074f0fdaf0dbb0d616cc0c1e7ab719dbafd61 [file] [log] [blame]
Chris Craik93216d02015-03-05 13:58:42 -08001<!DOCTYPE html>
2<!--
Chris Craik24385db2015-06-11 11:16:26 -07003Copyright (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.
Chris Craik93216d02015-03-05 13:58:42 -08006-->
7
Chris Craik24385db2015-06-11 11:16:26 -07008<link rel="import" href="/extras/chrome/cc/util.html">
Chris Craik93216d02015-03-05 13:58:42 -08009
10<script>
11'use strict';
12
Chris Craik24385db2015-06-11 11:16:26 -070013tr.exportTo('tr.e.system_stats', function() {
14 var ObjectSnapshot = tr.model.ObjectSnapshot;
Chris Craik93216d02015-03-05 13:58:42 -080015
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>