diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-02 16:22:02 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-02 16:22:02 +0000 |
commit | 9b9fe99f079f53eb1276afab14886af7e46b0288 (patch) | |
tree | d269f7ec3ada339ce784e44b2e11cc26e74d08b4 /chrome | |
parent | 185ef60458a4b929eea8f724b67317733e408998 (diff) | |
download | chromium_src-9b9fe99f079f53eb1276afab14886af7e46b0288.zip chromium_src-9b9fe99f079f53eb1276afab14886af7e46b0288.tar.gz chromium_src-9b9fe99f079f53eb1276afab14886af7e46b0288.tar.bz2 |
* Spin a modal loop so that messages that cause Chrome UI to be shown don't come through, this fixes a crash in the first run import dialog.
* Fail early if NSSDecryptor detects that the environment isn't set up write to load NSS libraries.
BUG=19169
TEST=See repro instructions in bug.
Review URL: http://codereview.chromium.org/179073
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25174 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/cocoa/import_progress_dialog.mm | 15 | ||||
-rw-r--r-- | chrome/browser/importer/nss_decryptor_mac.mm | 4 |
2 files changed, 17 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/import_progress_dialog.mm b/chrome/browser/cocoa/import_progress_dialog.mm index 86cd872..a971f80 100644 --- a/chrome/browser/cocoa/import_progress_dialog.mm +++ b/chrome/browser/cocoa/import_progress_dialog.mm @@ -138,7 +138,8 @@ NSString* keyForImportItem(ImportItem item) { [self closeDialog]; [self release]; - MessageLoop::current()->Quit(); + // Break out of modal event loop. + [NSApp stopModal]; } @end @@ -171,6 +172,16 @@ void StartImportingWithUI(gfx::NativeWindow parent_window, new ProfileWriter(target_profile), first_run); + + // Display the window while spinning a message loop. + // For details on why we need a modal message loop see http://crbug.com/19169 + NSWindow* progress_window = [progress_dialog_ window]; + NSModalSession session = [NSApp beginModalSessionForWindow:progress_window]; [progress_dialog_ showWindow:nil]; - MessageLoop::current()->Run(); + while(1) { + if ([NSApp runModalSession:session] != NSRunContinuesResponse) + break; + MessageLoop::current()->RunAllPending(); + } + [NSApp endModalSession:session]; } diff --git a/chrome/browser/importer/nss_decryptor_mac.mm b/chrome/browser/importer/nss_decryptor_mac.mm index dc6dd0d..e319c74 100644 --- a/chrome/browser/importer/nss_decryptor_mac.mm +++ b/chrome/browser/importer/nss_decryptor_mac.mm @@ -24,6 +24,10 @@ const wchar_t NSSDecryptor::kNSS3Library[] = L"libnss3.dylib"; // DYLD_FALLBACK_LIBRARY_PATH set on startup to said directory. bool NSSDecryptor::Init(const std::wstring& dll_path, const std::wstring& db_path) { + if (getenv("DYLD_FALLBACK_LIBRARY_PATH") == NULL) { + LOG(ERROR) << "DYLD_FALLBACK_LIBRARY_PATH variable not set"; + return false; + } FilePath dylib_file_path = FilePath::FromWStringHack(dll_path); FilePath nss3_path = dylib_file_path.Append("libnss3.dylib"); |