зеркало из https://github.com/mozilla/pjs.git
various fixes. Big one was that we're no longer passing the uri in as the context to nsAsyncStreamObserver, it's now the channel.
This commit is contained in:
Родитель
9381d90062
Коммит
4eaa64d3c1
|
@ -107,6 +107,8 @@ static nsresult
|
|||
GetScheme(const char* inURI, char* *scheme)
|
||||
{
|
||||
// search for something up to a colon, and call it the scheme
|
||||
NS_ASSERTION(inURI, "null pointer");
|
||||
if (!inURI) return NS_ERROR_NULL_POINTER;
|
||||
char c;
|
||||
const char* URI = inURI;
|
||||
PRUint32 i = 0;
|
||||
|
|
|
@ -41,7 +41,11 @@ NS_NewURI(nsIURI* *result, const nsString& spec, nsIURI* baseURI)
|
|||
// XXX we need a strategy to deal w/ unicode specs (if there should
|
||||
// XXX even be such a thing)
|
||||
const char* specStr = spec.GetBuffer();
|
||||
if (!specStr)
|
||||
specStr = spec.ToNewCString(); // this forces a single byte char*
|
||||
nsresult rv = NS_NewURI(result, specStr, baseURI);
|
||||
if (specStr)
|
||||
nsCRT::free((char*)specStr);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -86,7 +90,8 @@ NS_OpenURI(nsIStreamListener* aConsumer, nsIURI* uri,
|
|||
rv = serv->NewChannelFromURI("load", uri, nsnull, &channel);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = channel->AsyncRead(0, -1, uri, // uri used as context
|
||||
rv = channel->AsyncRead(0, -1,
|
||||
channel, // channel as the context (the nsDocLoader expects this)
|
||||
aConsumer);
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче