[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

pfeldman at chromium.org pfeldman at chromium.org
Wed Dec 22 14:45:12 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 7424be14664860b842fb629b357b73139c24af7c
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 19 10:35:21 2010 +0000

    2010-10-19  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Yury Semikhatsky.
    
            Web Inspector: do not access ResourcePanel from resources directly.
            https://bugs.webkit.org/show_bug.cgi?id=47892
    
            * inspector/front-end/Resource.js:
            (WebInspector.Resource.prototype.set documentURL):
            (WebInspector.Resource.prototype.set startTime):
            (WebInspector.Resource.prototype.set responseReceivedTime):
            (WebInspector.Resource.prototype.set endTime):
            (WebInspector.Resource.prototype.set resourceSize):
            (WebInspector.Resource.prototype.set expectedContentLength):
            (WebInspector.Resource.prototype.set category):
            (WebInspector.Resource.prototype.set cached):
            (WebInspector.Resource.prototype.set mimeType):
            (WebInspector.Resource.prototype.get requestHeaders):
            (WebInspector.Resource.prototype.set requestHeaders):
            (WebInspector.Resource.prototype.get responseHeaders):
            (WebInspector.Resource.prototype.set responseHeaders):
            * inspector/front-end/ResourcesPanel.js:
            (WebInspector.ResourcesPanel.prototype.addResource):
            (WebInspector.ResourcesPanel.prototype.refreshResource):
            (WebInspector.ResourcesPanel.prototype._recreateViewForResourceIfNeeded):
            (WebInspector.ResourcesPanel.prototype._resourceViewIsConsistentWithCategory):
            (WebInspector.ResourceGraph):
            (WebInspector.ResourceGraph.prototype.refresh):
            * inspector/front-end/inspector.js:
            (WebInspector.updateResource):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70045 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7706698..be5fe55 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,34 @@
+2010-10-19  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: do not access ResourcePanel from resources directly.
+        https://bugs.webkit.org/show_bug.cgi?id=47892
+
+        * inspector/front-end/Resource.js:
+        (WebInspector.Resource.prototype.set documentURL):
+        (WebInspector.Resource.prototype.set startTime):
+        (WebInspector.Resource.prototype.set responseReceivedTime):
+        (WebInspector.Resource.prototype.set endTime):
+        (WebInspector.Resource.prototype.set resourceSize):
+        (WebInspector.Resource.prototype.set expectedContentLength):
+        (WebInspector.Resource.prototype.set category):
+        (WebInspector.Resource.prototype.set cached):
+        (WebInspector.Resource.prototype.set mimeType):
+        (WebInspector.Resource.prototype.get requestHeaders):
+        (WebInspector.Resource.prototype.set requestHeaders):
+        (WebInspector.Resource.prototype.get responseHeaders):
+        (WebInspector.Resource.prototype.set responseHeaders):
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.ResourcesPanel.prototype.addResource):
+        (WebInspector.ResourcesPanel.prototype.refreshResource):
+        (WebInspector.ResourcesPanel.prototype._recreateViewForResourceIfNeeded):
+        (WebInspector.ResourcesPanel.prototype._resourceViewIsConsistentWithCategory):
+        (WebInspector.ResourceGraph):
+        (WebInspector.ResourceGraph.prototype.refresh):
+        * inspector/front-end/inspector.js:
+        (WebInspector.updateResource):
+
 2010-10-19  Yuta Kitamura  <yutak at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/inspector/front-end/Resource.js b/WebCore/inspector/front-end/Resource.js
index b4338ab..1848a3a 100644
--- a/WebCore/inspector/front-end/Resource.js
+++ b/WebCore/inspector/front-end/Resource.js
@@ -119,8 +119,6 @@ WebInspector.Resource.prototype = {
 
     set documentURL(x)
     {
-        if (this._documentURL === x)
-            return;
         this._documentURL = x;
     },
 
@@ -153,13 +151,7 @@ WebInspector.Resource.prototype = {
 
     set startTime(x)
     {
-        if (this._startTime === x)
-            return;
-
         this._startTime = x;
-
-        if (WebInspector.panels.resources)
-            WebInspector.panels.resources.refreshResource(this);
     },
 
     get responseReceivedTime()
@@ -174,13 +166,7 @@ WebInspector.Resource.prototype = {
 
     set responseReceivedTime(x)
     {
-        if (this._responseReceivedTime === x)
-            return;
-
         this._responseReceivedTime = x;
-
-        if (WebInspector.panels.resources)
-            WebInspector.panels.resources.refreshResource(this);
     },
 
     get endTime()
@@ -196,13 +182,7 @@ WebInspector.Resource.prototype = {
         if (x < this.responseReceivedTime)
             this.responseReceivedTime = x;
 
-        if (this._endTime === x)
-            return;
-
         this._endTime = x;
-
-        if (WebInspector.panels.resources)
-            WebInspector.panels.resources.refreshResource(this);
     },
 
     get duration()
@@ -233,13 +213,7 @@ WebInspector.Resource.prototype = {
 
     set resourceSize(x)
     {
-        if (this._resourceSize === x)
-            return;
-
         this._resourceSize = x;
-
-        if (WebInspector.panels.resources)
-            WebInspector.panels.resources.refreshResource(this);
     },
 
     get transferSize()
@@ -255,8 +229,6 @@ WebInspector.Resource.prototype = {
 
     set expectedContentLength(x)
     {
-        if (this._expectedContentLength === x)
-            return;
         this._expectedContentLength = x;
     },
 
@@ -306,11 +278,6 @@ WebInspector.Resource.prototype = {
 
         if (this._category)
             this._category.addResource(this);
-
-        if (WebInspector.panels.resources) {
-            WebInspector.panels.resources.refreshResource(this);
-            WebInspector.panels.resources.recreateViewForResourceIfNeeded(this);
-        }
     },
 
     get cached()
@@ -321,7 +288,6 @@ WebInspector.Resource.prototype = {
     set cached(x)
     {
         this._cached = x;
-        this.dispatchEventToListeners("cached changed");
     },
 
     get mimeType()
@@ -331,9 +297,6 @@ WebInspector.Resource.prototype = {
 
     set mimeType(x)
     {
-        if (this._mimeType === x)
-            return;
-
         this._mimeType = x;
     },
 
@@ -380,16 +343,11 @@ WebInspector.Resource.prototype = {
 
     get requestHeaders()
     {
-        if (this._requestHeaders === undefined)
-            this._requestHeaders = {};
-        return this._requestHeaders;
+        return this._requestHeaders || {};
     },
 
     set requestHeaders(x)
     {
-        if (this._requestHeaders === x)
-            return;
-
         this._requestHeaders = x;
         delete this._sortedRequestHeaders;
 
@@ -427,16 +385,11 @@ WebInspector.Resource.prototype = {
 
     get responseHeaders()
     {
-        if (this._responseHeaders === undefined)
-            this._responseHeaders = {};
-        return this._responseHeaders;
+        return this._responseHeaders || {};
     },
 
     set responseHeaders(x)
     {
-        if (this._responseHeaders === x)
-            return;
-
         this._responseHeaders = x;
         delete this._sortedResponseHeaders;
 
diff --git a/WebCore/inspector/front-end/ResourcesPanel.js b/WebCore/inspector/front-end/ResourcesPanel.js
index fd16847..4cebf06 100644
--- a/WebCore/inspector/front-end/ResourcesPanel.js
+++ b/WebCore/inspector/front-end/ResourcesPanel.js
@@ -757,7 +757,6 @@ WebInspector.ResourcesPanel.prototype = {
     addResource: function(resource)
     {
         this._resources.push(resource);
-        this.refreshResource(resource);
     },
 
     removeResource: function(resource)
@@ -815,18 +814,19 @@ WebInspector.ResourcesPanel.prototype = {
 
     refreshResource: function(resource)
     {
+        this._recreateViewForResourceIfNeeded(resource);
         this.refreshItem(resource);
     },
 
-    recreateViewForResourceIfNeeded: function(resource)
+    _recreateViewForResourceIfNeeded: function(resource)
     {
         if (!resource || !resource._resourcesView)
             return;
 
-        var newView = this._createResourceView(resource);
-        if (newView.__proto__ === resource._resourcesView.__proto__)
+        if (this._resourceViewIsConsistentWithCategory(resource, resource._resourcesView))
             return;
 
+        var newView = this._createResourceView(resource);
         if (!this.currentQuery && resource._itemsTreeElement)
             resource._itemsTreeElement.updateErrorsAndWarnings();
 
@@ -1068,6 +1068,23 @@ WebInspector.ResourcesPanel.prototype = {
         this.calculator = this.summaryBar.calculator = selectedOption.calculator;
     },
 
+    _resourceViewIsConsistentWithCategory: function(resource, resourceView)
+    {
+        switch (resource.category) {
+            case WebInspector.resourceCategories.documents:
+            case WebInspector.resourceCategories.stylesheets:
+            case WebInspector.resourceCategories.scripts:
+            case WebInspector.resourceCategories.xhr:
+                return resourceView.__proto__ === WebInspector.SourceView.prototype;
+            case WebInspector.resourceCategories.images:
+                return resourceView.__proto__ === WebInspector.ImageView.prototype;
+            case WebInspector.resourceCategories.fonts:
+                return resourceView.__proto__ === WebInspector.FontView.prototype;
+            default:
+                return resourceView.__proto__ === WebInspector.ResourceView.prototype;
+        }
+    },
+
     _createResourceView: function(resource)
     {
         switch (resource.category) {
@@ -1819,7 +1836,8 @@ WebInspector.ResourceGraph = function(resource)
     this._graphElement.className = "resources-graph-side";
     this._graphElement.addEventListener("mouseover", this.refreshLabelPositions.bind(this), false);
 
-    this._cachedChanged();
+    if (this.resource.cached)
+        this._graphElement.addStyleClass("resource-cached");
 
     this._barAreaElement = document.createElement("div");
     this._barAreaElement.className = "resources-graph-bar-area hidden";
@@ -1843,8 +1861,6 @@ WebInspector.ResourceGraph = function(resource)
     this._barAreaElement.appendChild(this._labelRightElement);
 
     this._graphElement.addStyleClass("resources-category-" + resource.category.name);
-
-    resource.addEventListener("cached changed", this._cachedChanged, this);
 }
 
 WebInspector.ResourceGraph.prototype = {
@@ -1968,11 +1984,8 @@ WebInspector.ResourceGraph.prototype = {
         this._labelLeftElement.title = tooltip;
         this._labelRightElement.title = tooltip;
         this._barRightElement.title = tooltip;
-    },
 
-    _cachedChanged: function()
-    {
-        if (this.resource.cached)
+        if (this.resource.cached && !this._graphElement.hasStyleClass("resource-cached"))
             this._graphElement.addStyleClass("resource-cached");
     }
 }
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 6629e6c..9bd88d6 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -1281,6 +1281,7 @@ WebInspector.updateResource = function(payload)
         if (payload.endTime)
             resource.endTime = payload.endTime;
     }
+    this.panels.resources.refreshResource(resource);
 }
 
 WebInspector.domContentEventFired = function(time)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list