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

Issue 2090003002: MacViews: Explicitly release mouse capture in BridgedNativeWidget::OnWindowWillClose(). (Closed)

Created:
4 years, 6 months ago by karandeepb
Modified:
4 years, 5 months ago
Reviewers:
tapted, sky
CC:
chromium-reviews, tfarina, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MacViews: Explicitly release mouse capture in BridgedNativeWidget::OnWindowWillClose(). Currently, if a BridgedNativeWidget with mouse capture is destroyed, it gets a OnMouseCaptureLost callback from its CocoaMouseCapture member instance. BridgedNativeWidget::OnMouseCaptureLost accesses native_widget_mac_ which has already been destroyed, leading to a use after crash. This CL resolves the crash by explicitly releasing mouse capture in BridgedNativeWidget::OnWindowWillClose(). Also added tests which crash on MacViews for the current master, to test the various codepaths possible when a window is closed. BUG=622201 Committed: https://crrev.com/dc6e0034dc928d3c10ee923284d0f10781975280 Cr-Commit-Position: refs/heads/master@{#402385}

Patch Set 1 #

Total comments: 12

Patch Set 2 : Address review comments. #

Patch Set 3 : Address review comments. #

Total comments: 2

Patch Set 4 : Fix trybots. Don't run tests on Mus. #

Total comments: 13

Patch Set 5 : Address review comments. #

Patch Set 6 : Address review. #

Patch Set 7 : Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+91 lines, -15 lines) Patch
M ui/views/cocoa/bridged_native_widget.mm View 1 2 2 chunks +9 lines, -1 line 0 comments Download
M ui/views/widget/widget_interactive_uitest.cc View 1 2 3 4 5 6 chunks +82 lines, -14 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 30 (16 generated)
karandeepb
PTAL Trent. As for your comment on the bug report about tests that we should ...
4 years, 6 months ago (2016-06-23 00:09:40 UTC) #6
tapted
https://codereview.chromium.org/2090003002/diff/20001/ui/views/cocoa/bridged_native_widget.mm File ui/views/cocoa/bridged_native_widget.mm (right): https://codereview.chromium.org/2090003002/diff/20001/ui/views/cocoa/bridged_native_widget.mm#newcode369 ui/views/cocoa/bridged_native_widget.mm:369: // If we have capture, we'll get a OnMouseCaptureLost ...
4 years, 6 months ago (2016-06-23 02:26:29 UTC) #7
karandeepb
PTAL Trent. Thanks. https://codereview.chromium.org/2090003002/diff/20001/ui/views/cocoa/bridged_native_widget.mm File ui/views/cocoa/bridged_native_widget.mm (right): https://codereview.chromium.org/2090003002/diff/20001/ui/views/cocoa/bridged_native_widget.mm#newcode369 ui/views/cocoa/bridged_native_widget.mm:369: // If we have capture, we'll ...
4 years, 6 months ago (2016-06-23 07:58:32 UTC) #11
karandeepb
Please hold off the review. Seem to have found something.
4 years, 6 months ago (2016-06-23 08:34:02 UTC) #12
karandeepb
PTAL Trent. Thanks. https://codereview.chromium.org/2090003002/diff/20001/ui/views/cocoa/bridged_native_widget.mm File ui/views/cocoa/bridged_native_widget.mm (right): https://codereview.chromium.org/2090003002/diff/20001/ui/views/cocoa/bridged_native_widget.mm#newcode372 ui/views/cocoa/bridged_native_widget.mm:372: ReleaseCapture(); On 2016/06/23 07:58:32, karandeepb wrote: ...
4 years, 6 months ago (2016-06-24 05:34:36 UTC) #14
tapted
lgtm if there are no surprises with the WIDGET_OWNS change https://codereview.chromium.org/2090003002/diff/20001/ui/views/widget/widget_unittest.cc File ui/views/widget/widget_unittest.cc (right): https://codereview.chromium.org/2090003002/diff/20001/ui/views/widget/widget_unittest.cc#newcode1779 ...
4 years, 6 months ago (2016-06-24 07:11:59 UTC) #15
karandeepb
PTAL Trent in case you have any more comments. +sky for ui/views/widget/widget_interactive_uitest.cc review. https://codereview.chromium.org/2090003002/diff/140001/ui/views/widget/widget_interactive_uitest.cc File ...
4 years, 6 months ago (2016-06-24 09:27:28 UTC) #19
tapted
https://codereview.chromium.org/2090003002/diff/140001/ui/views/widget/widget_interactive_uitest.cc File ui/views/widget/widget_interactive_uitest.cc (right): https://codereview.chromium.org/2090003002/diff/140001/ui/views/widget/widget_interactive_uitest.cc#newcode1413 ui/views/widget/widget_interactive_uitest.cc:1413: CaptureLostState capture_state; On 2016/06/24 09:27:28, karandeepb wrote: > On ...
4 years, 6 months ago (2016-06-24 12:14:41 UTC) #20
karandeepb
https://codereview.chromium.org/2090003002/diff/140001/ui/views/widget/widget_interactive_uitest.cc File ui/views/widget/widget_interactive_uitest.cc (right): https://codereview.chromium.org/2090003002/diff/140001/ui/views/widget/widget_interactive_uitest.cc#newcode1413 ui/views/widget/widget_interactive_uitest.cc:1413: CaptureLostState capture_state; On 2016/06/24 12:14:41, tapted wrote: > On ...
4 years, 5 months ago (2016-06-27 02:07:46 UTC) #21
karandeepb
ping sky@ for ui/views/widget/widget_interactive_uitest.cc review.
4 years, 5 months ago (2016-06-27 02:08:18 UTC) #22
sky
LGTM
4 years, 5 months ago (2016-06-27 15:57:03 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2090003002/200001
4 years, 5 months ago (2016-06-28 00:11:58 UTC) #26
commit-bot: I haz the power
Committed patchset #7 (id:200001)
4 years, 5 months ago (2016-06-28 02:49:24 UTC) #28
commit-bot: I haz the power
4 years, 5 months ago (2016-06-28 02:51:52 UTC) #30
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/dc6e0034dc928d3c10ee923284d0f10781975280
Cr-Commit-Position: refs/heads/master@{#402385}

Powered by Google App Engine
This is Rietveld 408576698