This commit is contained in:
warren%netscape.com 1999-06-08 18:28:10 +00:00
Родитель 9aedb5568b
Коммит b8cb6d85e5
1 изменённых файлов: 31 добавлений и 2 удалений

Просмотреть файл

@ -152,7 +152,32 @@ nsIOService::NewChannelFromURI(const char* verb, nsIURI *aURI,
nsIEventSinkGetter *eventSinkGetter,
nsIChannel **result)
{
return NS_ERROR_NOT_IMPLEMENTED;
nsresult rv;
char* scheme;
rv = aURI->GetScheme(&scheme);
if (NS_FAILED(rv)) return rv;
nsIProtocolHandler* handler;
rv = GetProtocolHandler(scheme, &handler);
nsCRT::free(scheme);
if (NS_FAILED(rv)) return rv;
nsIEventQueue* eventQ;
NS_WITH_SERVICE(nsIEventQueueService, eventQService, kEventQueueService, &rv);
if (NS_SUCCEEDED(rv)) {
rv = eventQService->GetThreadEventQueue(PR_CurrentThread(), &eventQ);
}
if (NS_FAILED(rv)) return rv;
nsIChannel* channel;
rv = handler->NewChannel(verb, aURI, eventSinkGetter, eventQ,
&channel);
NS_RELEASE(handler);
if (NS_FAILED(rv)) return rv;
*result = channel;
return rv;
}
NS_IMETHODIMP
@ -161,7 +186,11 @@ nsIOService::NewChannel(const char* verb, const char *aSpec,
nsIEventSinkGetter *eventSinkGetter,
nsIChannel **result)
{
return NS_ERROR_NOT_IMPLEMENTED;
nsresult rv;
nsIURI* uri;
rv = NewURI(aSpec, aBaseURI, &uri);
if (NS_FAILED(rv)) return rv;
return NewChannelFromURI(verb, uri, eventSinkGetter, result);
}
NS_IMETHODIMP