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

Issue 2115453002: Use PostTask, not performSelector in NativeWidgetMac::Close() (Closed)

Created:
4 years, 5 months ago by tapted
Modified:
4 years, 5 months ago
Reviewers:
Robert Sesek
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

Use PostTask, not performSelector in NativeWidgetMac::Close() In rare circumstances (more often with ASAN), a call to [window performSelector:@selector(close) withObject:nil afterDelay:0]; doesn't get run when ViewsTestBase::TearDown() does base::RunLoop run_loop; run_loop.RunUntilIdle(); ViewsTestBase then destroys other stuff. And, when the posted selector eventually gets executed, bad stuff happens. To fix, post a "regular" task, invoking -[NSWindow close]. Use a block to retain the window receiving the close. BUG=624648 Committed: https://crrev.com/961644ad65fe2d43190d79e99f8b00a661026f6f Cr-Commit-Position: refs/heads/master@{#403400}

Patch Set 1 #

Total comments: 2

Patch Set 2 : no parens #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -1 line) Patch
M ui/views/widget/native_widget_mac.mm View 1 2 chunks +9 lines, -1 line 0 comments Download

Messages

Total messages: 14 (8 generated)
tapted
Hi Robert, please take a look
4 years, 5 months ago (2016-06-30 07:06:15 UTC) #5
Robert Sesek
LGTM The main reason we use the -performSelector:… approach is that a posted task can ...
4 years, 5 months ago (2016-07-01 02:31:38 UTC) #6
tapted
Thanks Robert! https://codereview.chromium.org/2115453002/diff/1/ui/views/widget/native_widget_mac.mm File ui/views/widget/native_widget_mac.mm (right): https://codereview.chromium.org/2115453002/diff/1/ui/views/widget/native_widget_mac.mm#newcode376 ui/views/widget/native_widget_mac.mm:376: base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, base::BindBlock(^() { On 2016/07/01 02:31:38, Robert ...
4 years, 5 months ago (2016-07-01 03:31:53 UTC) #7
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/2115453002/20001
4 years, 5 months ago (2016-07-01 03:32:17 UTC) #10
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 5 months ago (2016-07-01 03:39:52 UTC) #12
commit-bot: I haz the power
4 years, 5 months ago (2016-07-01 03:42:21 UTC) #14
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/961644ad65fe2d43190d79e99f8b00a661026f6f
Cr-Commit-Position: refs/heads/master@{#403400}

Powered by Google App Engine
This is Rietveld 408576698