New issue
Advanced search Search tips

Issue 722845 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Oct 12
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Mac first run can't be cancelled

Project Member Reported by ellyjo...@chromium.org, May 16 2017

Issue description

The first run dialog on Mac has no cancel button, and the Quit menu item is disabled. The reasons for this are subtle:

The code currently creates a nested RunLoop to invoke [NSApp runModalForWindow:], because of  Issue 54248 . That issue seems like it might be obsolete right now; if I remove the nested RunLoop construction and the matching MessageLoop::QuitNow(), everything still seems to work alright, including quitting the browser. The problem originally mentioned in 54248 (needing the message loop to show search engines) *might* be obsolete now, or else the original problem with MessageLoop::Run() breaking [NSApp runModalForWindow:] may have vanished.

I experimented with adding a cancel button to the First Run dialog, which would have the semantics of "re-do the first run experience at next launch". There are two issues:

1) The "first run happened" sentinel is already created by this point, so exiting the browser in any way doesn't cause the FRE to re-run. We might be able to move the sentinel creation later in ChromeBrowserMainParts::PreMainMessageLoopRunImpl() to deal with that. I need to check if that is safe to do.

2) It doesn't seem possible to cleanly exit the browser from inside PreMainMessageRunLoopImpl. Generally what happens is one of:

a) The browser exits immediately if we call exit(0) or another immediate-death function
b) The browser starts exiting, but posted tasks from PreMainMessageRunLoopImpl run before the exit task does, and they explode because they are not happy with being run while the browser is shutting down. This happens if we call [NSApp terminate:].
c) The browser does not exit, and later attempts to exit it do nothing, possibly because the browser already thinks it is exiting. This happens if we call chrome::AttemptExit(), g_browser_process->EndSession(), or any of the other likely-seeming "orderly exit" functions.

Case (a) works, but it seems extremely dangerous to unceremoniously exit like this when other tasks may be in flight. Case (b) causes an immediate crash. Case (c) breaks exiting the browser. :(

Future investigation:
* Is case (a) actually dangerous?
* For case (b), there is a comment in PreMainMessageRunLoopImpl like this:

  // TODO(stevenjb): Move WIN and MACOSX specific code to appropriate Parts.
  // (requires supporting early exit).

This suggests that early exit from inside PreMainMessageRunLoopImpl is not supported. How hard would it be to support it? If we could support that, the first run dialog code could return a status to indicate that the caller should early-exit the browser.
* For case (c), why does the browser not exit immediately or afterward?
* Did the problem mentioned in  Issue 54248  actually vanish?
 

Comment 1 by a...@chromium.org, May 17 2017

As discussed yesterday at Coffee Break, this was breaking with JavaScript alerts, the old type. Make sure to test those, with --disable-features=AutoDismissingDialogs .
Owner: ----
Status: Available (was: Assigned)
Project Member

Comment 3 by sheriffbot@chromium.org, Oct 12

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: WontFix (was: Untriaged)
We discussed this and ultimately decided that we want to rebuild the FRE as Views, but we have no allotted engineer time for that to happen right now. I'm going to mark this bug in the Cocoa FRE WontFix, since it's very difficult to address with how the FRE is structured right now.

Sign in to add a comment