Update To 11.40.268.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 tv.exportTo('system_stats', function() {
14   var ObjectSnapshot = tracing.trace_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('base::TraceEventSystemStatsMonitor::SystemStats',
46                           SystemStatsSnapshot);
47
48   return {
49     SystemStatsSnapshot: SystemStatsSnapshot
50   };
51 });
52 </script>