зеркало из https://github.com/mozilla/gecko-dev.git
[performance] When profile manager is being used, don't read in bookmarks twice... by deferring hiddenwindow.xul loading until after profile manager is done. Review: danm and sspitzer
This commit is contained in:
Родитель
b545fdcf6a
Коммит
a0d87839ca
|
@ -1506,6 +1506,11 @@ NS_IMETHODIMP nsProfile::StartApprunner(const char* profileName)
|
|||
prefs->ResetPrefs();
|
||||
prefs->ReadUserPrefs();
|
||||
|
||||
/*
|
||||
// rjc says: no longer do this! The profile manager now runs BEFORE
|
||||
// hiddenwindow.xul (which causes bookmarks to be read in) is loaded
|
||||
|
||||
|
||||
// we need to re-read the bookmarks here, other wise the user
|
||||
// won't have there 4.x bookmarks until after they exit and come back
|
||||
NS_WITH_SERVICE(nsIBookmarksService, bookmarks, kBookmarksCID, &rv);
|
||||
|
@ -1516,6 +1521,7 @@ NS_IMETHODIMP nsProfile::StartApprunner(const char* profileName)
|
|||
printf("failed to read bookmarks\n");
|
||||
return rv;
|
||||
}
|
||||
*/
|
||||
|
||||
rv = CloseRegistry();
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
|
|
@ -149,6 +149,9 @@ interface nsIAppShellService : nsISupports
|
|||
*/
|
||||
void CloseTopLevelWindow(in nsIWebShellWindow aWindow);
|
||||
|
||||
[noscript]
|
||||
void CreateHiddenWindow();
|
||||
|
||||
/**
|
||||
* Return the (singleton) application hidden window, automatically created
|
||||
* and maintained by this AppShellService.
|
||||
|
|
|
@ -114,7 +114,6 @@ protected:
|
|||
nsIXULWindowCallbacks *aCallbacks,
|
||||
PRInt32 aInitialWidth, PRInt32 aInitialHeight,
|
||||
nsIWebShellWindow **aResult);
|
||||
void CreateHiddenWindow();
|
||||
void InitializeComponent( const nsCID &aComponentCID );
|
||||
void ShutdownComponent( const nsCID &aComponentCID );
|
||||
typedef void (nsAppShellService::*EnumeratorMemberFunction)(const nsCID&);
|
||||
|
@ -258,13 +257,16 @@ nsAppShellService::Initialize( nsICmdLineService *aCmdLineService )
|
|||
rv = nsServiceManager::GetService(kWindowMediatorCID, kIWindowMediatorIID,
|
||||
(nsISupports**) &mWindowMediator);
|
||||
|
||||
CreateHiddenWindow();
|
||||
// CreateHiddenWindow(); // rjc: now require this to be explicitly called
|
||||
|
||||
done:
|
||||
return rv;
|
||||
}
|
||||
|
||||
void nsAppShellService::CreateHiddenWindow()
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAppShellService::CreateHiddenWindow()
|
||||
{
|
||||
nsresult rv;
|
||||
nsIURI* url = nsnull;
|
||||
|
@ -814,15 +816,24 @@ nsAppShellService::UnregisterTopLevelWindow(nsIWebShellWindow* aWindow)
|
|||
if (0 == cnt)
|
||||
{
|
||||
#if XP_MAC
|
||||
// Given hidden window the focus so it puts up the menu
|
||||
nsIWidget* widget = NULL;
|
||||
mHiddenWindow->GetWidget( widget );
|
||||
if( widget )
|
||||
{
|
||||
widget->SetFocus();
|
||||
|
||||
widget->Release();
|
||||
}
|
||||
if (mHiddenWindow)
|
||||
{
|
||||
// Given hidden window the focus so it puts up the menu
|
||||
nsIWidget* widget = NULL;
|
||||
mHiddenWindow->GetWidget( widget );
|
||||
if( widget )
|
||||
{
|
||||
widget->SetFocus();
|
||||
|
||||
widget->Release();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// if no hidden window is available (perhaps due to initial
|
||||
// Profile Manager window being cancelled), then just quit
|
||||
Quit();
|
||||
}
|
||||
#else
|
||||
Quit();
|
||||
#endif
|
||||
|
|
|
@ -516,8 +516,8 @@ static nsresult main1(int argc, char* argv[])
|
|||
#ifdef DEBUG
|
||||
printf("started appcores\n");
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// Create the Application Shell instance...
|
||||
NS_WITH_SERVICE(nsIAppShellService, appShell, kAppShellServiceCID, &rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
|
@ -548,6 +548,10 @@ static nsresult main1(int argc, char* argv[])
|
|||
}
|
||||
PR_FREEIF(currentProfileStr);
|
||||
|
||||
// rjc: now must explicitly call appshell's CreateHiddenWindow() function AFTER profile manager.
|
||||
// if the profile manager ever switches to using nsIDOMWindow stuff, this might have to change
|
||||
appShell->CreateHiddenWindow();
|
||||
|
||||
if ( CheckAndRunPrefs(cmdLineArgs) )
|
||||
return NS_OK;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче