[go: nahoru, domu]

Mac: If a modal window is detected, do not pump private message loop modes.

It's possible for [NSApp modalWindow] to be set under some rare
circumstances when pumping regular tasks. This was unexpected, so if
a menu is shown in these cases, Chrome currently CHECK()s.

Instead, detect this, and run the menu in a "safe" mode, without pumping
regular tasks in the private runloop modes used for menu animations. Crash
stacks suggest that one possibility may be that a background thread is
showing an NSAlert and setting the global [NSApp modalWindow]. This is fine
but it confuses the CHECK().

Bug: 775738
Change-Id: I6a60f77f3c6c229c4809a4718d128ad2c59c7309
Reviewed-on: https://chromium-review.googlesource.com/724759
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510350}
4 files changed