diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-06 17:15:42 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-06 17:15:42 +0000 |
commit | 1a3861a91760e4f95e580c15592eadc0c13452ae (patch) | |
tree | 50410349e0a61ff0b7b63210f9824916569e8f17 | |
parent | b41f1fc60dae06b6b5070d3d12ff2c38b0c0dd52 (diff) | |
download | chromium_src-1a3861a91760e4f95e580c15592eadc0c13452ae.zip chromium_src-1a3861a91760e4f95e580c15592eadc0c13452ae.tar.gz chromium_src-1a3861a91760e4f95e580c15592eadc0c13452ae.tar.bz2 |
Fix the "pick a new user data dir" dialog on windows.
There were three things to be fixed:
1) We don't need to run a separate message loop after the
dialog closes. The MessageLoopForUI handles this properly.
2) When tearing down browser_process_impl, io_loop
hasn't been initialized yet, so we check to make sure it
exists before using it.
3) We don't call window->Close() because that deletes the
dialog class before we're done using it. This means we leak
the window, but that's ok because we're going to exit anyway.
Review URL: http://codereview.chromium.org/114004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15422 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/browser_main.cc | 7 | ||||
-rw-r--r-- | chrome/browser/browser_process_impl.cc | 6 | ||||
-rw-r--r-- | chrome/browser/views/user_data_dir_dialog.cc | 1 |
3 files changed, 8 insertions, 6 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 9a3b00d..9b675f1 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -350,6 +350,10 @@ int BrowserMain(const MainFunctionParams& parameters) { ProfileManager* profile_manager = browser_process->profile_manager(); Profile* profile = profile_manager->GetDefaultProfile(user_data_dir); if (!profile) { + // Ideally, we should be able to run w/o access to disk. For now, we + // prompt the user to pick a different user-data-dir and restart chrome + // with the new dir. + // http://code.google.com/p/chromium/issues/detail?id=11510 #if defined(OS_WIN) user_data_dir = FilePath::FromWStringHack( UserDataDirDialog::RunUserDataDirDialog(user_data_dir.ToWStringHack())); @@ -358,9 +362,6 @@ int BrowserMain(const MainFunctionParams& parameters) { user_data_dir = FilePath("/tmp"); #endif #if defined(OS_WIN) || defined(OS_LINUX) - // Flush the message loop which lets the UserDataDirDialog close. - MessageLoop::current()->Run(); - if (!parameters.ui_task && browser_shutdown::delete_resources_on_shutdown) { // Only delete the resources if we're not running tests. If we're running // tests the resources need to be reused as many places in the UI cache diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 7a09320..72e06f1 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -168,8 +168,10 @@ BrowserProcessImpl::~BrowserProcessImpl() { // Shutdown DNS prefetching now to ensure that network stack objects // living on the IO thread get destroyed before the IO thread goes away. - io_thread_->message_loop()->PostTask(FROM_HERE, - NewRunnableFunction(chrome_browser_net::EnsureDnsPrefetchShutdown)); + if (io_thread_.get()) { + io_thread_->message_loop()->PostTask(FROM_HERE, + NewRunnableFunction(chrome_browser_net::EnsureDnsPrefetchShutdown)); + } #if defined(OS_LINUX) // The IO thread must outlive the BACKGROUND_X11 thread. diff --git a/chrome/browser/views/user_data_dir_dialog.cc b/chrome/browser/views/user_data_dir_dialog.cc index 7c30c85..00aef5f 100644 --- a/chrome/browser/views/user_data_dir_dialog.cc +++ b/chrome/browser/views/user_data_dir_dialog.cc @@ -92,7 +92,6 @@ void UserDataDirDialog::FileSelected(const FilePath& path, int index, void* params) { user_data_dir_ = path.ToWStringHack(); is_blocking_ = false; - window()->Close(); } void UserDataDirDialog::FileSelectionCanceled(void* params) { |