Changeset 89839 in webkit


Ignore:
Timestamp:
Jun 27, 2011 11:28:05 AM (13 years ago)
Author:
Adam Roben
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.

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestHistoryAnalyzer.js

    r89838 r89839  
    2626function LayoutTestHistoryAnalyzer(builder) {
    2727    this._builder = builder;
    28     this._cache = {};
     28    this._history = {};
    2929    this._loader = new LayoutTestResultsLoader(builder);
    3030}
     
    5656     */
    5757    start: function(callback) {
    58         var cacheKey = '_startFetchingBuildHistory';
    59         if (!(cacheKey in this._cache))
    60             this._cache[cacheKey] = {};
    61 
    62         var history = this._cache[cacheKey];
    63 
    6458        var self = this;
    6559        self._builder.getBuildNames(function(buildNames) {
    6660            function inner(buildIndex) {
    67                 self._incorporateBuildHistory(buildNames, buildIndex, history, function(callAgain) {
     61                self._incorporateBuildHistory(buildNames, buildIndex, function(callAgain) {
    6862                    var nextIndex = buildIndex + 1;
    6963                    if (nextIndex >= buildNames.length)
    7064                        callAgain = false;
    71                     callback(history, callAgain);
     65                    callback(self._history, callAgain);
    7266                    if (!callAgain)
    7367                        return;
     
    7973    },
    8074
    81     _incorporateBuildHistory: function(buildNames, buildIndex, history, callback) {
    82         var previousBuildName = Object.keys(history).last();
     75    _incorporateBuildHistory: function(buildNames, buildIndex, callback) {
     76        var previousBuildName = Object.keys(this._history).last();
    8377        var nextBuildName = buildNames[buildIndex];
    8478
    85         this._loader.start(nextBuildName, function(tests, tooManyFailures) {
    86             history[nextBuildName] = {
     79        var self = this;
     80        self._loader.start(nextBuildName, function(tests, tooManyFailures) {
     81            self._history[nextBuildName] = {
    8782                tooManyFailures: tooManyFailures,
    8883                tests: {},
     
    9186            for (var testName in tests) {
    9287                if (previousBuildName) {
    93                     if (!(testName in history[previousBuildName].tests))
     88                    if (!(testName in self._history[previousBuildName].tests))
    9489                        continue;
    95                     delete history[previousBuildName].tests[testName];
     90                    delete self._history[previousBuildName].tests[testName];
    9691                }
    97                 history[nextBuildName].tests[testName] = tests[testName];
     92                self._history[nextBuildName].tests[testName] = tests[testName];
    9893            }
    9994
    100             callback(Object.keys(history[nextBuildName].tests).length);
     95            callback(Object.keys(self._history[nextBuildName].tests).length);
    10196        },
    10297        function(tests) {
  • trunk/Tools/ChangeLog

    r89838 r89839  
     12011-06-26  Adam Roben  <aroben@apple.com>
     2
     3        Store analyzed history directly in LayoutTestHistoryAnalyzer instead of in a generic cache
     4
     5        It seems silly to have a whole generic cache just to store a single object.
     6
     7        Fixes <http://webkit.org/b/63407> LayoutTestHistoryAnalyzer has a generic cache but doesn't
     8        need one
     9
     10        Reviewed by Anders Carlsson.
     11
     12        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestHistoryAnalyzer.js:
     13        (LayoutTestHistoryAnalyzer): Replaced this._cache with this._history.
     14        (LayoutTestHistoryAnalyzer.prototype.start): Ditto.
     15        (LayoutTestHistoryAnalyzer.prototype._incorporateBuildHistory): Ditto, and removed the
     16        no-longer-needed history argument.
     17
    1182011-06-26  Adam Roben  <aroben@apple.com>
    219
Note: See TracChangeset for help on using the changeset viewer.