[Webkit-unassigned] [Bug 32610] Web Inspector: Links to source in CPU profiles should open Scripts (debugger) panel

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Dec 16 14:24:48 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=32610


Pavel Feldman <pfeldman at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #45012|review?                     |review-
               Flag|                            |




--- Comment #6 from Pavel Feldman <pfeldman at chromium.org>  2009-12-16 14:24:47 PST ---
(From update of attachment 45012)
> +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.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list