зеркало из https://github.com/mozilla/gecko-dev.git
fix for #32649. make it so an error on migration makes its way into an alert for the user.
(still more work to do when handling out of space errors.) clean up code.
This commit is contained in:
Родитель
85a739278d
Коммит
19bc3835ff
|
@ -37,7 +37,7 @@ interface nsIPrefMigration: nsISupports
|
|||
void AddProfilePaths(in string oldProfilePathStr, in string newProfilePathStr);
|
||||
void ProcessPrefs(in boolean showProgressAsModalWindow);
|
||||
void ProcessPrefsFromJS();
|
||||
void GetError(out PRUint32 error);
|
||||
void GetError();
|
||||
|
||||
/**
|
||||
* this should be in a seperate interface
|
||||
|
|
|
@ -36,15 +36,15 @@ function onLoad(oldProfilePath, newProfilePath) {
|
|||
var prefmigrator = Components.classes['component://netscape/profile/migration'].createInstance(Components.interfaces.nsIPrefMigration);
|
||||
if (prefmigrator)
|
||||
{
|
||||
dump("----- Migrating prefs\n");
|
||||
retval = prefmigrator.ProcessPrefsFromJS();
|
||||
dump("----- Migrating prefs done " + retval + "\n" );
|
||||
dump("----- Migrating prefs\n");
|
||||
try {
|
||||
prefmigrator.ProcessPrefsFromJS();
|
||||
}
|
||||
catch (ex) {
|
||||
alert("error migrating profile, possibly out of space. ex="+ex);
|
||||
}
|
||||
dump("----- Migrating prefs done " + retval + "\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
dump("----- ERROR Migrating prefs failed create instances failed\n");
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -251,6 +251,7 @@ nsPrefMigration::GetInstance()
|
|||
nsPrefMigration::nsPrefMigration() : m_prefs(0)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mErrorCode = NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -409,15 +410,16 @@ nsPrefMigration::ProcessPrefsFromJS() // called via js so that we can have prog
|
|||
PR_GLOBAL_THREAD,
|
||||
PR_UNJOINABLE_THREAD,
|
||||
0);
|
||||
return NS_OK;
|
||||
|
||||
nsresult err = GetError();
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPrefMigration::GetError(PRUint32 *error)
|
||||
nsPrefMigration::GetError()
|
||||
{
|
||||
*error = mErrorCode;
|
||||
return NS_OK;
|
||||
return mErrorCode;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
Загрузка…
Ссылка в новой задаче