Bug 36890 - Web Inspector: Timeline Events are not propagated to frontend.
Summary: Web Inspector: Timeline Events are not propagated to frontend.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-31 10:17 PDT by Ilya Tikhonovsky
Modified: 2010-04-01 12:58 PDT (History)
4 users (show)

See Also:


Attachments
[patch] Initial version. (2.33 KB, patch)
2010-03-31 10:19 PDT, Ilya Tikhonovsky
no flags Details | Formatted Diff | Diff
[patch] Second iteration. (5.56 KB, patch)
2010-04-01 06:47 PDT, Ilya Tikhonovsky
yurys: review+
Details | Formatted Diff | Diff
[patch] Third iteration. (5.69 KB, patch)
2010-04-01 10:16 PDT, Ilya Tikhonovsky
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.