rem: if ('setTimeout' in this) setTimeout(storeNextItem, 50); else { debug('set timeout is not defined if this call originated from newsblog.js\n'); storeNextItem(); } 
add: if (!gStoreItemsTimer) gStoreItemsTimer = Components.classes["@mozilla.org/timer;1"].createInstance(Components.interfaces.nsITimer); gStoreItemsTimer.initWithCallback(storeNextItemTimerCallback, 50, Components.interfaces.nsITimer.TYPE_ONE_SHOT); 
context: function storeNextItem(){  var item = gItemsToStore[gItemsToStoreIndex];   item.store();  item.markValid();  // if the listener is tracking progress for storing each item, report it here...  if (item.feed.downloadCallback && item.feed.downloadCallback.onFeedItemStored)    item.feed.downloadCallback.onFeedItemStored(item.feed, gItemsToStoreIndex, gItemsToStore.length);   gItemsToStoreIndex++  // eventually we'll report individual progress here....  if (gItemsToStoreIndex < gItemsToStore.length)  {    if ('setTimeout' in this)      setTimeout(storeNextItem, 50); // fire off a timer for the next item to store    else    {      debug('set timeout is not defined if this call originated from newsblog.js\n');      storeNextItem();    }  }  else  {        item.feed.removeInvalidItems();    if (item.feed.downloadCallback)      item.feed.downloadCallback.downloaded(item.feed, true);    item.feed.request = null; // force the xml http request to go away. This helps reduce some                              // nasty assertions on shut down of all things.    gItemsToStore = "";    gItemsToStoreIndex = 0;  }   }
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/0f6bca050a8a5fb3a040e99d9face7ddbd6463bc/Feed.js/clean/mail/extensions/newsblog/content/Feed.js