Bug 32610 - Web Inspector: Links to source in CPU profiles should open Scripts (debugger) panel
Summary: Web Inspector: Links to source in CPU profiles should open Scripts (debugger)...
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: 2009-12-16 06:57 PST by Mikhail Naganov
Modified: 2009-12-17 07:34 PST (History)
9 users (show)

See Also:


Attachments
Proposed fix (4.72 KB, patch)
2009-12-16 07:05 PST, Mikhail Naganov
pfeldman: review-
Details | Formatted Diff | Diff
proposed change, comments addressed (6.68 KB, patch)
2009-12-16 13:55 PST, Mikhail Naganov
pfeldman: review-
Details | Formatted Diff | Diff
Proposed fix, comments addressed (7.70 KB, patch)
2009-12-17 06:28 PST, Mikhail Naganov
pfeldman: review-
Details | Formatted Diff | Diff
fixed 'line' argument loss for resources panel (7.71 KB, patch)
2009-12-17 07:21 PST, Mikhail Naganov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Naganov 2009-12-16 06:57:32 PST
It is more convenient to explore performance issues using debugger, not resources panel.
Comment 1 Mikhail Naganov 2009-12-16 07:05:12 PST
Created attachment 44973 [details]
Proposed fix
Comment 2 WebKit Review Bot 2009-12-16 07:07:52 PST
style-queue ran check-webkit-style on attachment 44973 [details] without any errors.
Comment 3 Pavel Feldman 2009-12-16 09:11:32 PST
Comment on attachment 44973 [details]
Proposed fix

>  WebInspector.canShowResourceForURL = function(url, preferredPanel)
>  WebInspector.showResourceForURL = function(url, line, preferredPanel)

It would be much more clear if you made Panel's canShowResource and showResource accept URL instead of resource. That way you would be able to make canShowResourceForURL and showResourceForURL here panel-agnostic.
Comment 4 Mikhail Naganov 2009-12-16 13:55:56 PST
Created attachment 45012 [details]
proposed change, comments addressed
Comment 5 WebKit Review Bot 2009-12-16 14:00:20 PST
style-queue ran check-webkit-style on attachment 45012 [details] without any errors.
Comment 6 Pavel Feldman 2009-12-16 14:24:47 PST
Comment on attachment 45012 [details]
proposed change, comments addressed

> +WebInspector._choosePanelToShowResourceForURL = function(url, preferredPanel)
>  {
> -    var resource = this.resourceForURL(url);
> -    if (!resource)
> -        return false;
> -
> +    var panel = null;
>      if (preferredPanel && preferredPanel in WebInspector.panels) {
> -        var panel = this.panels[preferredPanel];
> -        if (!("showResource" in panel))
> +        panel = this.panels[preferredPanel];
> +        if (!("showResourceForURL" in panel))
>              panel = null;
> -        else if ("canShowResource" in panel && !panel.canShowResource(resource))
> +        else if ("canShowResourceForURL" in panel && !panel.canShowResourceForURL(url))
>              panel = null;
>      }
> +    if (!panel && preferredPanel != "resources")
> +        return this._choosePanelToShowResourceForURL(url, "resources");
> +    return panel;
> +}

Can we implement this a bit more simple?
- Require that any preferredPanel has necessary canShow and show methods
- first check against preferredPanel, in case of failure explicitly check against resources. No need to reenter method.

> +
> +WebInspector.showResourceForURL = function(url, line, preferredPanel)
> +{

This name no longer applies. WebInspector.showScriptOrResourceForURL ?

r- for confusing logic in _choosePanelToShowResourceForURL and name of the method.
Comment 7 Mikhail Naganov 2009-12-17 06:28:38 PST
Created attachment 45060 [details]
Proposed fix, comments addressed
Comment 8 WebKit Review Bot 2009-12-17 06:30:28 PST
style-queue ran check-webkit-style on attachment 45060 [details] without any errors.
Comment 9 Pavel Feldman 2009-12-17 07:20:08 PST
Comment on attachment 45060 [details]
Proposed fix, comments addressed

> +    showSourceLineForURL: function(url, line)
> +    {
> +        this.showResource(WebInspector.resourceForURL(url));

You lose line information here. Rest is Ok.
Comment 10 Mikhail Naganov 2009-12-17 07:21:00 PST
Created attachment 45064 [details]
fixed 'line' argument loss for resources panel
Comment 11 WebKit Review Bot 2009-12-17 07:22:17 PST
style-queue ran check-webkit-style on attachment 45064 [details] without any errors.
Comment 12 WebKit Commit Bot 2009-12-17 07:34:42 PST
Comment on attachment 45064 [details]
fixed 'line' argument loss for resources panel

Clearing flags on attachment: 45064

Committed r52253: <http://trac.webkit.org/changeset/52253>
Comment 13 WebKit Commit Bot 2009-12-17 07:34:48 PST
All reviewed patches have been landed.  Closing bug.