Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / trace_viewer / tracing / analysis / stub_analysis_results.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="/base.html">
9 <script>
10 'use strict';
11
12 tv.exportTo('tracing.analysis', function() {
13   function StubAnalysisResults() {
14     this.headers = [];
15     this.info = [];
16     this.tables = [];
17   }
18   StubAnalysisResults.prototype = {
19     __proto__: Object.protoype,
20
21     appendTable: function(parent, className) {
22       var table = {
23         className: className,
24         rows: []
25       };
26       table.className = className;
27       table.classList = [];
28       table.classList.push(className);
29       table.classList.add = function(className) {
30         table.classList.push(className);
31       };
32       this.tables.push(table);
33       return table;
34     },
35
36     appendHeader: function(label) {
37       var header = {
38         label: label
39       };
40       this.headers.push(header);
41       return header;
42     },
43
44     appendInfo: function(label, value) {
45       this.info.push({label: label, value: value});
46     },
47
48     appendDetailsRow: function(table, start, duration, selfTime, args,
49                                selectionGenerator, cpuDuration) {
50       table.rows.push({
51         start: start,
52         duration: duration,
53         selfTime: selfTime,
54         args: args,
55         selectionGenerator: selectionGenerator,
56         cpuDuration: cpuDuration});
57     },
58
59     appendHeadRow: function(table) {
60       if (table.headerRow)
61         throw new Error('Only one header row allowed.');
62       table.headerRow = [];
63       return table.headerRow;
64     },
65
66     appendTableCell: function(table, row, text) {
67       row.push(text);
68     },
69
70     appendSpacingRow: function(table) {
71       var row = {spacing: true};
72       table.rows.push(row);
73       return row;
74     },
75
76     appendInfoRow: function(table, label, opt_text) {
77       var row = {label: label, text: opt_text};
78       table.rows.push(row);
79       return row;
80     },
81
82     appendInfoRowTime: function(table, label, time) {
83       var row = {label: label, time: time};
84       table.rows.push(row);
85       return row;
86     },
87
88     appendDataRow: function(table, label, duration, cpuDuration, selfTime,
89                             cpuSelfTime, occurences, percentage, details,
90                             selectionGenerator) {
91       var row = {
92         label: label,
93         duration: duration,
94         cpuDuration: cpuDuration,
95         selfTime: selfTime,
96         cpuSelfTime: cpuSelfTime,
97         occurences: occurences,
98         percentage: percentage,
99         details: details,
100         selectionGenerator: selectionGenerator
101       };
102       table.rows.push(row);
103       return row;
104     }
105   };
106
107   return {
108     StubAnalysisResults: StubAnalysisResults
109   };
110 });
111 </script>