зеркало из https://github.com/mozilla/gecko-dev.git
use the NS_WITH_SERVICE macro. #15042
remove calls to toolkit appcore, as it is going away soon. #14999
This commit is contained in:
Родитель
14554c992d
Коммит
979446d392
|
@ -55,10 +55,10 @@ function open() {
|
|||
browser.loadUrl( url );
|
||||
|
||||
/* Close dialog. */
|
||||
toolkit.CloseWindow( window );
|
||||
window.close();
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
toolkit.CloseWindow( window );
|
||||
window.close();
|
||||
}
|
||||
|
||||
|
|
|
@ -161,13 +161,9 @@ nsPrefMigrationProgressDialog::CreateProfileProgressDialog()
|
|||
nsresult rv = NS_OK;
|
||||
|
||||
// Get app shell service.
|
||||
nsIAppShellService *appShell;
|
||||
rv = nsServiceManager::GetService( kAppShellServiceCID,
|
||||
nsIAppShellService::GetIID(),
|
||||
(nsISupports**)&appShell );
|
||||
NS_WITH_SERVICE(nsIAppShellService, appShell, kAppShellServiceCID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if ( NS_SUCCEEDED( rv ) )
|
||||
{
|
||||
// Open "progress" dialog.
|
||||
nsCOMPtr <nsIURI> url;
|
||||
const char *urlSpec = "resource:/res/profile/progress_undetermined.xul";
|
||||
|
@ -202,12 +198,6 @@ nsPrefMigrationProgressDialog::CreateProfileProgressDialog()
|
|||
}
|
||||
}
|
||||
|
||||
nsServiceManager::ReleaseService( kAppShellServiceCID, appShell );
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_PRINTF( PR_STDOUT, "Unable to get app shell service, rv=0x%X\n", (int)rv );
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -215,22 +205,11 @@ NS_IMETHODIMP
|
|||
nsPrefMigrationProgressDialog::KillProfileProgressDialog()
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
nsIAppShellService *appShell;
|
||||
NS_WITH_SERVICE(nsIAppShellService, appShell, kAppShellServiceCID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = nsServiceManager::GetService( kAppShellServiceCID,
|
||||
nsIAppShellService::GetIID(),
|
||||
(nsISupports**)&appShell );
|
||||
|
||||
if ( NS_SUCCEEDED( rv ) )
|
||||
{
|
||||
rv = appShell->CloseTopLevelWindow( mWindow );
|
||||
nsServiceManager::ReleaseService(kAppShellServiceCID, appShell);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_PRINTF( PR_STDOUT, "Unable to get app shell service, rv=0x%X\n", (int)rv );
|
||||
}
|
||||
return NS_OK;
|
||||
rv = appShell->CloseTopLevelWindow( mWindow );
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче