[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

pfeldman at chromium.org pfeldman at chromium.org
Sun Feb 20 23:48:19 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit 66d4804df8632e337dd7c73fc224550884cdf524
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 25 13:32:33 2011 +0000

    2011-01-25  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Yury Semikhatsky.
    
            Web Inspector: bind resources to URLs upon adding them into the tree.
            https://bugs.webkit.org/show_bug.cgi?id=53013
    
            * inspector/debugger-scripts-expected.txt:
            * inspector/debugger-scripts.html:
    2011-01-25  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Yury Semikhatsky.
    
            Web Inspector: bind resources to URLs upon adding them into the tree.
            https://bugs.webkit.org/show_bug.cgi?id=53013
    
            * inspector/front-end/AuditRules.js:
            (WebInspector.AuditRules.UnusedCssRule.prototype.doRun.evalCallback.selectorsCallback):
            * inspector/front-end/CSSStyleModel.js:
            (WebInspector.CSSStyleModel.prototype._styleSheetChanged.callback):
            (WebInspector.CSSStyleModel.prototype._styleSheetChanged):
            * inspector/front-end/DebuggerModel.js:
            (WebInspector.DebuggerModel.prototype._parsedScriptSource):
            * inspector/front-end/NetworkManager.js:
            (WebInspector.NetworkManager.prototype._processCachedResources):
            (WebInspector.NetworkManager.prototype.inflightResourceForURL):
            (WebInspector.NetworkDispatcher):
            (WebInspector.NetworkDispatcher.prototype.willSendRequest):
            (WebInspector.NetworkDispatcher.prototype.markResourceAsCached):
            (WebInspector.NetworkDispatcher.prototype.didReceiveResponse):
            (WebInspector.NetworkDispatcher.prototype.didReceiveContentLength):
            (WebInspector.NetworkDispatcher.prototype.didFinishLoading):
            (WebInspector.NetworkDispatcher.prototype.didFailLoading):
            (WebInspector.NetworkDispatcher.prototype.willSendWebSocketHandshakeRequest):
            (WebInspector.NetworkDispatcher.prototype.didReceiveWebSocketHandshakeResponse):
            (WebInspector.NetworkDispatcher.prototype.didCloseWebSocket):
            (WebInspector.NetworkDispatcher.prototype._appendRedirect):
            (WebInspector.NetworkDispatcher.prototype._startResource):
            (WebInspector.NetworkDispatcher.prototype._finishResource):
            (WebInspector.NetworkDispatcher.prototype._createResource):
            * inspector/front-end/ResourceTreeModel.js:
            (WebInspector.ResourceTreeModel.prototype.addResourceToFrame):
            (WebInspector.ResourceTreeModel.prototype._bindResourceURL):
            (WebInspector.ResourceTreeModel.prototype._clearResources):
            (WebInspector.ResourceTreeModel.prototype._unbindResourceURL):
            * inspector/front-end/ResourcesPanel.js:
            (WebInspector.ResourcesPanel.prototype.canShowSourceLine):
            (WebInspector.ResourcesPanel.prototype.showSourceLine):
            * inspector/front-end/ScriptsPanel.js:
            (WebInspector.ScriptsPanel.prototype._parsedScriptSource):
            (WebInspector.ScriptsPanel.prototype._addScript):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76587 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index c25f62d..f94032b 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2011-01-25  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: bind resources to URLs upon adding them into the tree.
+        https://bugs.webkit.org/show_bug.cgi?id=53013
+
+        * inspector/debugger-scripts-expected.txt:
+        * inspector/debugger-scripts.html:
+
 2011-01-25  Nikolas Zimmermann  <nzimmermann at rim.com>
 
         Reviewed by Dirk Schulze.
diff --git a/LayoutTests/inspector/debugger-scripts-expected.txt b/LayoutTests/inspector/debugger-scripts-expected.txt
index d2e319d..f031b7c 100644
--- a/LayoutTests/inspector/debugger-scripts-expected.txt
+++ b/LayoutTests/inspector/debugger-scripts-expected.txt
@@ -3,7 +3,7 @@ Tests that valid parsed script notifications are received by front-end. Bug 5272
 Debugger was enabled.
 script 1:
     offset: 5:8
-    length: 1096
+    length: 1050
 script 2:
     offset: 38:21
     length: 50
diff --git a/LayoutTests/inspector/debugger-scripts.html b/LayoutTests/inspector/debugger-scripts.html
index b69f2b2..1b8b233 100644
--- a/LayoutTests/inspector/debugger-scripts.html
+++ b/LayoutTests/inspector/debugger-scripts.html
@@ -17,7 +17,7 @@ var test = function()
 
     function step2(event)
     {
-        var script = WebInspector.debuggerModel.scriptForSourceID(event.data);
+        var script = event.data;
         if (script.sourceURL !== WebInspector.mainResource.url)
             return;
         scripts.push(script);
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 0f6900a..188775c 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,46 @@
+2011-01-25  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: bind resources to URLs upon adding them into the tree.
+        https://bugs.webkit.org/show_bug.cgi?id=53013
+
+        * inspector/front-end/AuditRules.js:
+        (WebInspector.AuditRules.UnusedCssRule.prototype.doRun.evalCallback.selectorsCallback):
+        * inspector/front-end/CSSStyleModel.js:
+        (WebInspector.CSSStyleModel.prototype._styleSheetChanged.callback):
+        (WebInspector.CSSStyleModel.prototype._styleSheetChanged):
+        * inspector/front-end/DebuggerModel.js:
+        (WebInspector.DebuggerModel.prototype._parsedScriptSource):
+        * inspector/front-end/NetworkManager.js:
+        (WebInspector.NetworkManager.prototype._processCachedResources):
+        (WebInspector.NetworkManager.prototype.inflightResourceForURL):
+        (WebInspector.NetworkDispatcher):
+        (WebInspector.NetworkDispatcher.prototype.willSendRequest):
+        (WebInspector.NetworkDispatcher.prototype.markResourceAsCached):
+        (WebInspector.NetworkDispatcher.prototype.didReceiveResponse):
+        (WebInspector.NetworkDispatcher.prototype.didReceiveContentLength):
+        (WebInspector.NetworkDispatcher.prototype.didFinishLoading):
+        (WebInspector.NetworkDispatcher.prototype.didFailLoading):
+        (WebInspector.NetworkDispatcher.prototype.willSendWebSocketHandshakeRequest):
+        (WebInspector.NetworkDispatcher.prototype.didReceiveWebSocketHandshakeResponse):
+        (WebInspector.NetworkDispatcher.prototype.didCloseWebSocket):
+        (WebInspector.NetworkDispatcher.prototype._appendRedirect):
+        (WebInspector.NetworkDispatcher.prototype._startResource):
+        (WebInspector.NetworkDispatcher.prototype._finishResource):
+        (WebInspector.NetworkDispatcher.prototype._createResource):
+        * inspector/front-end/ResourceTreeModel.js:
+        (WebInspector.ResourceTreeModel.prototype.addResourceToFrame):
+        (WebInspector.ResourceTreeModel.prototype._bindResourceURL):
+        (WebInspector.ResourceTreeModel.prototype._clearResources):
+        (WebInspector.ResourceTreeModel.prototype._unbindResourceURL):
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.ResourcesPanel.prototype.canShowSourceLine):
+        (WebInspector.ResourcesPanel.prototype.showSourceLine):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype._parsedScriptSource):
+        (WebInspector.ScriptsPanel.prototype._addScript):
+
 2011-01-25  Nikolas Zimmermann  <nzimmermann at rim.com>
 
         Reviewed by Dirk Schulze.
diff --git a/Source/WebCore/inspector/front-end/AuditRules.js b/Source/WebCore/inspector/front-end/AuditRules.js
index c2bbcbb..09a1fd7 100644
--- a/Source/WebCore/inspector/front-end/AuditRules.js
+++ b/Source/WebCore/inspector/front-end/AuditRules.js
@@ -326,7 +326,7 @@ WebInspector.AuditRules.UnusedCssRule.prototype = {
                     if (!unusedRules.length)
                         continue;
 
-                    var resource = WebInspector.resourceTreeModel.resourceForURL(styleSheet.sourceURL);
+                    var resource = WebInspector.resourceForURL(styleSheet.sourceURL);
                     var isInlineBlock = resource && resource.type == WebInspector.Resource.Type.Document;
                     var url = !isInlineBlock ? WebInspector.AuditRuleResult.linkifyDisplayName(styleSheet.sourceURL) : String.sprintf("Inline block #%d", ++inlineBlockOrdinal);
                     var pctUnused = Math.round(100 * unusedStylesheetSize / stylesheetSize);
diff --git a/Source/WebCore/inspector/front-end/CSSStyleModel.js b/Source/WebCore/inspector/front-end/CSSStyleModel.js
index 4f20660..d7b9576 100644
--- a/Source/WebCore/inspector/front-end/CSSStyleModel.js
+++ b/Source/WebCore/inspector/front-end/CSSStyleModel.js
@@ -162,7 +162,7 @@ WebInspector.CSSStyleModel.prototype = {
 
         function callback(href, content)
         {
-            var resource = WebInspector.resourceTreeModel.resourceForURL(href);
+            var resource = WebInspector.resourceForURL(href);
             if (resource && resource.type === WebInspector.Resource.Type.Stylesheet)
                 resource.setContent(content, this._onRevert.bind(this, styleSheetId));
         }
diff --git a/Source/WebCore/inspector/front-end/DebuggerModel.js b/Source/WebCore/inspector/front-end/DebuggerModel.js
index 2112fd1..32d28e7 100644
--- a/Source/WebCore/inspector/front-end/DebuggerModel.js
+++ b/Source/WebCore/inspector/front-end/DebuggerModel.js
@@ -247,7 +247,7 @@ WebInspector.DebuggerModel.prototype = {
     {
         var script = new WebInspector.Script(sourceID, sourceURL, "", lineOffset, columnOffset, length, undefined, undefined, scriptWorldType);
         this._scripts[sourceID] = script;
-        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.ParsedScriptSource, sourceID);
+        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.ParsedScriptSource, script);
     },
 
     _failedToParseScriptSource: function(sourceURL, source, startingLine, errorLine, errorMessage)
diff --git a/Source/WebCore/inspector/front-end/NetworkManager.js b/Source/WebCore/inspector/front-end/NetworkManager.js
index 68f03c8..d2452df 100644
--- a/Source/WebCore/inspector/front-end/NetworkManager.js
+++ b/Source/WebCore/inspector/front-end/NetworkManager.js
@@ -61,6 +61,11 @@ WebInspector.NetworkManager.prototype = {
         var mainResource = this._dispatcher._addFramesRecursively(mainFramePayload);
         WebInspector.mainResource = mainResource;
         mainResource.isMainResource = true;
+    },
+
+    inflightResourceForURL: function(url)
+    {
+        return this._dispatcher._inflightResourcesByURL[url];
     }
 }
 
@@ -69,7 +74,8 @@ WebInspector.NetworkManager.prototype.__proto__ = WebInspector.Object.prototype;
 WebInspector.NetworkDispatcher = function(resourceTreeModel, manager)
 {
     this._manager = manager;
-    this._inflightResources = {};
+    this._inflightResourcesById = {};
+    this._inflightResourcesByURL = {};
     this._resourceTreeModel = resourceTreeModel;
     this._lastIdentifierForCachedResource = 0;
     InspectorBackend.registerDomainDispatcher("Network", this);
@@ -128,7 +134,7 @@ WebInspector.NetworkDispatcher.prototype = {
 
     willSendRequest: function(identifier, time, request, redirectResponse)
     {
-        var resource = this._inflightResources[identifier];
+        var resource = this._inflightResourcesById[identifier];
         if (!resource)
             return;
 
@@ -151,7 +157,7 @@ WebInspector.NetworkDispatcher.prototype = {
 
     markResourceAsCached: function(identifier)
     {
-        var resource = this._inflightResources[identifier];
+        var resource = this._inflightResourcesById[identifier];
         if (!resource)
             return;
 
@@ -161,7 +167,7 @@ WebInspector.NetworkDispatcher.prototype = {
 
     didReceiveResponse: function(identifier, time, resourceType, response)
     {
-        var resource = this._inflightResources[identifier];
+        var resource = this._inflightResourcesById[identifier];
         if (!resource)
             return;
 
@@ -176,7 +182,7 @@ WebInspector.NetworkDispatcher.prototype = {
 
     didReceiveContentLength: function(identifier, time, lengthReceived)
     {
-        var resource = this._inflightResources[identifier];
+        var resource = this._inflightResourcesById[identifier];
         if (!resource)
             return;
 
@@ -188,7 +194,7 @@ WebInspector.NetworkDispatcher.prototype = {
 
     didFinishLoading: function(identifier, finishTime)
     {
-        var resource = this._inflightResources[identifier];
+        var resource = this._inflightResourcesById[identifier];
         if (!resource)
             return;
 
@@ -197,7 +203,7 @@ WebInspector.NetworkDispatcher.prototype = {
 
     didFailLoading: function(identifier, time, localizedDescription)
     {
-        var resource = this._inflightResources[identifier];
+        var resource = this._inflightResourcesById[identifier];
         if (!resource)
             return;
 
@@ -256,7 +262,7 @@ WebInspector.NetworkDispatcher.prototype = {
 
     willSendWebSocketHandshakeRequest: function(identifier, time, request)
     {
-        var resource = this._inflightResources[identifier];
+        var resource = this._inflightResourcesById[identifier];
         if (!resource)
             return;
 
@@ -270,7 +276,7 @@ WebInspector.NetworkDispatcher.prototype = {
 
     didReceiveWebSocketHandshakeResponse: function(identifier, time, response)
     {
-        var resource = this._inflightResources[identifier];
+        var resource = this._inflightResourcesById[identifier];
         if (!resource)
             return;
 
@@ -285,7 +291,7 @@ WebInspector.NetworkDispatcher.prototype = {
 
     didCloseWebSocket: function(identifier, time)
     {
-        var resource = this._inflightResources[identifier];
+        var resource = this._inflightResourcesById[identifier];
         if (!resource)
             return;
         this._finishResource(resource, time);
@@ -293,17 +299,11 @@ WebInspector.NetworkDispatcher.prototype = {
 
     _appendRedirect: function(identifier, time, redirectURL)
     {
-        var originalResource = this._inflightResources[identifier];
+        var originalResource = this._inflightResourcesById[identifier];
         var previousRedirects = originalResource.redirects || [];
         originalResource.identifier = "redirected:" + identifier + "." + previousRedirects.length;
         delete originalResource.redirects;
         this._finishResource(originalResource, time);
-        // We bound resource early, but it happened to be a redirect and won't make it through to
-        // the resource tree -- so unbind it.
-        // FIXME: we should bind upon adding to the tree only (encapsulated into ResourceTreeModel),
-        // Script debugger should do explicit late binding on its own.
-        this._resourceTreeModel.unbindResourceURL(originalResource);
-        
         var newResource = this._createResource(identifier, redirectURL, originalResource.loader, originalResource.stackTrace);
         newResource.redirects = previousRedirects.concat(originalResource);
         return newResource;
@@ -311,7 +311,8 @@ WebInspector.NetworkDispatcher.prototype = {
 
     _startResource: function(resource)
     {
-        this._inflightResources[resource.identifier] = resource;
+        this._inflightResourcesById[resource.identifier] = resource;
+        this._inflightResourcesByURL[resource.url] = resource;
         this._dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.ResourceStarted, resource);
     },
 
@@ -325,7 +326,8 @@ WebInspector.NetworkDispatcher.prototype = {
         resource.endTime = finishTime;
         resource.finished = true;
         this._dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.ResourceFinished, resource);
-        delete this._inflightResources[resource.identifier];
+        delete this._inflightResourcesById[resource.identifier];
+        delete this._inflightResourcesByURL[resource.url];
     },
 
     _addFramesRecursively: function(framePayload)
@@ -364,10 +366,8 @@ WebInspector.NetworkDispatcher.prototype = {
     {
         var resource = new WebInspector.Resource(identifier, url);
         resource.loader = loader;
-        if (loader) {
+        if (loader)
             resource.documentURL = loader.url;
-            this._resourceTreeModel.bindResourceURL(resource);
-        }
         resource.stackTrace = stackTrace;
         return resource;
     }
diff --git a/Source/WebCore/inspector/front-end/ResourceTreeModel.js b/Source/WebCore/inspector/front-end/ResourceTreeModel.js
index 0ac63f2..da2d47a 100644
--- a/Source/WebCore/inspector/front-end/ResourceTreeModel.js
+++ b/Source/WebCore/inspector/front-end/ResourceTreeModel.js
@@ -82,6 +82,7 @@ WebInspector.ResourceTreeModel.prototype = {
             this._resourcesByFrameId[frameId] = resourcesForFrame;
         }
         resourcesForFrame.push(resource);
+        this._bindResourceURL(resource);
 
         WebInspector.panels.resources.addResourceToFrame(frameId, resource);
     },
@@ -129,7 +130,7 @@ WebInspector.ResourceTreeModel.prototype = {
         return entry;
     },
 
-    bindResourceURL: function(resource)
+    _bindResourceURL: function(resource)
     {
         var resourceForURL = this._resourcesByURL[resource.url];
         if (!resourceForURL)
@@ -169,7 +170,7 @@ WebInspector.ResourceTreeModel.prototype = {
                 preservedResourcesForFrame.push(resource);
                 continue;
             }
-            this.unbindResourceURL(resource);
+            this._unbindResourceURL(resource);
         }
 
         delete this._resourcesByFrameId[frameId];
@@ -195,7 +196,7 @@ WebInspector.ResourceTreeModel.prototype = {
         return false;
     },
 
-    unbindResourceURL: function(resource)
+    _unbindResourceURL: function(resource)
     {
         var resourceForURL = this._resourcesByURL[resource.url];
         if (!resourceForURL)
diff --git a/Source/WebCore/inspector/front-end/ResourcesPanel.js b/Source/WebCore/inspector/front-end/ResourcesPanel.js
index 68f65c3..1743ece 100644
--- a/Source/WebCore/inspector/front-end/ResourcesPanel.js
+++ b/Source/WebCore/inspector/front-end/ResourcesPanel.js
@@ -338,12 +338,12 @@ WebInspector.ResourcesPanel.prototype = {
 
     canShowSourceLine: function(url, line)
     {
-        return !!WebInspector.resourceTreeModel.resourceForURL(url);
+        return !!WebInspector.resourceForURL(url);
     },
 
     showSourceLine: function(url, line)
     {
-        var resource = WebInspector.resourceTreeModel.resourceForURL(url);
+        var resource = WebInspector.resourceForURL(url);
         if (resource.type === WebInspector.Resource.Type.XHR) {
             // Show XHRs in the network panel only.
             if (WebInspector.panels.network && WebInspector.panels.network.canShowSourceLine(url, line)) {
@@ -352,7 +352,7 @@ WebInspector.ResourcesPanel.prototype = {
             }
             return;
         }
-        this.showResource(WebInspector.resourceTreeModel.resourceForURL(url), line);
+        this.showResource(WebInspector.resourceForURL(url), line);
     },
 
     showResource: function(resource, line)
diff --git a/Source/WebCore/inspector/front-end/ScriptsPanel.js b/Source/WebCore/inspector/front-end/ScriptsPanel.js
index 63a4085..fdcce37 100644
--- a/Source/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/Source/WebCore/inspector/front-end/ScriptsPanel.js
@@ -242,9 +242,7 @@ WebInspector.ScriptsPanel.prototype = {
 
     _parsedScriptSource: function(event)
     {
-        var sourceID = event.data;
-        var script = WebInspector.debuggerModel.scriptForSourceID(sourceID);
-        this._addScript(script);
+        this._addScript(event.data);
     },
 
     _failedToParseScriptSource: function(event)
@@ -275,7 +273,7 @@ WebInspector.ScriptsPanel.prototype = {
 
     _addScript: function(script)
     {
-        var resource = WebInspector.resourceForURL(script.sourceURL);
+        var resource = WebInspector.networkManager.inflightResourceForURL(script.sourceURL) || WebInspector.resourceForURL(script.sourceURL);
         if (resource) {
             if (resource.finished) {
                 // Resource is finished, bind the script right away.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list