| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 | 5 |
| 6 WebInspector.TimelineJSProfileProcessor = { }; | 6 WebInspector.TimelineJSProfileProcessor = { }; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * @param {!WebInspector.CPUProfileDataModel} jsProfileModel | 9 * @param {!WebInspector.CPUProfileDataModel} jsProfileModel |
| 10 * @param {!WebInspector.TracingModel.Thread} thread | 10 * @param {!WebInspector.TracingModel.Thread} thread |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 for (var j = 0; node.parent; node = node.parent) | 36 for (var j = 0; node.parent; node = node.parent) |
| 37 callFrames[j++] = /** @type {!RuntimeAgent.CallFrame} */ (node); | 37 callFrames[j++] = /** @type {!RuntimeAgent.CallFrame} */ (node); |
| 38 } | 38 } |
| 39 var jsSampleEvent = new WebInspector.TracingModel.Event(WebInspector.Tra
cingModel.DevToolsTimelineEventCategory, | 39 var jsSampleEvent = new WebInspector.TracingModel.Event(WebInspector.Tra
cingModel.DevToolsTimelineEventCategory, |
| 40 WebInspector.TimelineModel.RecordType.JSSample, | 40 WebInspector.TimelineModel.RecordType.JSSample, |
| 41 WebInspector.TracingModel.Phase.Instant, timestamps[i], thread); | 41 WebInspector.TracingModel.Phase.Instant, timestamps[i], thread); |
| 42 jsSampleEvent.args["data"] = { stackTrace: callFrames }; | 42 jsSampleEvent.args["data"] = { stackTrace: callFrames }; |
| 43 jsEvents.push(jsSampleEvent); | 43 jsEvents.push(jsSampleEvent); |
| 44 } | 44 } |
| 45 return jsEvents; | 45 return jsEvents; |
| 46 } | 46 }; |
| 47 | 47 |
| 48 /** | 48 /** |
| 49 * @param {!Array<!WebInspector.TracingModel.Event>} events | 49 * @param {!Array<!WebInspector.TracingModel.Event>} events |
| 50 * @return {!Array<!WebInspector.TracingModel.Event>} | 50 * @return {!Array<!WebInspector.TracingModel.Event>} |
| 51 */ | 51 */ |
| 52 WebInspector.TimelineJSProfileProcessor.generateJSFrameEvents = function(events) | 52 WebInspector.TimelineJSProfileProcessor.generateJSFrameEvents = function(events) |
| 53 { | 53 { |
| 54 /** | 54 /** |
| 55 * @param {!RuntimeAgent.CallFrame} frame1 | 55 * @param {!RuntimeAgent.CallFrame} frame1 |
| 56 * @param {!RuntimeAgent.CallFrame} frame2 | 56 * @param {!RuntimeAgent.CallFrame} frame2 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 if (WebInspector.TracingModel.isTopLevelEvent(events[i])) | 206 if (WebInspector.TracingModel.isTopLevelEvent(events[i])) |
| 207 return events[i]; | 207 return events[i]; |
| 208 } | 208 } |
| 209 return null; | 209 return null; |
| 210 } | 210 } |
| 211 | 211 |
| 212 var firstTopLevelEvent = findFirstTopLevelEvent(events); | 212 var firstTopLevelEvent = findFirstTopLevelEvent(events); |
| 213 if (firstTopLevelEvent) | 213 if (firstTopLevelEvent) |
| 214 WebInspector.TimelineModel.forEachEvent(events, onStartEvent, onEndEvent
, onInstantEvent, firstTopLevelEvent.startTime); | 214 WebInspector.TimelineModel.forEachEvent(events, onStartEvent, onEndEvent
, onInstantEvent, firstTopLevelEvent.startTime); |
| 215 return jsFrameEvents; | 215 return jsFrameEvents; |
| 216 } | 216 }; |
| OLD | NEW |