Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1572)

Unified Diff: Source/devtools/front_end/timeline/TimelineJSProfile.js

Issue 1179543003: DevTools: Do not allow JS frames on top of non-JS invocation events. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/inspector/tracing/timeline-js-samping-tracing-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/timeline/TimelineJSProfile.js
diff --git a/Source/devtools/front_end/timeline/TimelineJSProfile.js b/Source/devtools/front_end/timeline/TimelineJSProfile.js
index 7638f747363bce08ba6619ae044b77118e88a3ac..c49f7f5d7619d555c980bd1eba433e22fd96af48 100644
--- a/Source/devtools/front_end/timeline/TimelineJSProfile.js
+++ b/Source/devtools/front_end/timeline/TimelineJSProfile.js
@@ -82,7 +82,6 @@ WebInspector.TimelineJSProfileProcessor.generateJSFrameEvents = function(events)
var jsFrameEvents = [];
var jsFramesStack = [];
var lockedJsStackDepth = [];
- var invocationEventsDepth = 0;
var currentSamplingIntervalMs = 0.1;
var lastStackSampleTime = 0;
var ordinal = 0;
@@ -114,18 +113,17 @@ WebInspector.TimelineJSProfileProcessor.generateJSFrameEvents = function(events)
extractStackTrace(e);
// For the duration of the event we cannot go beyond the stack associated with it.
lockedJsStackDepth.push(jsFramesStack.length);
- if (isJSInvocationEvent(e))
- ++invocationEventsDepth;
}
/**
* @param {!WebInspector.TracingModel.Event} e
+ * @param {?WebInspector.TracingModel.Event} parent
*/
- function onInstantEvent(e)
+ function onInstantEvent(e, parent)
{
e.ordinal = ++ordinal;
updateSamplingInterval(e);
- if (invocationEventsDepth)
+ if (parent && isJSInvocationEvent(parent))
extractStackTrace(e);
}
@@ -134,8 +132,6 @@ WebInspector.TimelineJSProfileProcessor.generateJSFrameEvents = function(events)
*/
function onEndEvent(e)
{
- if (isJSInvocationEvent(e))
- --invocationEventsDepth;
truncateJSStack(lockedJsStackDepth.pop(), e.endTime);
}
« no previous file with comments | « LayoutTests/inspector/tracing/timeline-js-samping-tracing-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698