[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 00:40:16 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 031320b858c3482e64f45628e13b86409cd98e5a
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 17 15:34:33 2009 +0000

    2009-12-17  Mikhail Naganov  <mnaganov at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            Advice links to source code in CPU profiler to open in debugger,
            not in resources tab.
    
            Also work around the case when resources are disabled, but scripts are present.
    
            https://bugs.webkit.org/show_bug.cgi?id=32610
    
            * inspector/front-end/Panel.js:
            (WebInspector.Panel.prototype.updateMainViewWidth):
            (WebInspector.Panel.prototype.canShowSourceLineForURL):
            (WebInspector.Panel.prototype.showSourceLineForURL):
            * inspector/front-end/ProfileDataGridTree.js:
            (WebInspector.ProfileDataGridNode.prototype.createCell):
            * inspector/front-end/ResourcesPanel.js:
            (WebInspector.ResourcesPanel.prototype.canShowSourceLineForURL):
            (WebInspector.ResourcesPanel.prototype.showSourceLineForURL):
            * inspector/front-end/ScriptsPanel.js:
            (WebInspector.ScriptsPanel.prototype.scriptForURL):
            (WebInspector.ScriptsPanel.prototype.canShowSourceLineForURL):
            (WebInspector.ScriptsPanel.prototype.showSourceLineForURL):
            (WebInspector.ScriptsPanel.prototype._showScriptOrResource):
            * inspector/front-end/inspector.js:
            (WebInspector.documentClick.followLink):
            (WebInspector.documentClick):
            (WebInspector._choosePanelToShowSourceLineForURL):
            (WebInspector.canShowSourceLineForURL):
            (WebInspector.showSourceLineForURL):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52253 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9f10264..975bc96 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,35 @@
+2009-12-17  Mikhail Naganov  <mnaganov at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Advice links to source code in CPU profiler to open in debugger,
+        not in resources tab.
+
+        Also work around the case when resources are disabled, but scripts are present.
+
+        https://bugs.webkit.org/show_bug.cgi?id=32610
+
+        * inspector/front-end/Panel.js:
+        (WebInspector.Panel.prototype.updateMainViewWidth):
+        (WebInspector.Panel.prototype.canShowSourceLineForURL):
+        (WebInspector.Panel.prototype.showSourceLineForURL):
+        * inspector/front-end/ProfileDataGridTree.js:
+        (WebInspector.ProfileDataGridNode.prototype.createCell):
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.ResourcesPanel.prototype.canShowSourceLineForURL):
+        (WebInspector.ResourcesPanel.prototype.showSourceLineForURL):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype.scriptForURL):
+        (WebInspector.ScriptsPanel.prototype.canShowSourceLineForURL):
+        (WebInspector.ScriptsPanel.prototype.showSourceLineForURL):
+        (WebInspector.ScriptsPanel.prototype._showScriptOrResource):
+        * inspector/front-end/inspector.js:
+        (WebInspector.documentClick.followLink):
+        (WebInspector.documentClick):
+        (WebInspector._choosePanelToShowSourceLineForURL):
+        (WebInspector.canShowSourceLineForURL):
+        (WebInspector.showSourceLineForURL):
+
 2009-12-15  Philippe Normand  <pnormand at igalia.com>
 
         Reviewed by Xan Lopez.
diff --git a/WebCore/inspector/front-end/Panel.js b/WebCore/inspector/front-end/Panel.js
index 95ce6b4..51b987b 100644
--- a/WebCore/inspector/front-end/Panel.js
+++ b/WebCore/inspector/front-end/Panel.js
@@ -363,6 +363,16 @@ WebInspector.Panel.prototype = {
     updateMainViewWidth: function(width)
     {
         // Should be implemented by ancestors.
+    },
+
+    canShowSourceLineForURL: function(url)
+    {
+        return false;
+    },
+
+    showSourceLineForURL: function(url, line)
+    {
+        return false;
     }
 }
 
diff --git a/WebCore/inspector/front-end/ProfileDataGridTree.js b/WebCore/inspector/front-end/ProfileDataGridTree.js
index 9a7c741..db156bf 100644
--- a/WebCore/inspector/front-end/ProfileDataGridTree.js
+++ b/WebCore/inspector/front-end/ProfileDataGridTree.js
@@ -102,6 +102,7 @@ WebInspector.ProfileDataGridNode.prototype = {
             urlElement.className = "profile-node-file webkit-html-resource-link";
             urlElement.href = this.profileNode.url;
             urlElement.lineNumber = this.profileNode.lineNumber;
+            urlElement.preferredPanel = "scripts";
 
             if (this.profileNode.lineNumber > 0)
                 urlElement.textContent = fileName + ":" + this.profileNode.lineNumber;
diff --git a/WebCore/inspector/front-end/ResourcesPanel.js b/WebCore/inspector/front-end/ResourcesPanel.js
index 60c1895..4e71328 100644
--- a/WebCore/inspector/front-end/ResourcesPanel.js
+++ b/WebCore/inspector/front-end/ResourcesPanel.js
@@ -456,6 +456,16 @@ WebInspector.ResourcesPanel.prototype = {
             newView.show(oldView.element.parentNode);
     },
 
+    canShowSourceLineForURL: function(url)
+    {
+        return !!WebInspector.resourceForURL(url);
+    },
+
+    showSourceLineForURL: function(url, line)
+    {
+        this.showResource(WebInspector.resourceForURL(url), line);
+    },
+
     showResource: function(resource, line)
     {
         if (!resource)
diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js
index 7f9b7ea..b36536b 100644
--- a/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/WebCore/inspector/front-end/ScriptsPanel.js
@@ -310,6 +310,11 @@ WebInspector.ScriptsPanel.prototype = {
         return this._sourceIDMap[id];
     },
 
+    scriptForURL: function(url)
+    {
+        return this._scriptsForURLsInFilesSelect[url];
+    },
+
     addBreakpoint: function(breakpoint)
     {
         this.sidebarPanes.breakpoints.addBreakpoint(breakpoint);
@@ -497,9 +502,19 @@ WebInspector.ScriptsPanel.prototype = {
             x.show(this.viewsContainerElement);
     },
 
-    canShowResource: function(resource)
+    canShowSourceLineForURL: function(url)
     {
-        return resource && resource.scripts.length && InspectorBackend.debuggerEnabled();
+        return InspectorBackend.debuggerEnabled() &&
+            !!(WebInspector.resourceForURL(url) || this.scriptForURL(url));
+    },
+
+    showSourceLineForURL: function(url, line)
+    {
+        var resource = WebInspector.resourceForURL(url);
+        if (resource)
+            this.showResource(resource, line);
+        else
+            this.showScript(this.scriptForURL(url), line);
     },
 
     showScript: function(script, line)
@@ -651,7 +666,7 @@ WebInspector.ScriptsPanel.prototype = {
 
             console.assert(option);
         } else {
-            var script = this._scriptsForURLsInFilesSelect[url];
+            var script = this.scriptForURL(url);
             if (script)
                option = script.filesSelectOption;
         }
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 2ed1e77..2c04ed6 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -600,13 +600,13 @@ WebInspector.documentClick = function(event)
     function followLink()
     {
         // FIXME: support webkit-html-external-link links here.
-        if (anchor.href in WebInspector.resourceURLMap) {
+        if (WebInspector.canShowSourceLineForURL(anchor.href, anchor.preferredPanel)) {
             if (anchor.hasStyleClass("webkit-html-external-link")) {
                 anchor.removeStyleClass("webkit-html-external-link");
                 anchor.addStyleClass("webkit-html-resource-link");
             }
 
-            WebInspector.showResourceForURL(anchor.href, anchor.lineNumber, anchor.preferredPanel);
+            WebInspector.showSourceLineForURL(anchor.href, anchor.lineNumber, anchor.preferredPanel);
         } else {
             var profileString = WebInspector.ProfileType.URLRegExp.exec(anchor.href);
             if (profileString)
@@ -1409,24 +1409,27 @@ WebInspector.resourceForURL = function(url)
     return null;
 }
 
-WebInspector.showResourceForURL = function(url, line, preferredPanel)
+WebInspector._choosePanelToShowSourceLineForURL = function(url, preferredPanel)
 {
-    var resource = this.resourceForURL(url);
-    if (!resource)
-        return false;
+    preferredPanel = preferredPanel || "resources";
+    var panel = this.panels[preferredPanel];
+    if (panel && panel.canShowSourceLineForURL(url))
+        return panel;
+    panel = this.panels.resources;
+    return panel.canShowSourceLineForURL(url) ? panel : null;
+}
 
-    if (preferredPanel && preferredPanel in WebInspector.panels) {
-        var panel = this.panels[preferredPanel];
-        if (!("showResource" in panel))
-            panel = null;
-        else if ("canShowResource" in panel && !panel.canShowResource(resource))
-            panel = null;
-    }
+WebInspector.canShowSourceLineForURL = function(url, preferredPanel)
+{
+    return !!this._choosePanelToShowSourceLineForURL(url, preferredPanel);
+}
 
-    this.currentPanel = panel || this.panels.resources;
+WebInspector.showSourceLineForURL = function(url, line, preferredPanel)
+{
+    this.currentPanel = this._choosePanelToShowSourceLineForURL(url, preferredPanel);
     if (!this.currentPanel)
         return false;
-    this.currentPanel.showResource(resource, line);
+    this.currentPanel.showSourceLineForURL(url, line);
     return true;
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list