Fix for 18315 -- remember which rdf files you've tried, and failed, to open, to avoid trying over and over and over again. r=pavlov.

This commit is contained in:
sfraser%netscape.com 1999-11-11 20:42:31 +00:00
Родитель fe7238681a
Коммит 1d8bdd81f8
2 изменённых файлов: 28 добавлений и 12 удалений

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

@ -555,17 +555,23 @@ NS_IMETHODIMP nsChromeRegistry::LoadDataSource(const nsCAutoString &aFileName, n
if (! remote)
return NS_ERROR_UNEXPECTED;
if (!mDataSourceTable)
mDataSourceTable = new nsSupportsHashtable;
rv = remote->Init(aFileName);
if (NS_FAILED(rv)) return rv;
if (NS_FAILED(rv)) {
nsStringKey skey(aFileName);
mDataSourceTable->Put(&skey, nsnull);
return rv;
}
// We need to read this synchronously.
rv = remote->Refresh(PR_TRUE);
if (NS_FAILED(rv)) return rv;
if (!mDataSourceTable)
mDataSourceTable = new nsSupportsHashtable;
if (NS_FAILED(rv)) {
nsStringKey skey(aFileName);
mDataSourceTable->Put(&skey, nsnull);
return rv;
}
nsCOMPtr<nsISupports> supports = do_QueryInterface(remote);
nsStringKey skey(aFileName);
@ -609,6 +615,8 @@ nsChromeRegistry::InitializeDataSource(nsString &aPackage,
}
return NS_ERROR_FAILURE;
}
else if (mDataSourceTable->Exists(&skey))
return NS_OK;
}
nsCOMPtr<nsIRDFDataSource> overlayDataSource;

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

@ -555,17 +555,23 @@ NS_IMETHODIMP nsChromeRegistry::LoadDataSource(const nsCAutoString &aFileName, n
if (! remote)
return NS_ERROR_UNEXPECTED;
if (!mDataSourceTable)
mDataSourceTable = new nsSupportsHashtable;
rv = remote->Init(aFileName);
if (NS_FAILED(rv)) return rv;
if (NS_FAILED(rv)) {
nsStringKey skey(aFileName);
mDataSourceTable->Put(&skey, nsnull);
return rv;
}
// We need to read this synchronously.
rv = remote->Refresh(PR_TRUE);
if (NS_FAILED(rv)) return rv;
if (!mDataSourceTable)
mDataSourceTable = new nsSupportsHashtable;
if (NS_FAILED(rv)) {
nsStringKey skey(aFileName);
mDataSourceTable->Put(&skey, nsnull);
return rv;
}
nsCOMPtr<nsISupports> supports = do_QueryInterface(remote);
nsStringKey skey(aFileName);
@ -609,6 +615,8 @@ nsChromeRegistry::InitializeDataSource(nsString &aPackage,
}
return NS_ERROR_FAILURE;
}
else if (mDataSourceTable->Exists(&skey))
return NS_OK;
}
nsCOMPtr<nsIRDFDataSource> overlayDataSource;