From 9bc75b174a85c8cadeeafc72b4f09a1d06994a38 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Wed, 6 Aug 2008 11:53:44 -0700 Subject: [PATCH] Backed out changeset fb56f835e52d due to test failure and leaks. --- .../places/src/nsLivemarkService.js | 49 +++---------------- .../places/tests/chrome/Makefile.in | 1 - 2 files changed, 7 insertions(+), 43 deletions(-) diff --git a/toolkit/components/places/src/nsLivemarkService.js b/toolkit/components/places/src/nsLivemarkService.js index f2d71a85185..4ba4625af6d 100644 --- a/toolkit/components/places/src/nsLivemarkService.js +++ b/toolkit/components/places/src/nsLivemarkService.js @@ -26,7 +26,6 @@ * Robert Sayre (JS port) * Phil Ringnalda * Marco Bonardo - * Takeshi Ichimaru * * Alternatively, the contents of this file may be used under the * terms of either the GNU General Public License Version 2 or later @@ -86,12 +85,6 @@ const NS_BINDING_ABORTED = 0x804b0002; // Expire livemarks after 1 hour by default var gExpiration = 3600000; -// Number of livemarks that are read at one -var gLimitCount = 1; - -// Interval when livemarks are loaded -var gDelayTime = 3; - // Expire livemarks after 10 minutes on error const ERROR_EXPIRATION = 600000; @@ -148,18 +141,6 @@ function LivemarkService() { } catch (ex) { } - try { - gLimitCount = prefs.getIntPref("browser.bookmarks.livemark_refresh_limit_count"); - if ( gLimitCount < 1 ) gLimitCount = 1; - } - catch (ex) { } - - try { - gDelayTime = prefs.getIntPref("browser.bookmarks.livemark_refresh_delay_time"); - if ( gDelayTime < 1 ) gDelayTime = 1; - } - catch (ex) { } - // [ {folderId:, folderURI:, feedURI:, loadGroup:, locked: } ]; this._livemarks = []; @@ -210,6 +191,10 @@ LivemarkService.prototype = { // we do a first check of the livemarks here, next checks will be on timer // browser start => 5s => this.start() => check => refresh_time => check this._checkAllLivemarks(); + // the refresh time is calculated from the expiration time, but with a cap + var refresh_time = Math.min(Math.floor(gExpiration / 4), MAX_REFRESH_TIME); + this._updateTimer = new G_Alarm(BindToObject(this._checkAllLivemarks, this), + refresh_time, true /* repeat */); }, _pushLivemark: function LS__pushLivemark(aFolderId, aFeedURI) { @@ -242,30 +227,10 @@ LivemarkService.prototype = { } }, - // We try to distribute the load of the livemark update. - // load gLimitCount Livemarks per gDelayTime sec. - _nextUpdateStartIndex : 0, _checkAllLivemarks: function LS__checkAllLivemarks() { - var startNo = this._nextUpdateStartIndex; - var count = 0; - for (var i = startNo; (i < this._livemarks.length) && (count < gLimitCount); ++i ) { - // check if livemarks are expired, update if needed - try { - if (this._updateLivemarkChildren(i, false)) count++; - } - catch (ex) { } - this._nextUpdateStartIndex = i+1; - } - if ( this._nextUpdateStartIndex >= this._livemarks.length ) { - // all livemarks are checked, sleeping until next period - this._nextUpdateStartIndex = 0; - var refresh_time = Math.min(Math.floor(gExpiration / 4), MAX_REFRESH_TIME); - this._updateTimer = new G_Alarm(BindToObject(this._checkAllLivemarks, this), - refresh_time); - } else { - // wait gDelayTime sec. - this._updateTimer = new G_Alarm(BindToObject(this._checkAllLivemarks, this), - gDelayTime*1000); + // check if livemarks are expired, update if needed + for (var i = 0; i < this._livemarks.length; ++i) { + this._updateLivemarkChildren(i, false); } }, diff --git a/toolkit/components/places/tests/chrome/Makefile.in b/toolkit/components/places/tests/chrome/Makefile.in index 6699b19b285..a89b5f4c609 100644 --- a/toolkit/components/places/tests/chrome/Makefile.in +++ b/toolkit/components/places/tests/chrome/Makefile.in @@ -52,7 +52,6 @@ _HTTP_FILES = \ $(NULL) _CHROME_FILES = \ - test_329534.xul \ test_371798.xul \ test_342484.xul \ test_341972a.xul \