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

Issue 15709015: Make sure that the UI window created by base::MessagePumpForUI is destoyed on the same thread (Wind… (Closed)

Created:
7 years, 6 months ago by alexeypa (please no reviews)
Modified:
7 years, 6 months ago
CC:
chromium-reviews, glider+watch_chromium.org, erikwright+watch_chromium.org, sadrul, timurrrr+watch_chromium.org, bruening+watch_chromium.org, darin (slow to review), cpu_(ooo_6.6-7.5)
Visibility:
Public.

Description

Make sure that the UI window created by base::MessagePumpForUI is destoyed on the same thread (Windows). Currently the window created base::MessagePumpForUI can be destroyed on a wrong thread. base::MessagePumpForUI is a ref-counted class so it can (and does) outlive the owning base::MessageLoop. As the result DestroyWindow() can be called on a wrong thread. This makes TSAN unhappy and it reports races deep unside user32.dll. Changes in this CL: - The message pump is now notified when the owning message loop is being destroyed. The notification is used to free all resources that hve to be released on the base::MessageLoop's thread. - MessagePumpForUI::ScheduleWork() synchronizes access to the message-only window handle to avoid posting messages to the window during or after its destruction. BUG=241939 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=207278

Patch Set 1 #

Total comments: 12

Patch Set 2 : rebased #

Total comments: 4

Patch Set 3 : CR feedback. #

Patch Set 4 : The lock is back. #

Patch Set 5 : oops #

Total comments: 6

Patch Set 6 : CR feedback. #

Total comments: 4

Patch Set 7 : CR feedback. #

Patch Set 8 : rebased #

Total comments: 2

Patch Set 9 : Updated comments. #

Patch Set 10 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -44 lines) Patch
M base/message_loop/message_loop.cc View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M base/message_loop/message_pump.h View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download
M base/message_loop/message_pump_android.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M base/message_loop/message_pump_android.cc View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M base/message_loop/message_pump_default.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M base/message_loop/message_pump_default.cc View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M base/message_loop/message_pump_glib.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M base/message_loop/message_pump_glib.cc View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M base/message_loop/message_pump_libevent.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M base/message_loop/message_pump_libevent.cc View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M base/message_loop/message_pump_mac.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M base/message_loop/message_pump_mac.mm View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M base/message_loop/message_pump_win.h View 1 2 3 4 5 6 7 8 9 5 chunks +10 lines, -4 lines 0 comments Download
M base/message_loop/message_pump_win.cc View 1 2 3 4 5 6 7 8 9 5 chunks +46 lines, -9 lines 0 comments Download
M tools/valgrind/tsan/suppressions.txt View 1 chunk +0 lines, -31 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
alexeypa (please no reviews)
Ricardo, I'm splitting https://codereview.chromium.org/16020005/ into pieces so that it could get thought the review. This ...
7 years, 6 months ago (2013-06-10 23:51:34 UTC) #1
rvargas (doing something else)
https://codereview.chromium.org/15709015/diff/1/base/message_pump.h File base/message_pump.h (right): https://codereview.chromium.org/15709015/diff/1/base/message_pump.h#newcode122 base/message_pump.h:122: // Called directly by MessageLoop::~MessageLoop to clean up resources ...
7 years, 6 months ago (2013-06-12 00:22:22 UTC) #2
alexeypa (please no reviews)
https://codereview.chromium.org/15709015/diff/1/base/message_pump.h File base/message_pump.h (right): https://codereview.chromium.org/15709015/diff/1/base/message_pump.h#newcode122 base/message_pump.h:122: // Called directly by MessageLoop::~MessageLoop to clean up resources ...
7 years, 6 months ago (2013-06-12 18:05:22 UTC) #3
rvargas (doing something else)
https://codereview.chromium.org/15709015/diff/3001/base/message_pump_win.cc File base/message_pump_win.cc (right): https://codereview.chromium.org/15709015/diff/3001/base/message_pump_win.cc#newcode217 base/message_pump_win.cc:217: while (InterlockedCompareExchange(&pump_state_, kPumpDisabled, On 2013/06/12 18:05:22, alexeypa wrote: > ...
7 years, 6 months ago (2013-06-12 18:24:24 UTC) #4
alexeypa (please no reviews)
https://codereview.chromium.org/15709015/diff/3001/base/message_pump_win.cc File base/message_pump_win.cc (right): https://codereview.chromium.org/15709015/diff/3001/base/message_pump_win.cc#newcode217 base/message_pump_win.cc:217: while (InterlockedCompareExchange(&pump_state_, kPumpDisabled, On 2013/06/12 18:24:24, rvargas wrote: > ...
7 years, 6 months ago (2013-06-12 18:57:25 UTC) #5
rvargas (doing something else)
LGTM after the nits. https://codereview.chromium.org/15709015/diff/22001/base/message_pump.h File base/message_pump.h (right): https://codereview.chromium.org/15709015/diff/22001/base/message_pump.h#newcode123 base/message_pump.h:123: // that called Run(). This ...
7 years, 6 months ago (2013-06-12 23:03:22 UTC) #6
alexeypa (please no reviews)
https://chromiumcodereview.appspot.com/15709015/diff/22001/base/message_pump.h File base/message_pump.h (right): https://chromiumcodereview.appspot.com/15709015/diff/22001/base/message_pump.h#newcode123 base/message_pump.h:123: // that called Run(). This is the last method ...
7 years, 6 months ago (2013-06-13 00:13:39 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/alexeypa@chromium.org/15709015/31001
7 years, 6 months ago (2013-06-13 00:13:58 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/alexeypa@chromium.org/15709015/31001
7 years, 6 months ago (2013-06-13 02:28:25 UTC) #9
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=8851
7 years, 6 months ago (2013-06-13 07:08:15 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/alexeypa@chromium.org/15709015/31001
7 years, 6 months ago (2013-06-13 13:32:21 UTC) #11
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=8912
7 years, 6 months ago (2013-06-13 13:40:48 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/alexeypa@chromium.org/15709015/31001
7 years, 6 months ago (2013-06-14 04:11:31 UTC) #13
commit-bot: I haz the power
Failed to apply patch for base/message_loop.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; can't find ...
7 years, 6 months ago (2013-06-14 04:11:36 UTC) #14
alexeypa (please no reviews)
Adding darin@ for OWNERS approval.
7 years, 6 months ago (2013-06-14 15:02:06 UTC) #15
alexeypa (please no reviews)
Darin, ping.
7 years, 6 months ago (2013-06-17 18:10:35 UTC) #16
alexeypa (please no reviews)
Darin, ping^2.
7 years, 6 months ago (2013-06-18 18:19:32 UTC) #17
darin (slow to review)
LGTM w/ the following changes: https://chromiumcodereview.appspot.com/15709015/diff/31001/base/message_pump.h File base/message_pump.h (right): https://chromiumcodereview.appspot.com/15709015/diff/31001/base/message_pump.h#newcode125 base/message_pump.h:125: virtual void Stop() = ...
7 years, 6 months ago (2013-06-18 18:28:41 UTC) #18
alexeypa (please no reviews)
FYI https://chromiumcodereview.appspot.com/15709015/diff/31001/base/message_pump.h File base/message_pump.h (right): https://chromiumcodereview.appspot.com/15709015/diff/31001/base/message_pump.h#newcode125 base/message_pump.h:125: virtual void Stop() = 0; On 2013/06/18 18:28:42, ...
7 years, 6 months ago (2013-06-18 19:44:23 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/alexeypa@chromium.org/15709015/68001
7 years, 6 months ago (2013-06-18 19:47:42 UTC) #20
darin (slow to review)
https://chromiumcodereview.appspot.com/15709015/diff/68001/base/message_pump.h File base/message_pump.h (right): https://chromiumcodereview.appspot.com/15709015/diff/68001/base/message_pump.h#newcode128 base/message_pump.h:128: // does) run on arbitraty thread. nit: s/arbitraty/arbitrary/ This ...
7 years, 6 months ago (2013-06-18 20:31:15 UTC) #21
alexeypa (please no reviews)
https://chromiumcodereview.appspot.com/15709015/diff/68001/base/message_pump.h File base/message_pump.h (right): https://chromiumcodereview.appspot.com/15709015/diff/68001/base/message_pump.h#newcode128 base/message_pump.h:128: // does) run on arbitraty thread. On 2013/06/18 20:31:16, ...
7 years, 6 months ago (2013-06-18 20:48:52 UTC) #22
darin (slow to review)
LGTM
7 years, 6 months ago (2013-06-18 20:51:42 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/alexeypa@chromium.org/15709015/83001
7 years, 6 months ago (2013-06-18 21:01:31 UTC) #24
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) chrome_frame_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=165583
7 years, 6 months ago (2013-06-19 06:57:20 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/alexeypa@chromium.org/15709015/83001
7 years, 6 months ago (2013-06-19 13:53:36 UTC) #26
commit-bot: I haz the power
7 years, 6 months ago (2013-06-20 02:38:14 UTC) #27
Message was sent while issue was closed.
Change committed as 207278

Powered by Google App Engine
This is Rietveld 408576698