Title: [96949] trunk/Source/WebCore
Revision
96949
Author
pfeld...@chromium.org
Date
2011-10-07 09:44:42 -0700 (Fri, 07 Oct 2011)

Log Message

Web Inspector: add Audits panel to the compilation.
https://bugs.webkit.org/show_bug.cgi?id=69633

Reviewed by Yury Semikhatsky.

* inspector/compile-front-end.sh:
* inspector/front-end/AuditCategories.js:
* inspector/front-end/AuditLauncherView.js:
* inspector/front-end/AuditResultView.js:
* inspector/front-end/AuditRules.js:
(WebInspector.AuditRules.CombineExternalResourcesRule.prototype.doRun):
(WebInspector.AuditRules.MinimizeDnsLookupsRule.prototype.doRun):
(WebInspector.AuditRules.CacheControlRule.prototype.handleNonCacheableResources):
* inspector/front-end/AuditsPanel.js:
(WebInspector.AuditsPanel):
* inspector/front-end/NetworkLog.js:
* inspector/front-end/treeoutline.js:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (96948 => 96949)


--- trunk/Source/WebCore/ChangeLog	2011-10-07 16:43:14 UTC (rev 96948)
+++ trunk/Source/WebCore/ChangeLog	2011-10-07 16:44:42 UTC (rev 96949)
@@ -1,3 +1,23 @@
+2011-10-07  Pavel Feldman  <pfeld...@google.com>
+
+        Web Inspector: add Audits panel to the compilation.
+        https://bugs.webkit.org/show_bug.cgi?id=69633
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/compile-front-end.sh:
+        * inspector/front-end/AuditCategories.js:
+        * inspector/front-end/AuditLauncherView.js:
+        * inspector/front-end/AuditResultView.js:
+        * inspector/front-end/AuditRules.js:
+        (WebInspector.AuditRules.CombineExternalResourcesRule.prototype.doRun):
+        (WebInspector.AuditRules.MinimizeDnsLookupsRule.prototype.doRun):
+        (WebInspector.AuditRules.CacheControlRule.prototype.handleNonCacheableResources):
+        * inspector/front-end/AuditsPanel.js:
+        (WebInspector.AuditsPanel):
+        * inspector/front-end/NetworkLog.js:
+        * inspector/front-end/treeoutline.js:
+
 2011-10-07  Andreas Kling  <kl...@webkit.org>
 
         Functions that return "const Color" should simply return "Color".

Modified: trunk/Source/WebCore/inspector/compile-front-end.sh (96948 => 96949)


--- trunk/Source/WebCore/inspector/compile-front-end.sh	2011-10-07 16:43:14 UTC (rev 96948)
+++ trunk/Source/WebCore/inspector/compile-front-end.sh	2011-10-07 16:44:42 UTC (rev 96949)
@@ -163,7 +163,14 @@
         --js Source/WebCore/inspector/front-end/ConsolePanel.js \
     --module jsmodule_timeline:2:jsmodule_components \
         --js Source/WebCore/inspector/front-end/TimelineOverviewPane.js \
-        --js Source/WebCore/inspector/front-end/TimelinePanel.js
+        --js Source/WebCore/inspector/front-end/TimelinePanel.js \
+    --module jsmodule_audits:6:jsmodule_components \
+        --js Source/WebCore/inspector/front-end/AuditCategories.js \
+        --js Source/WebCore/inspector/front-end/AuditFormatters.js \
+        --js Source/WebCore/inspector/front-end/AuditLauncherView.js \
+        --js Source/WebCore/inspector/front-end/AuditResultView.js \
+        --js Source/WebCore/inspector/front-end/AuditRules.js \
+        --js Source/WebCore/inspector/front-end/AuditsPanel.js
     
 
 # To be compiled...
@@ -181,14 +188,6 @@
 # ProfileView
 # TopDownProfileDataGridTree
 #
-# [Audits]
-# AuditCategories
-# AuditFormatters
-# AuditLauncherView
-# AuditResultView
-# AuditRules
-# AuditsPanel
-#
 # [Extensions]
 # ExtensionAPI
 # ExtensionAuditCategory

Modified: trunk/Source/WebCore/inspector/front-end/AuditCategories.js (96948 => 96949)


--- trunk/Source/WebCore/inspector/front-end/AuditCategories.js	2011-10-07 16:43:14 UTC (rev 96948)
+++ trunk/Source/WebCore/inspector/front-end/AuditCategories.js	2011-10-07 16:44:42 UTC (rev 96949)
@@ -28,6 +28,10 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/**
+ * @constructor
+ * @extends {WebInspector.AuditCategory}
+ */
 WebInspector.AuditCategories.PagePerformance = function() {
     WebInspector.AuditCategory.call(this, WebInspector.AuditCategories.PagePerformance.AuditCategoryName);
 }
@@ -45,6 +49,10 @@
 
 WebInspector.AuditCategories.PagePerformance.prototype.__proto__ = WebInspector.AuditCategory.prototype;
 
+/**
+ * @constructor
+ * @extends {WebInspector.AuditCategory}
+ */
 WebInspector.AuditCategories.NetworkUtilization = function() {
     WebInspector.AuditCategory.call(this, WebInspector.AuditCategories.NetworkUtilization.AuditCategoryName);
 }

Modified: trunk/Source/WebCore/inspector/front-end/AuditLauncherView.js (96948 => 96949)


--- trunk/Source/WebCore/inspector/front-end/AuditLauncherView.js	2011-10-07 16:43:14 UTC (rev 96948)
+++ trunk/Source/WebCore/inspector/front-end/AuditLauncherView.js	2011-10-07 16:44:42 UTC (rev 96949)
@@ -28,6 +28,10 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/**
+ * @constructor
+ * @extends {WebInspector.View}
+ */
 WebInspector.AuditLauncherView = function(runnerCallback)
 {
     WebInspector.View.call(this);

Modified: trunk/Source/WebCore/inspector/front-end/AuditResultView.js (96948 => 96949)


--- trunk/Source/WebCore/inspector/front-end/AuditResultView.js	2011-10-07 16:43:14 UTC (rev 96948)
+++ trunk/Source/WebCore/inspector/front-end/AuditResultView.js	2011-10-07 16:44:42 UTC (rev 96949)
@@ -28,6 +28,10 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/**
+ * @constructor
+ * @extends {WebInspector.View}
+ */
 WebInspector.AuditResultView = function(categoryResults)
 {
     WebInspector.View.call(this);
@@ -43,7 +47,10 @@
 
 WebInspector.AuditResultView.prototype.__proto__ = WebInspector.View.prototype;
 
-
+/**
+ * @constructor
+ * @extends {WebInspector.SidebarPane}
+ */
 WebInspector.AuditCategoryResultPane = function(categoryResult)
 {
     WebInspector.SidebarPane.call(this, categoryResult.title);

Modified: trunk/Source/WebCore/inspector/front-end/AuditRules.js (96948 => 96949)


--- trunk/Source/WebCore/inspector/front-end/AuditRules.js	2011-10-07 16:43:14 UTC (rev 96948)
+++ trunk/Source/WebCore/inspector/front-end/AuditRules.js	2011-10-07 16:44:42 UTC (rev 96949)
@@ -63,6 +63,10 @@
     return domainToResourcesMap;
 }
 
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRule}
+ */
 WebInspector.AuditRules.GzipRule = function()
 {
     WebInspector.AuditRule.call(this, "network-gzip", "Enable gzip compression");
@@ -115,7 +119,10 @@
 
 WebInspector.AuditRules.GzipRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
 
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRule}
+ */
 WebInspector.AuditRules.CombineExternalResourcesRule = function(id, name, type, resourceTypeName, allowedPerDomain)
 {
     WebInspector.AuditRule.call(this, id, name);
@@ -127,7 +134,7 @@
 WebInspector.AuditRules.CombineExternalResourcesRule.prototype = {
     doRun: function(resources, result, callback)
     {
-        var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(resources, [this._type]);
+        var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(resources, [this._type], false);
         var penalizedResourceCount = 0;
         // TODO: refactor according to the chosen i18n approach
         var summary = result.addChild("", true);
@@ -150,21 +157,30 @@
 
 WebInspector.AuditRules.CombineExternalResourcesRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
 
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRules.CombineExternalResourcesRule}
+ */
 WebInspector.AuditRules.CombineJsResourcesRule = function(allowedPerDomain) {
     WebInspector.AuditRules.CombineExternalResourcesRule.call(this, "page-externaljs", "Combine external _javascript_", WebInspector.Resource.Type.Script, "_javascript_", allowedPerDomain);
 }
 
 WebInspector.AuditRules.CombineJsResourcesRule.prototype.__proto__ = WebInspector.AuditRules.CombineExternalResourcesRule.prototype;
 
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRules.CombineExternalResourcesRule}
+ */
 WebInspector.AuditRules.CombineCssResourcesRule = function(allowedPerDomain) {
     WebInspector.AuditRules.CombineExternalResourcesRule.call(this, "page-externalcss", "Combine external CSS", WebInspector.Resource.Type.Stylesheet, "CSS", allowedPerDomain);
 }
 
 WebInspector.AuditRules.CombineCssResourcesRule.prototype.__proto__ = WebInspector.AuditRules.CombineExternalResourcesRule.prototype;
 
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRule}
+ */
 WebInspector.AuditRules.MinimizeDnsLookupsRule = function(hostCountThreshold) {
     WebInspector.AuditRule.call(this, "network-minimizelookups", "Minimize DNS lookups");
     this._hostCountThreshold = hostCountThreshold;
@@ -174,7 +190,7 @@
     doRun: function(resources, result, callback)
     {
         var summary = result.addChild("");
-        var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(resources, undefined);
+        var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(resources, undefined, false);
         for (var domain in domainToResourcesMap) {
             if (domainToResourcesMap[domain].length > 1)
                 continue;
@@ -183,7 +199,7 @@
                 continue;
             if (!parsedURL.host.search(WebInspector.AuditRules.IPAddressRegexp))
                 continue; // an IP address
-            summary.addSnippet(match[2]);
+            summary.addSnippet(domain);
             result.violationCount++;
         }
         if (!summary.children || summary.children.length <= this._hostCountThreshold)
@@ -196,7 +212,10 @@
 
 WebInspector.AuditRules.MinimizeDnsLookupsRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
 
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRule}
+ */
 WebInspector.AuditRules.ParallelizeDownloadRule = function(optimalHostnameCount, minRequestThreshold, minBalanceThreshold)
 {
     WebInspector.AuditRule.call(this, "network-parallelizehosts", "Parallelize downloads across hostnames");
@@ -205,7 +224,6 @@
     this._minBalanceThreshold = minBalanceThreshold;
 }
 
-
 WebInspector.AuditRules.ParallelizeDownloadRule.prototype = {
     doRun: function(resources, result, callback)
     {
@@ -264,9 +282,12 @@
 
 WebInspector.AuditRules.ParallelizeDownloadRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
 
-
-// The reported CSS rule size is incorrect (parsed != original in WebKit),
-// so use percentages instead, which gives a better approximation.
+/**
+ * The reported CSS rule size is incorrect (parsed != original in WebKit),
+ * so use percentages instead, which gives a better approximation.
+ * @constructor
+ * @extends {WebInspector.AuditRule}
+ */
 WebInspector.AuditRules.UnusedCssRule = function()
 {
     WebInspector.AuditRule.call(this, "page-unusedcss", "Remove unused CSS rules");
@@ -392,7 +413,10 @@
 
 WebInspector.AuditRules.UnusedCssRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
 
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRule}
+ */
 WebInspector.AuditRules.CacheControlRule = function(id, name)
 {
     WebInspector.AuditRule.call(this, id, name);
@@ -412,7 +436,7 @@
         callback(result);
     },
 
-    handleNonCacheableResources: function()
+    handleNonCacheableResources: function(resources, result)
     {
     },
 
@@ -530,7 +554,10 @@
 
 WebInspector.AuditRules.CacheControlRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
 
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRules.CacheControlRule}
+ */
 WebInspector.AuditRules.BrowserCacheControlRule = function()
 {
     WebInspector.AuditRules.CacheControlRule.call(this, "http-browsercache", "Leverage browser caching");
@@ -596,7 +623,10 @@
 
 WebInspector.AuditRules.BrowserCacheControlRule.prototype.__proto__ = WebInspector.AuditRules.CacheControlRule.prototype;
 
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRules.CacheControlRule}
+ */
 WebInspector.AuditRules.ProxyCacheControlRule = function() {
     WebInspector.AuditRules.CacheControlRule.call(this, "http-proxycache", "Leverage proxy caching");
 }
@@ -633,7 +663,10 @@
 
 WebInspector.AuditRules.ProxyCacheControlRule.prototype.__proto__ = WebInspector.AuditRules.CacheControlRule.prototype;
 
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRule}
+ */
 WebInspector.AuditRules.ImageDimensionsRule = function()
 {
     WebInspector.AuditRule.call(this, "page-imagedims", "Specify image dimensions");
@@ -726,7 +759,10 @@
 
 WebInspector.AuditRules.ImageDimensionsRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
 
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRule}
+ */
 WebInspector.AuditRules.CssInHeadRule = function()
 {
     WebInspector.AuditRule.call(this, "page-cssinhead", "Put CSS in the document head");
@@ -795,7 +831,10 @@
 
 WebInspector.AuditRules.CssInHeadRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
 
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRule}
+ */
 WebInspector.AuditRules.StylesScriptsOrderRule = function()
 {
     WebInspector.AuditRule.call(this, "page-stylescriptorder", "Optimize the order of styles and scripts");
@@ -862,7 +901,10 @@
 
 WebInspector.AuditRules.StylesScriptsOrderRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
 
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRule}
+ */
 WebInspector.AuditRules.CookieRuleBase = function(id, name)
 {
     WebInspector.AuditRule.call(this, id, name);
@@ -902,7 +944,10 @@
 
 WebInspector.AuditRules.CookieRuleBase.prototype.__proto__ = WebInspector.AuditRule.prototype;
 
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRules.CookieRuleBase}
+ */
 WebInspector.AuditRules.CookieSizeRule = function(avgBytesThreshold)
 {
     WebInspector.AuditRules.CookieRuleBase.call(this, "http-cookiesize", "Minimize cookie size");
@@ -1008,7 +1053,10 @@
 
 WebInspector.AuditRules.CookieSizeRule.prototype.__proto__ = WebInspector.AuditRules.CookieRuleBase.prototype;
 
-
+/**
+ * @constructor
+ * @extends {WebInspector.AuditRules.CookieRuleBase}
+ */
 WebInspector.AuditRules.StaticCookielessRule = function(minResources)
 {
     WebInspector.AuditRules.CookieRuleBase.call(this, "http-staticcookieless", "Serve static content from a cookieless domain");

Modified: trunk/Source/WebCore/inspector/front-end/AuditsPanel.js (96948 => 96949)


--- trunk/Source/WebCore/inspector/front-end/AuditsPanel.js	2011-10-07 16:43:14 UTC (rev 96948)
+++ trunk/Source/WebCore/inspector/front-end/AuditsPanel.js	2011-10-07 16:44:42 UTC (rev 96949)
@@ -28,6 +28,10 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/**
+ * @constructor
+ * @extends {WebInspector.Panel}
+ */
 WebInspector.AuditsPanel = function()
 {
     WebInspector.Panel.call(this, "audits");
@@ -55,7 +59,7 @@
     this._constructCategories();
 
     this._launcherView = new WebInspector.AuditLauncherView(this.initiateAudit.bind(this));
-    for (id in this.categoriesById)
+    for (var id in this.categoriesById)
         this._launcherView.addCategory(this.categoriesById[id]);
 
     WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.OnLoad, this._onLoadEventFired, this);
@@ -261,8 +265,9 @@
 
 WebInspector.AuditsPanel.prototype.__proto__ = WebInspector.Panel.prototype;
 
-
-
+/**
+ * @constructor
+ */
 WebInspector.AuditCategory = function(displayName)
 {
     this._displayName = displayName;
@@ -310,7 +315,9 @@
     }
 }
 
-
+/**
+ * @constructor
+ */
 WebInspector.AuditRule = function(id, displayName)
 {
     this._id = id;
@@ -358,6 +365,9 @@
     }
 }
 
+/**
+ * @constructor
+ */
 WebInspector.AuditCategoryResult = function(category)
 {
     this.title = category.displayName;
@@ -371,6 +381,11 @@
     }
 }
 
+/**
+ * @constructor
+ * @param {boolean=} expanded
+ * @param {string=} className
+ */
 WebInspector.AuditRuleResult = function(value, expanded, className)
 {
     this.value = value;
@@ -390,6 +405,10 @@
 }
 
 WebInspector.AuditRuleResult.prototype = {
+    /**
+     * @param {boolean=} expanded
+     * @param {string=} className
+     */
     addChild: function(value, expanded, className)
     {
         if (!this.children)
@@ -416,6 +435,10 @@
     }
 }
 
+/**
+ * @constructor
+ * @extends {WebInspector.SidebarTreeElement}
+ */
 WebInspector.AuditsSidebarTreeElement = function()
 {
     this.small = false;
@@ -447,7 +470,10 @@
 
 WebInspector.AuditsSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;
 
-
+/**
+ * @constructor
+ * @extends {WebInspector.SidebarTreeElement}
+ */
 WebInspector.AuditResultSidebarTreeElement = function(results, mainResourceURL, ordinal)
 {
     this.results = results;

Modified: trunk/Source/WebCore/inspector/front-end/NetworkLog.js (96948 => 96949)


--- trunk/Source/WebCore/inspector/front-end/NetworkLog.js	2011-10-07 16:43:14 UTC (rev 96948)
+++ trunk/Source/WebCore/inspector/front-end/NetworkLog.js	2011-10-07 16:44:42 UTC (rev 96949)
@@ -61,3 +61,8 @@
         this._resources.push(event.data);
     }
 }
+
+/**
+ * @type {WebInspector.NetworkLog}
+ */
+WebInspector.networkLog = null;

Modified: trunk/Source/WebCore/inspector/front-end/treeoutline.js (96948 => 96949)


--- trunk/Source/WebCore/inspector/front-end/treeoutline.js	2011-10-07 16:43:14 UTC (rev 96948)
+++ trunk/Source/WebCore/inspector/front-end/treeoutline.js	2011-10-07 16:44:42 UTC (rev 96949)
@@ -442,6 +442,9 @@
     // this is the root, do nothing
 }
 
+/**
+ * @param {boolean=} omitFocus
+ */
 TreeOutline.prototype.revealAndSelect = function(omitFocus)
 {
     // this is the root, do nothing
@@ -852,6 +855,9 @@
         this.onselect(this, selectedByUser);
 }
 
+/**
+ * @param {boolean=} omitFocus
+ */
 TreeElement.prototype.revealAndSelect = function(omitFocus)
 {
     this.reveal();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to