зеркало из https://github.com/mozilla/pjs.git
Bug 276478 - Put back two important lines for the async reading code used in Mozilla 1.0, and fix getFileFromURLSpec on Mozilla 1.0.
ChatZilla only. r=rginda
This commit is contained in:
Родитель
8aaf81e064
Коммит
50a7d761d9
|
@ -548,6 +548,9 @@ function sl_dataavail (request, ctxt, inStr, sourceOffset, count)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!("_sInputStream" in ctxt))
|
||||
ctxt._sInputStream = toSInputStream(inStr, false);
|
||||
|
||||
if (this._observer)
|
||||
this._observer.onStreamDataAvailable(request, inStr, sourceOffset,
|
||||
count);
|
||||
|
|
|
@ -908,7 +908,22 @@ function getFileFromURLSpec(url)
|
|||
|
||||
var service = getService("@mozilla.org/network/io-service;1",
|
||||
"nsIIOService");
|
||||
|
||||
|
||||
/* In sept 2002, bug 166792 moved this method to the nsIFileProtocolHandler
|
||||
* interface, but we need to support older versions too. */
|
||||
if ("getFileFromURLSpec" in service)
|
||||
return service.getFileFromURLSpec(url);
|
||||
|
||||
/* In builds before 2002-08-15, there is no getFileFromURLSpec at all.
|
||||
* Instead, we have nsIIOservice.initFileFromURLSpec(nsIFile, string).
|
||||
*/
|
||||
if ("initFileFromURLSpec" in service)
|
||||
{
|
||||
var file = newObject("@mozilla.org/file/local;1", "nsILocalFile");
|
||||
service.initFileFromURLSpec(file, url);
|
||||
return file;
|
||||
}
|
||||
|
||||
var handler = service.getProtocolHandler("file");
|
||||
handler = handler.QueryInterface(nsIFileProtocolHandler);
|
||||
return handler.getFileFromURLSpec(url);
|
||||
|
|
Загрузка…
Ссылка в новой задаче