Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Issue 13699002: add HideAndClose in preference to having Close sometimes magically defer (Closed)

Created:
7 years, 8 months ago by scottmg
Modified:
7 years, 8 months ago
Reviewers:
sky
CC:
chromium-reviews, alicet1, tfarina, James Su, msw+watch_chromium.org, ben+watch_chromium.org
Visibility:
Public.

Description

add HideAndClose in preference to having Close sometimes magically defer DCHECK in linked bug was caused by Widget::CloseAllSecondaryWidgets() calling Close() but the Close getting deferred due to being an animated hide, which caused the eventual WM_NCDESTROY to be delayed, which led to cleaning up GPU resources too late. So, instead of magically converting closes into hide-and-then-close, add a new method that explicitly does that, so that the previous behaviour of Close() is preserved. And, update a couple obvious places where the HideAndClose is desirable. There will probably be more places where it will need to be adjusted but not changing them is a minor cosmetic problem, rather than a somewhat complicated lifetime change. R=sky@chromium.org BUG=226716

Patch Set 1 #

Patch Set 2 : non aura #

Unified diffs Side-by-side diffs Delta from patch set Stats (+47 lines, -19 lines) Patch
M chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/bubble/bubble_delegate.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/widget/desktop_aura/desktop_native_widget_aura.h View 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_native_widget_aura.cc View 1 1 chunk +7 lines, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_root_window_host.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_root_window_host_win.h View 1 2 chunks +1 line, -5 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_root_window_host_win.cc View 1 3 chunks +11 lines, -12 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_root_window_host_x11.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc View 1 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/widget/native_widget_aura.h View 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/native_widget_aura.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/widget/native_widget_private.h View 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/native_widget_win.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/native_widget_win.cc View 1 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/widget/widget.h View 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/widget/widget.cc View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
scottmg
7 years, 8 months ago (2013-04-05 15:57:22 UTC) #1
sky
This would make Widget::Close() behave differently on chromeos and win/linux-aura. It would also means folks ...
7 years, 8 months ago (2013-04-05 16:20:32 UTC) #2
scottmg
On 2013/04/05 16:20:32, sky wrote: > This would make Widget::Close() behave differently on chromeos and ...
7 years, 8 months ago (2013-04-05 19:21:01 UTC) #3
sky
Presumably when we hit this we're about to shutdown. I suggest CloseNow and if that ...
7 years, 8 months ago (2013-04-05 19:57:51 UTC) #4
scottmg
7 years, 8 months ago (2013-04-05 19:58:44 UTC) #5
OK, thanks. I'll close this CL then and post another that does that.

On Fri, Apr 5, 2013 at 12:57 PM, Scott Violet <sky@chromium.org> wrote:
> Presumably when we hit this we're about to shutdown. I suggest CloseNow and
> if that doesn't work then a CloseDontAnimate that is only invoked from
> views::Widget::CloseAllSecondaryWidgets.
>
>
> On Fri, Apr 5, 2013 at 12:21 PM, <scottmg@chromium.org> wrote:
>>
>> On 2013/04/05 16:20:32, sky wrote:
>>>
>>> This would make Widget::Close() behave differently on chromeos and
>>> win/linux-aura. It would also means folks have to know ahead of time
>>> whether
>>> they might want a hide animation or not.
>>
>>
>>> Seems like the core issue is that we may shut down while an animation is
>>> happening. I don't see how this fixes that. Should we instead be tracking
>>> list
>>> of open HWNDs that are animating and destroy them if we hit shutdown?
>>
>>
>> Enumerating all windows and closing is basically what's already happening
>> during
>> shutdown here:
>>
>>
>>
https://code.google.com/p/chromium/codesearch#chromium/src/ui/views/widget/na...
>>
>> called from
>>
>>
>>
https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/lif...
>>
>> But that calls Close() which doesn't work because that instead triggers
>> the
>> animation start. Maybe Close() should be able to tell that shutdown is in
>> progress? (CloseNow looks like it would miss some important shutdown
>> behaviour)
>>
>> https://codereview.chromium.org/13699002/
>
>

Powered by Google App Engine
This is Rietveld 408576698