Follow-up to fix for bug 10456. I made the earlier changes to the non-Necko part of the code! Making the same changes to the ifdef NECKO part.

This commit is contained in:
nisheeth%netscape.com 1999-10-26 02:42:23 +00:00
Родитель e8701d26fd
Коммит d86938aa1f
2 изменённых файлов: 48 добавлений и 32 удалений

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

@ -530,22 +530,30 @@ nsExpatTokenizer::OpenInputStream(const nsString& aURLStr,
}
}
}
#else // NECKO
nsIURI* uri;
nsIURI* baseURI;
rv = NS_NewURI(&baseURI, aBaseURL);
if (NS_SUCCEEDED(rv)) {
rv = NS_NewURI(&uri, aURLStr, baseURI);
if (NS_SUCCEEDED(rv)) {
rv = NS_OpenURI(in, uri);
char* absURL = nsnull;
uri->GetSpec(&absURL);
aAbsURL->Append(absURL);
nsCRT::free(absURL);
NS_RELEASE(uri);
}
NS_RELEASE(baseURI);
#else // NECKO
nsCOMPtr<nsIURI> baseURI;
rv = NS_NewURI(getter_AddRefs(baseURI), aBaseURL);
if (NS_SUCCEEDED(rv) && nsnull != baseURI) {
nsCOMPtr<nsIURI> uri = nsnull;
rv = NS_NewURI(getter_AddRefs(uri), aURLStr, baseURI);
if (NS_SUCCEEDED(rv) && nsnull != uri) {
char* scheme = nsnull;
rv = uri->GetScheme(&scheme);
if (NS_SUCCEEDED(rv) &&
nsnull != scheme &&
PL_strcmp(scheme, kChromeProtocol) == 0 )
{
rv = NS_OpenURI(in, uri);
char* absURL = nsnull;
uri->GetSpec(&absURL);
aAbsURL->Append(absURL);
nsCRT::free(absURL);
}
else {
rv = NS_ERROR_NOT_IMPLEMENTED;
}
if (scheme) nsCRT::free(scheme);
}
}
#endif // NECKO
return rv;

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

@ -530,22 +530,30 @@ nsExpatTokenizer::OpenInputStream(const nsString& aURLStr,
}
}
}
#else // NECKO
nsIURI* uri;
nsIURI* baseURI;
rv = NS_NewURI(&baseURI, aBaseURL);
if (NS_SUCCEEDED(rv)) {
rv = NS_NewURI(&uri, aURLStr, baseURI);
if (NS_SUCCEEDED(rv)) {
rv = NS_OpenURI(in, uri);
char* absURL = nsnull;
uri->GetSpec(&absURL);
aAbsURL->Append(absURL);
nsCRT::free(absURL);
NS_RELEASE(uri);
}
NS_RELEASE(baseURI);
#else // NECKO
nsCOMPtr<nsIURI> baseURI;
rv = NS_NewURI(getter_AddRefs(baseURI), aBaseURL);
if (NS_SUCCEEDED(rv) && nsnull != baseURI) {
nsCOMPtr<nsIURI> uri = nsnull;
rv = NS_NewURI(getter_AddRefs(uri), aURLStr, baseURI);
if (NS_SUCCEEDED(rv) && nsnull != uri) {
char* scheme = nsnull;
rv = uri->GetScheme(&scheme);
if (NS_SUCCEEDED(rv) &&
nsnull != scheme &&
PL_strcmp(scheme, kChromeProtocol) == 0 )
{
rv = NS_OpenURI(in, uri);
char* absURL = nsnull;
uri->GetSpec(&absURL);
aAbsURL->Append(absURL);
nsCRT::free(absURL);
}
else {
rv = NS_ERROR_NOT_IMPLEMENTED;
}
if (scheme) nsCRT::free(scheme);
}
}
#endif // NECKO
return rv;