OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * Copyright (C) 2012 Intel Inc. All rights reserved. | 3 * Copyright (C) 2012 Intel Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 /** | 78 /** |
79 * @param {!WebInspector.TimelineModel.Record} record | 79 * @param {!WebInspector.TimelineModel.Record} record |
80 * @return {?Object} | 80 * @return {?Object} |
81 */ | 81 */ |
82 highlightQuadForRecord: function(record) | 82 highlightQuadForRecord: function(record) |
83 { | 83 { |
84 throw new Error("Not implemented."); | 84 throw new Error("Not implemented."); |
85 }, | 85 }, |
86 /** | 86 /** |
87 * @param {!WebInspector.TimelineModel.Record} record | 87 * @param {!WebInspector.TimelineModel.Record} record |
| 88 * @return {string} |
| 89 */ |
| 90 titleForRecord: function(record) |
| 91 { |
| 92 throw new Error("Not implemented."); |
| 93 }, |
| 94 /** |
| 95 * @param {!WebInspector.TimelineModel.Record} record |
88 * @param {!WebInspector.Linkifier} linkifier | 96 * @param {!WebInspector.Linkifier} linkifier |
89 * @param {boolean} loadedFromFile | 97 * @param {boolean} loadedFromFile |
90 * @return {?Node} | 98 * @return {?Node} |
91 */ | 99 */ |
92 buildDetailsNode: function(record, linkifier, loadedFromFile) | 100 buildDetailsNode: function(record, linkifier, loadedFromFile) |
93 { | 101 { |
94 throw new Error("Not implemented."); | 102 throw new Error("Not implemented."); |
95 }, | 103 }, |
96 /** | 104 /** |
97 * @param {!WebInspector.TimelineModel.Record} record | 105 * @param {!WebInspector.TimelineModel.Record} record |
98 * @param {!WebInspector.TimelineModel} model | 106 * @param {!WebInspector.TimelineModel} model |
99 * @param {!WebInspector.Linkifier} linkifier | 107 * @param {!WebInspector.Linkifier} linkifier |
100 * @param {function(!DocumentFragment)} callback | 108 * @param {function(!DocumentFragment)} callback |
101 * @param {boolean} loadedFromFile | 109 * @param {boolean} loadedFromFile |
102 */ | 110 */ |
103 generateDetailsContent: function(record, model, linkifier, callback, loadedF
romFile) | 111 generateDetailsContent: function(record, model, linkifier, callback, loadedF
romFile) |
104 { | 112 { |
105 throw new Error("Not implemented."); | 113 throw new Error("Not implemented."); |
106 }, | 114 }, |
107 /** | 115 /** |
108 * @param {string} recordType | 116 * @param {string} recordType |
109 * @param {string=} title | 117 * @param {string=} title |
110 * @return {!Element} | 118 * @return {!Element} |
111 */ | 119 */ |
112 createEventDivider: function(recordType, title) | 120 createEventDivider: function(recordType, title) |
113 { | 121 { |
114 throw new Error("Not implemented."); | 122 throw new Error("Not implemented."); |
| 123 }, |
| 124 /** |
| 125 * @param {!WebInspector.TimelineModel.Record} record |
| 126 * @param {!RegExp} regExp |
| 127 * @return {boolean} |
| 128 */ |
| 129 testContentMatching: function(record, regExp) |
| 130 { |
| 131 throw new Error("Not implemented."); |
115 } | 132 } |
116 } | 133 } |
117 | 134 |
118 /** | 135 /** |
119 * @return {!Object.<string, !WebInspector.TimelineCategory>} | 136 * @return {!Object.<string, !WebInspector.TimelineCategory>} |
120 */ | 137 */ |
121 WebInspector.TimelineUIUtils.categories = function() | 138 WebInspector.TimelineUIUtils.categories = function() |
122 { | 139 { |
123 if (WebInspector.TimelineUIUtils._categories) | 140 if (WebInspector.TimelineUIUtils._categories) |
124 return WebInspector.TimelineUIUtils._categories; | 141 return WebInspector.TimelineUIUtils._categories; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 var contentHelper = new WebInspector.TimelinePopupContentHelper(info.name); | 253 var contentHelper = new WebInspector.TimelinePopupContentHelper(info.name); |
237 var durationText = WebInspector.UIString("%s (at %s)", Number.millisToString
(duration, true), | 254 var durationText = WebInspector.UIString("%s (at %s)", Number.millisToString
(duration, true), |
238 Number.millisToString(startTime - model.minimumRecordTime(), true)); | 255 Number.millisToString(startTime - model.minimumRecordTime(), true)); |
239 contentHelper.appendTextRow(WebInspector.UIString("Duration"), durationText)
; | 256 contentHelper.appendTextRow(WebInspector.UIString("Duration"), durationText)
; |
240 contentHelper.appendTextRow(WebInspector.UIString("CPU time"), Number.millis
ToString(cpuTime, true)); | 257 contentHelper.appendTextRow(WebInspector.UIString("CPU time"), Number.millis
ToString(cpuTime, true)); |
241 contentHelper.appendTextRow(WebInspector.UIString("Message Count"), messageC
ount); | 258 contentHelper.appendTextRow(WebInspector.UIString("Message Count"), messageC
ount); |
242 return contentHelper.contentTable(); | 259 return contentHelper.contentTable(); |
243 } | 260 } |
244 | 261 |
245 /** | 262 /** |
246 * @param {!WebInspector.TimelineModel.Record} record | |
247 * @param {!WebInspector.TimelineModel} model | |
248 * @return {string} | |
249 */ | |
250 WebInspector.TimelineUIUtils.recordTitle = function(record, model) | |
251 { | |
252 var recordData = record.data(); | |
253 if (record.type() === WebInspector.TimelineModel.RecordType.TimeStamp) | |
254 return recordData["message"]; | |
255 if (record.type() === WebInspector.TimelineModel.RecordType.JSFrame) | |
256 return recordData["functionName"]; | |
257 if (WebInspector.TimelineUIUtilsImpl.isEventDivider(record)) { | |
258 var startTime = Number.millisToString(record.startTime() - model.minimum
RecordTime()); | |
259 return WebInspector.UIString("%s at %s", WebInspector.TimelineUIUtils.re
cordStyle(record).title, startTime, true); | |
260 } | |
261 return WebInspector.TimelineUIUtils.recordStyle(record).title; | |
262 } | |
263 | |
264 /** | |
265 * @param {!Object} total | 263 * @param {!Object} total |
266 * @param {!Object} addend | 264 * @param {!Object} addend |
267 */ | 265 */ |
268 WebInspector.TimelineUIUtils.aggregateTimeByCategory = function(total, addend) | 266 WebInspector.TimelineUIUtils.aggregateTimeByCategory = function(total, addend) |
269 { | 267 { |
270 for (var category in addend) | 268 for (var category in addend) |
271 total[category] = (total[category] || 0) + addend[category]; | 269 total[category] = (total[category] || 0) + addend[category]; |
272 } | 270 } |
273 | 271 |
274 /** | 272 /** |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 for (var i = 0; i < stackTrace.length; ++i) { | 638 for (var i = 0; i < stackTrace.length; ++i) { |
641 var stackFrame = stackTrace[i]; | 639 var stackFrame = stackTrace[i]; |
642 var row = stackTraceElement.createChild("div"); | 640 var row = stackTraceElement.createChild("div"); |
643 row.createTextChild(stackFrame.functionName || WebInspector.UIString
("(anonymous function)")); | 641 row.createTextChild(stackFrame.functionName || WebInspector.UIString
("(anonymous function)")); |
644 row.createTextChild(" @ "); | 642 row.createTextChild(" @ "); |
645 var urlElement = this._linkifier.linkifyLocation(this._target, stack
Frame.url, stackFrame.lineNumber - 1); | 643 var urlElement = this._linkifier.linkifyLocation(this._target, stack
Frame.url, stackFrame.lineNumber - 1); |
646 row.appendChild(urlElement); | 644 row.appendChild(urlElement); |
647 } | 645 } |
648 } | 646 } |
649 } | 647 } |
OLD | NEW |