зеркало из https://github.com/mozilla/gecko-dev.git
bug# 9221 Fixing autoreg terminating on bad aliases. We now let it go
as far as possible ignoring errors. r=sfraser
This commit is contained in:
Родитель
ea0ac2fecc
Коммит
cf16f4e92d
|
@ -302,35 +302,25 @@ nsNativeComponentLoader::RegisterComponentsInDir(PRInt32 when,
|
|||
while (more == PR_TRUE)
|
||||
{
|
||||
rv = dirIterator->GetCurrentSpec(&dirEntry);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = dirEntry->IsDirectory(&isDir);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (isDir == PR_TRUE)
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
// This is a directory. Grovel for components into the directory.
|
||||
rv = RegisterComponentsInDir(when, dirEntry);
|
||||
rv = dirEntry->IsDirectory(&isDir);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
if (isDir == PR_TRUE)
|
||||
{
|
||||
// This is a directory. Grovel for components into the directory.
|
||||
rv = RegisterComponentsInDir(when, dirEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
PRBool registered;
|
||||
// This is a file. Try to register it.
|
||||
rv = AutoRegisterComponent(when, dirEntry, ®istered);
|
||||
}
|
||||
}
|
||||
NS_RELEASE(dirEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
PRBool registered;
|
||||
// This is a file. Try to register it.
|
||||
rv = AutoRegisterComponent(when, dirEntry, ®istered);
|
||||
}
|
||||
if (NS_FAILED(rv))
|
||||
{
|
||||
// This means either of AutoRegisterComponent or
|
||||
// SyncComponentsInDir failed. It could be because
|
||||
// the file isn't a component like initpref.js
|
||||
// So dont break on these errors.
|
||||
|
||||
// Update: actually, we return NS_OK for the wrong file
|
||||
// types, but we should never fail hard because just one
|
||||
// component didn't work.
|
||||
}
|
||||
|
||||
NS_RELEASE(dirEntry);
|
||||
|
||||
rv = dirIterator->Next();
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = dirIterator->Exists(&more);
|
||||
|
|
Загрузка…
Ссылка в новой задаче