commit 481682d4a796647b9843803829c0826fad586b6f
parent 89245e857fe12d36e82cde0f2984bba83d9e0638
Author: Simon Kornblith <simon@simonster.com>
Date: Tue, 31 Jan 2012 03:42:33 -0500
Add notes that processNextEvent() calls are used to handle deprecated cases
Diffstat:
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js
@@ -371,6 +371,7 @@ Zotero.Translate.Sandbox = {
Zotero.Translators.get(translation.translator[0], haveTranslatorFunction);
if(Zotero.isConnector && Zotero.isFx && !callback) {
while(!sandbox && translate._currentState) {
+ // This processNextEvent call is used to handle a deprecated case
Zotero.mainThread.processNextEvent(true);
}
}
diff --git a/chrome/content/zotero/xpcom/utilities_translate.js b/chrome/content/zotero/xpcom/utilities_translate.js
@@ -271,6 +271,7 @@ Zotero.Utilities.Translate.prototype.processDocuments = function(urls, processor
* Gets the DOM document object corresponding to the page located at URL, but avoids locking the
* UI while the request is in process.
*
+ * @deprecated
* @param {String} url URL to load
* @return {Document} DOM document object
*/
@@ -297,6 +298,7 @@ Zotero.Utilities.Translate.prototype.retrieveDocument = function(url) {
// should ever take longer than 2 minutes.
var endTime = Date.now() + 120000;
while(!loaded && Date.now() < endTime) {
+ // This processNextEvent call is used to handle a deprecated case
mainThread.processNextEvent(true);
}
@@ -313,6 +315,7 @@ Zotero.Utilities.Translate.prototype.retrieveDocument = function(url) {
* Gets the source of the page located at URL, but avoids locking the UI while the request is in
* process.
*
+ * @deprecated
* @param {String} url URL to load
* @param {String} [body=null] Request body to POST to the URL; a GET request is
* executed if no body is present
@@ -345,6 +348,7 @@ Zotero.Utilities.Translate.prototype.retrieveSource = function(url, body, header
var xmlhttp = Zotero.HTTP.doGet(url, listener, responseCharset, this._translate.cookieSandbox);
}
+ // This processNextEvent call is used to handle a deprecated case
while(!finished) mainThread.processNextEvent(true);
} else {
// Use a synchronous XMLHttpRequest, even though this is inadvisable