Sometimes js code can detach page from it's frame and in that case Events will stay in the TimelineAgent's events stack. Only immediate events will appear at frontend like Send Request
Created attachment 52183 [details] [patch] Initial version.
Created attachment 52291 [details] [patch] Second iteration. Pointer to page will be used for obtaining pointer to inspector.
Comment on attachment 52291 [details] [patch] Second iteration. > if (timelineAgent) { > v8::ScriptOrigin origin = function->GetScriptOrigin(); > if (!origin.ResourceName().IsEmpty()) > - timelineAgent->willCallFunction(v8ValueToWebCoreString(origin.ResourceName()), function->GetScriptLineNumber() + 1); > + timelineAgent->willCallFunction(toWebCoreString(origin.ResourceName()), function->GetScriptLineNumber() + 1); It may be useful to see function calls even if resource name is empty. > + if (inspectedPage) { > + InspectorTimelineAgent* timelineAgent = inspectedPage->inspectorTimelineAgent(); > + if (timelineAgent) > + timelineAgent->didCallFunction(); > + } If you move timelineAgent declaration out of the if before the function call above if (inspectedPage) can be removed. > + if (inspectedPage) { > + InspectorTimelineAgent* timelineAgent = inspectedPage->inspectorTimelineAgent(); > + if (timelineAgent) > + timelineAgent->didDispatchEvent(); > + } Ditto. > + if (inspectedPage) { > + InspectorTimelineAgent* timelineAgent = inspectedPage->inspectorTimelineAgent(); > + if (timelineAgent) > timelineAgent->didDispatchEvent(); > } Just checking if (timelineAgentIsActive) here would make the code more clear. Could we have a test for the case when frame is detached?
Comment on attachment 52291 [details] [patch] Second iteration. > + InspectorTimelineAgent* timelineAgent = inspectedPage->inspectorTimelineAgent(); > if (timelineAgent) { You should combine these two lines. > + InspectorTimelineAgent* timelineAgent = inspectedPage->inspectorTimelineAgent(); > + if (timelineAgent) Ditto. > + InspectorTimelineAgent* timelineAgent = inspectedPage->inspectorTimelineAgent(); > + if (timelineAgent) Ditto.
Created attachment 52307 [details] [patch] Third iteration. Just fixed style problems identified by Timothy.
Comment on attachment 52307 [details] [patch] Third iteration. Clearing flags on attachment: 52307 Committed r56931: <http://trac.webkit.org/changeset/56931>
All reviewed patches have been landed. Closing bug.