Bug 36890

Summary: Web Inspector: Timeline Events are not propagated to frontend.
Product: WebKit Reporter: Ilya Tikhonovsky <loislo>
Component: Web Inspector (Deprecated)Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, pfeldman, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[patch] Initial version.
none
[patch] Second iteration.
yurys: review+
[patch] Third iteration. none

Description Ilya Tikhonovsky 2010-03-31 10:17:13 PDT
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
Comment 1 Ilya Tikhonovsky 2010-03-31 10:19:46 PDT
Created attachment 52183 [details]
[patch] Initial version.
Comment 2 Ilya Tikhonovsky 2010-04-01 06:47:26 PDT
Created attachment 52291 [details]
[patch] Second iteration.

Pointer to page will be used for obtaining pointer to inspector.
Comment 3 Yury Semikhatsky 2010-04-01 07:21:40 PDT
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 4 Timothy Hatcher 2010-04-01 08:50:50 PDT
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.
Comment 5 Ilya Tikhonovsky 2010-04-01 10:16:28 PDT
Created attachment 52307 [details]
[patch] Third iteration.

Just fixed style problems identified by Timothy.
Comment 6 WebKit Commit Bot 2010-04-01 12:58:41 PDT
Comment on attachment 52307 [details]
[patch] Third iteration.

Clearing flags on attachment: 52307

Committed r56931: <http://trac.webkit.org/changeset/56931>
Comment 7 WebKit Commit Bot 2010-04-01 12:58:46 PDT
All reviewed patches have been landed.  Closing bug.