Title: [89839] trunk/Tools
Revision
89839
Author
[email protected]
Date
2011-06-27 11:28:05 -0700 (Mon, 27 Jun 2011)

Log Message

Store analyzed history directly in LayoutTestHistoryAnalyzer instead of in a generic cache

It seems silly to have a whole generic cache just to store a single object.

Fixes <http://webkit.org/b/63407> LayoutTestHistoryAnalyzer has a generic cache but doesn't
need one

Reviewed by Anders Carlsson.

* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestHistoryAnalyzer.js:
(LayoutTestHistoryAnalyzer): Replaced this._cache with this._history.
(LayoutTestHistoryAnalyzer.prototype.start): Ditto.
(LayoutTestHistoryAnalyzer.prototype._incorporateBuildHistory): Ditto, and removed the
no-longer-needed history argument.

Modified Paths

Diff

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestHistoryAnalyzer.js (89838 => 89839)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestHistoryAnalyzer.js	2011-06-27 18:27:33 UTC (rev 89838)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestHistoryAnalyzer.js	2011-06-27 18:28:05 UTC (rev 89839)
@@ -25,7 +25,7 @@
 
 function LayoutTestHistoryAnalyzer(builder) {
     this._builder = builder;
-    this._cache = {};
+    this._history = {};
     this._loader = new LayoutTestResultsLoader(builder);
 }
 
@@ -55,20 +55,14 @@
      * in that build.
      */
     start: function(callback) {
-        var cacheKey = '_startFetchingBuildHistory';
-        if (!(cacheKey in this._cache))
-            this._cache[cacheKey] = {};
-
-        var history = this._cache[cacheKey];
-
         var self = this;
         self._builder.getBuildNames(function(buildNames) {
             function inner(buildIndex) {
-                self._incorporateBuildHistory(buildNames, buildIndex, history, function(callAgain) {
+                self._incorporateBuildHistory(buildNames, buildIndex, function(callAgain) {
                     var nextIndex = buildIndex + 1;
                     if (nextIndex >= buildNames.length)
                         callAgain = false;
-                    callback(history, callAgain);
+                    callback(self._history, callAgain);
                     if (!callAgain)
                         return;
                     setTimeout(function() { inner(nextIndex) }, 0);
@@ -78,26 +72,27 @@
         });
     },
 
-    _incorporateBuildHistory: function(buildNames, buildIndex, history, callback) {
-        var previousBuildName = Object.keys(history).last();
+    _incorporateBuildHistory: function(buildNames, buildIndex, callback) {
+        var previousBuildName = Object.keys(this._history).last();
         var nextBuildName = buildNames[buildIndex];
 
-        this._loader.start(nextBuildName, function(tests, tooManyFailures) {
-            history[nextBuildName] = {
+        var self = this;
+        self._loader.start(nextBuildName, function(tests, tooManyFailures) {
+            self._history[nextBuildName] = {
                 tooManyFailures: tooManyFailures,
                 tests: {},
             };
 
             for (var testName in tests) {
                 if (previousBuildName) {
-                    if (!(testName in history[previousBuildName].tests))
+                    if (!(testName in self._history[previousBuildName].tests))
                         continue;
-                    delete history[previousBuildName].tests[testName];
+                    delete self._history[previousBuildName].tests[testName];
                 }
-                history[nextBuildName].tests[testName] = tests[testName];
+                self._history[nextBuildName].tests[testName] = tests[testName];
             }
 
-            callback(Object.keys(history[nextBuildName].tests).length);
+            callback(Object.keys(self._history[nextBuildName].tests).length);
         },
         function(tests) {
             // Some tests failed, but we couldn't fetch results.html (perhaps because the test

Modified: trunk/Tools/ChangeLog (89838 => 89839)


--- trunk/Tools/ChangeLog	2011-06-27 18:27:33 UTC (rev 89838)
+++ trunk/Tools/ChangeLog	2011-06-27 18:28:05 UTC (rev 89839)
@@ -1,5 +1,22 @@
 2011-06-26  Adam Roben  <[email protected]>
 
+        Store analyzed history directly in LayoutTestHistoryAnalyzer instead of in a generic cache
+
+        It seems silly to have a whole generic cache just to store a single object.
+
+        Fixes <http://webkit.org/b/63407> LayoutTestHistoryAnalyzer has a generic cache but doesn't
+        need one
+
+        Reviewed by Anders Carlsson.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestHistoryAnalyzer.js:
+        (LayoutTestHistoryAnalyzer): Replaced this._cache with this._history.
+        (LayoutTestHistoryAnalyzer.prototype.start): Ditto.
+        (LayoutTestHistoryAnalyzer.prototype._incorporateBuildHistory): Ditto, and removed the
+        no-longer-needed history argument.
+
+2011-06-26  Adam Roben  <[email protected]>
+
         Move some inappropriate code out of Builder
 
         Fixes <http://webkit.org/b/63406> TestFailure page's Builder class has a bunch of code that
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to