Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / trace_viewer / system_stats / system_stats_snapshot.html
1 <!DOCTYPE html>
2 <!--
3 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style license that can be
5 // found in the LICENSE file.
6 -->
7
8 <link rel="import" href="/cc/util.html">
9
10 <script>
11 'use strict';
12
13 tvcm.exportTo('system_stats', function() {
14   var ObjectSnapshot = tracing.trace_model.ObjectSnapshot;
15
16   /**
17    * @constructor
18    */
19   function SystemStatsSnapshot() {
20     ObjectSnapshot.apply(this, arguments);
21   }
22
23   /**
24    * @constructor
25    */
26   function SystemStatsSnapshot(objectInstance, ts, args) {
27     this.objectInstance = objectInstance;
28     this.ts = ts;
29     this.args = args;
30     this.stats = args;
31   }
32
33   SystemStatsSnapshot.prototype = {
34     __proto__: ObjectSnapshot.prototype,
35
36     initialize: function() {
37       if (this.args.length == 0)
38         throw new Error('No system stats snapshot data.');
39       this.stats_ = this.args;
40     },
41
42     getStats: function() {
43       return this.stats_;
44     },
45
46     setStats: function(stats) {
47       this.stats_ = stats;
48     }
49   };
50
51   ObjectSnapshot.register('base::TraceEventSystemStatsMonitor::SystemStats',
52                           SystemStatsSnapshot);
53
54   return {
55     SystemStatsSnapshot: SystemStatsSnapshot
56   };
57 });
58 </script>