OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1012 case WebInspector.TimelineModel.RecordType.Time: | 1012 case WebInspector.TimelineModel.RecordType.Time: |
1013 case WebInspector.TimelineModel.RecordType.TimeEnd: | 1013 case WebInspector.TimelineModel.RecordType.TimeEnd: |
1014 case WebInspector.TimelineModel.RecordType.TimeStamp: | 1014 case WebInspector.TimelineModel.RecordType.TimeStamp: |
1015 details = this.data["message"]; | 1015 details = this.data["message"]; |
1016 break; | 1016 break; |
1017 default: | 1017 default: |
1018 details = this._linkifyScriptLocation() || this._linkifyTopCallFrame
() || null; | 1018 details = this._linkifyScriptLocation() || this._linkifyTopCallFrame
() || null; |
1019 break; | 1019 break; |
1020 } | 1020 } |
1021 | 1021 |
1022 if (typeof details === "string") | 1022 if (details && !(details instanceof Node)) |
1023 return this._createSpanWithText(details); | 1023 return this._createSpanWithText("" + details); |
1024 | 1024 |
1025 return details ? details : null; | 1025 return details ? details : null; |
1026 }, | 1026 }, |
1027 | 1027 |
1028 /** | 1028 /** |
1029 * @param {string} url | 1029 * @param {string} url |
1030 * @param {number} lineNumber | 1030 * @param {number} lineNumber |
1031 * @param {number=} columnNumber | 1031 * @param {number=} columnNumber |
1032 */ | 1032 */ |
1033 _linkifyLocation: function(url, lineNumber, columnNumber) | 1033 _linkifyLocation: function(url, lineNumber, columnNumber) |
(...skipping 14 matching lines...) Expand all Loading... |
1048 _linkifyTopCallFrame: function(defaultValue) | 1048 _linkifyTopCallFrame: function(defaultValue) |
1049 { | 1049 { |
1050 if (this.stackTrace) | 1050 if (this.stackTrace) |
1051 return this._linkifyCallFrame(this.stackTrace[0]); | 1051 return this._linkifyCallFrame(this.stackTrace[0]); |
1052 if (this.callSiteStackTrace) | 1052 if (this.callSiteStackTrace) |
1053 return this._linkifyCallFrame(this.callSiteStackTrace[0]); | 1053 return this._linkifyCallFrame(this.callSiteStackTrace[0]); |
1054 return defaultValue; | 1054 return defaultValue; |
1055 }, | 1055 }, |
1056 | 1056 |
1057 /** | 1057 /** |
1058 * @param {string=} defaultValue | 1058 * @param {*=} defaultValue |
| 1059 * @return {Element|string} |
1059 */ | 1060 */ |
1060 _linkifyScriptLocation: function(defaultValue) | 1061 _linkifyScriptLocation: function(defaultValue) |
1061 { | 1062 { |
1062 return this.scriptName ? this._linkifyLocation(this.scriptName, this.scr
iptLine, 0) : defaultValue; | 1063 if (this.scriptName) |
| 1064 return this._linkifyLocation(this.scriptName, this.scriptLine, 0); |
| 1065 else |
| 1066 return defaultValue ? "" + defaultValue : null; |
1063 }, | 1067 }, |
1064 | 1068 |
1065 calculateAggregatedStats: function(categories) | 1069 calculateAggregatedStats: function(categories) |
1066 { | 1070 { |
1067 this._aggregatedStats = {}; | 1071 this._aggregatedStats = {}; |
1068 for (var category in categories) | 1072 for (var category in categories) |
1069 this._aggregatedStats[category] = 0; | 1073 this._aggregatedStats[category] = 0; |
1070 this._cpuTime = this._selfTime; | 1074 this._cpuTime = this._selfTime; |
1071 | 1075 |
1072 for (var index = this._children.length; index; --index) { | 1076 for (var index = this._children.length; index; --index) { |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1322 }, | 1326 }, |
1323 | 1327 |
1324 set hidden(hidden) | 1328 set hidden(hidden) |
1325 { | 1329 { |
1326 this._hidden = hidden; | 1330 this._hidden = hidden; |
1327 this.dispatchEventToListeners(WebInspector.TimelineCategory.Events.Visib
ilityChanged, this); | 1331 this.dispatchEventToListeners(WebInspector.TimelineCategory.Events.Visib
ilityChanged, this); |
1328 }, | 1332 }, |
1329 | 1333 |
1330 __proto__: WebInspector.Object.prototype | 1334 __proto__: WebInspector.Object.prototype |
1331 } | 1335 } |
OLD | NEW |