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

Issue 289043010: Makes MessagePumpGlib thread DCHECK work when pump is destroyed (Closed)

Created:
6 years, 7 months ago by sky
Modified:
6 years, 7 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org, sadrul
Visibility:
Public.

Description

Makes MessagePumpGlib thread DCHECK work when pump is destroyed For tests I'm creating a MessagePumpGlib on a thread, destroying it, then creating another MessagePumpGlib on another thread. The DCHECK fires in this case because it only remembers the first thread. I made it so the thread id is cleared when the MessagePumpGlib is destroyed. BUG=none TEST=none R=sadrul@chromium.org TBR=darin@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=272727

Patch Set 1 #

Patch Set 2 : lock #

Patch Set 3 : cleanup #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -6 lines) Patch
M base/message_loop/message_pump_glib.cc View 1 2 4 chunks +49 lines, -6 lines 4 comments Download

Messages

Total messages: 11 (0 generated)
sky
6 years, 7 months ago (2014-05-23 19:50:03 UTC) #1
sadrul
LGTM +piman@, in case https://codereview.chromium.org/299143002/ may conflict with this. https://codereview.chromium.org/289043010/diff/30001/base/message_loop/message_pump_glib.cc File base/message_loop/message_pump_glib.cc (right): https://codereview.chromium.org/289043010/diff/30001/base/message_loop/message_pump_glib.cc#newcode157 base/message_loop/message_pump_glib.cc:157: ...
6 years, 7 months ago (2014-05-23 21:29:57 UTC) #2
piman
On 2014/05/23 21:29:57, sadrul wrote: > LGTM > > +piman@, in case https://codereview.chromium.org/299143002/ may conflict ...
6 years, 7 months ago (2014-05-23 21:45:12 UTC) #3
sky
https://codereview.chromium.org/289043010/diff/30001/base/message_loop/message_pump_glib.cc File base/message_loop/message_pump_glib.cc (right): https://codereview.chromium.org/289043010/diff/30001/base/message_loop/message_pump_glib.cc#newcode157 base/message_loop/message_pump_glib.cc:157: if (thread_info && thread_info->pump == pump) { On 2014/05/23 ...
6 years, 7 months ago (2014-05-23 21:54:37 UTC) #4
sky
The CQ bit was checked by sky@chromium.org
6 years, 7 months ago (2014-05-23 21:54:40 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sky@chromium.org/289043010/30001
6 years, 7 months ago (2014-05-23 21:56:40 UTC) #6
sky
Darin, I'm TBRing you as this is a focused change just for debugging.
6 years, 7 months ago (2014-05-23 22:03:06 UTC) #7
darin (slow to review)
https://codereview.chromium.org/289043010/diff/30001/base/message_loop/message_pump_glib.cc File base/message_loop/message_pump_glib.cc (right): https://codereview.chromium.org/289043010/diff/30001/base/message_loop/message_pump_glib.cc#newcode157 base/message_loop/message_pump_glib.cc:157: if (thread_info && thread_info->pump == pump) { On 2014/05/23 ...
6 years, 7 months ago (2014-05-23 23:25:13 UTC) #8
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-24 01:42:32 UTC) #9
commit-bot: I haz the power
Change committed as 272727
6 years, 7 months ago (2014-05-24 12:55:42 UTC) #10
sky
6 years, 7 months ago (2014-05-27 15:57:27 UTC) #11
Message was sent while issue was closed.
https://codereview.chromium.org/289043010/diff/30001/base/message_loop/messag...
File base/message_loop/message_pump_glib.cc (right):

https://codereview.chromium.org/289043010/diff/30001/base/message_loop/messag...
base/message_loop/message_pump_glib.cc:157: if (thread_info && thread_info->pump
== pump) {
On 2014/05/23 23:25:13, darin wrote:
> On 2014/05/23 21:54:37, sky wrote:
> > On 2014/05/23 21:29:58, sadrul wrote:
> > > Shouldn't thread_info->pump be always be == pump?
> > 
> > I believe so, but I wanted to make sure if that isn't the case things don't
go
> > bad.
> 
> You might consider a CHECK here.
> 
> Did you consider just going through MessageLoop::current() to find the current
> thread's MessagePump?

This is all to verify we don't start MessagePumpGlib twice. So, we shouldn't
really need a thread lookup.

Powered by Google App Engine
This is Rietveld 408576698