Bug 303506 - make xpcom nsDirectoryService assertions more meaningful, r=dougt,sr=shaver

This commit is contained in:
bob%bclary.com 2005-09-04 19:10:10 +00:00
Родитель 555d7f8815
Коммит f6055ed791
1 изменённых файлов: 18 добавлений и 16 удалений

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

@ -512,14 +512,15 @@ static const nsStaticAtom directory_atoms[] = {
NS_IMETHODIMP NS_IMETHODIMP
nsDirectoryService::Init() nsDirectoryService::Init()
{ {
NS_NOTREACHED("Don't call me, I was for internal use only!"); NS_NOTREACHED("nsDirectoryService::Init() for internal use only!");
return NS_OK; return NS_OK;
} }
nsresult nsresult
nsDirectoryService::RealInit() nsDirectoryService::RealInit()
{ {
NS_ASSERTION(!gService, "Mustn't initialize twice!"); NS_ASSERTION(!gService,
"nsDirectoryService::RealInit Mustn't initialize twice!");
nsresult rv; nsresult rv;
@ -650,7 +651,8 @@ nsDirectoryService::Get(const char* prop, const nsIID & uuid, void* *result)
{ {
nsCOMPtr<nsIFile> cloneFile; nsCOMPtr<nsIFile> cloneFile;
nsCOMPtr<nsIFile> cachedFile = do_QueryInterface(value); nsCOMPtr<nsIFile> cachedFile = do_QueryInterface(value);
NS_ASSERTION(cachedFile, "nsIFile expected"); NS_ASSERTION(cachedFile,
"nsDirectoryService::Get nsIFile expected");
cachedFile->Clone(getter_AddRefs(cloneFile)); cachedFile->Clone(getter_AddRefs(cloneFile));
return cloneFile->QueryInterface(uuid, result); return cloneFile->QueryInterface(uuid, result);