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

Issue 2808983002: Migrate to base::FileDescriptionWatcher in dbus/bus.cc. (Closed)

Created:
3 years, 8 months ago by fdoray
Modified:
3 years, 8 months ago
CC:
chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Migrate to base::FileDescriptionWatcher in dbus/bus.cc. Before this CL, dbus::Bus::OnAddWatch called MessageLoopForIO::current()->WatchFileDescriptor(), which is invalid from a non-MessageLoopForIO thread. This caused a crash when dbus::Bus::OnAddWatch was called from a TaskScheduler thread. With this CL, dbus::Bus::OnAddWatch uses base::FileDescriptorWatcher::WatchReadable/Writable instead of MessageLoopForIO::current()->WatchFileDescriptor(). This works from base::Threads that run a MessageLoopForIO and TaskScheduler threads. This CL also instantiates a base::FileDescriptorWatcher in tests that use dbus::Bus::OnAddWatch. This is required to allow usage of base::FileDescriptorWatcher::WatchReadable/Writable on the main thread of a test. BUG=708142 Review-Url: https://codereview.chromium.org/2808983002 Cr-Commit-Position: refs/heads/master@{#465215} Committed: https://chromium.googlesource.com/chromium/src/+/ebc379c0d84a4c0447bcc95317c85ffee5c9025e

Patch Set 1 #

Total comments: 5

Patch Set 2 : CR #

Patch Set 3 : add-FileDescriptorWatcher #

Patch Set 4 : self-review #

Patch Set 5 : self-review #

Total comments: 4

Patch Set 6 : CR-daniel-erat #

Total comments: 4

Patch Set 7 : fix-build-error-check-single-line #

Total comments: 4

Patch Set 8 : CR-satorux1-48-update-comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -42 lines) Patch
M dbus/bus.cc View 1 2 3 4 5 6 7 4 chunks +30 lines, -38 lines 0 comments Download
M dbus/bus_unittest.cc View 1 2 3 4 5 2 chunks +6 lines, -3 lines 0 comments Download
M dbus/object_proxy_unittest.cc View 1 2 3 4 5 3 chunks +8 lines, -1 line 0 comments Download

Messages

Total messages: 60 (34 generated)
fdoray
PTAL
3 years, 8 months ago (2017-04-10 19:28:52 UTC) #3
satorux1
https://codereview.chromium.org/2808983002/diff/1/dbus/bus.cc File dbus/bus.cc (right): https://codereview.chromium.org/2808983002/diff/1/dbus/bus.cc#newcode68 dbus/bus.cc:68: base::Unretained(this))); Is unretained safe here? https://codereview.chromium.org/2808983002/diff/1/dbus/bus.cc#newcode71 dbus/bus.cc:71: read_watcher_ = ...
3 years, 8 months ago (2017-04-11 03:47:22 UTC) #9
Daniel Erat
it's good that the linux bots failed, but i'm surprised that the chrome os tests ...
3 years, 8 months ago (2017-04-11 05:14:15 UTC) #10
fdoray
PTAnL https://codereview.chromium.org/2808983002/diff/1/dbus/bus.cc File dbus/bus.cc (right): https://codereview.chromium.org/2808983002/diff/1/dbus/bus.cc#newcode68 dbus/bus.cc:68: base::Unretained(this))); On 2017/04/11 03:47:21, satorux1 wrote: > Is ...
3 years, 8 months ago (2017-04-11 16:30:36 UTC) #16
Daniel Erat
https://codereview.chromium.org/2808983002/diff/80001/dbus/bus.cc File dbus/bus.cc (right): https://codereview.chromium.org/2808983002/diff/80001/dbus/bus.cc#newcode86 dbus/bus.cc:86: void OnFileCanReadWithoutBlocking() { i think you could simplify this ...
3 years, 8 months ago (2017-04-11 16:36:20 UTC) #20
fdoray
PTAnL https://codereview.chromium.org/2808983002/diff/80001/dbus/bus.cc File dbus/bus.cc (right): https://codereview.chromium.org/2808983002/diff/80001/dbus/bus.cc#newcode86 dbus/bus.cc:86: void OnFileCanReadWithoutBlocking() { On 2017/04/11 16:36:19, Daniel Erat ...
3 years, 8 months ago (2017-04-11 16:52:02 UTC) #23
Daniel Erat
https://codereview.chromium.org/2808983002/diff/100001/dbus/bus.cc File dbus/bus.cc (right): https://codereview.chromium.org/2808983002/diff/100001/dbus/bus.cc#newcode70 dbus/bus.cc:70: base::Bind(&Watch::OnFileCanReadWithoutBlocking, i don't think this compiles; please test changes ...
3 years, 8 months ago (2017-04-11 17:05:54 UTC) #24
satorux1
On 2017/04/11 05:14:15, Daniel Erat wrote: > it's good that the linux bots failed, but ...
3 years, 8 months ago (2017-04-12 00:22:41 UTC) #31
Daniel Erat
lgtm (i didn't notice there was a new version until now. codereview.chromium.org doesn't automatically email ...
3 years, 8 months ago (2017-04-12 00:25:22 UTC) #32
satorux1
On 2017/04/12 00:22:41, satorux1 wrote: > On 2017/04/11 05:14:15, Daniel Erat wrote: > > it's ...
3 years, 8 months ago (2017-04-12 00:27:49 UTC) #33
satorux1
Could you addd TEST= line? fdoray: were you able to reproduce this bug locally and ...
3 years, 8 months ago (2017-04-12 00:31:57 UTC) #34
satorux1
> With this CL, dbus::Bus::OnAddWatch uses > base::FileDescriptorWatcher, which works from > MessageLoopForIO and TaskScheduler ...
3 years, 8 months ago (2017-04-12 01:02:30 UTC) #35
satorux1
On 2017/04/12 01:02:30, satorux1 wrote: > > With this CL, dbus::Bus::OnAddWatch uses > > base::FileDescriptorWatcher, ...
3 years, 8 months ago (2017-04-12 01:32:56 UTC) #36
fdoray
On 2017/04/12 00:25:22, Daniel Erat wrote: > lgtm > > (i didn't notice there was ...
3 years, 8 months ago (2017-04-12 12:32:00 UTC) #37
fdoray
https://codereview.chromium.org/2808983002/diff/100001/dbus/bus.cc File dbus/bus.cc (right): https://codereview.chromium.org/2808983002/diff/100001/dbus/bus.cc#newcode70 dbus/bus.cc:70: base::Bind(&Watch::OnFileCanReadWithoutBlocking, On 2017/04/11 17:05:54, Daniel Erat wrote: > i ...
3 years, 8 months ago (2017-04-12 12:32:10 UTC) #38
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/2808983002/120001
3 years, 8 months ago (2017-04-12 12:32:32 UTC) #40
fdoray
https://codereview.chromium.org/2808983002/diff/120001/dbus/bus.cc File dbus/bus.cc (right): https://codereview.chromium.org/2808983002/diff/120001/dbus/bus.cc#newcode68 dbus/bus.cc:68: read_watcher_ = base::FileDescriptorWatcher::WatchReadable( On 2017/04/12 01:02:30, satorux1 wrote: > ...
3 years, 8 months ago (2017-04-12 12:39:48 UTC) #41
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/409128)
3 years, 8 months ago (2017-04-12 12:40:31 UTC) #43
satorux1
On 2017/04/12 12:39:48, fdoray wrote: > https://codereview.chromium.org/2808983002/diff/120001/dbus/bus.cc > File dbus/bus.cc (right): > > https://codereview.chromium.org/2808983002/diff/120001/dbus/bus.cc#newcode68 > ...
3 years, 8 months ago (2017-04-12 13:07:30 UTC) #44
fdoray
On 2017/04/12 13:07:30, satorux1 wrote: > On 2017/04/12 12:39:48, fdoray wrote: > > https://codereview.chromium.org/2808983002/diff/120001/dbus/bus.cc > ...
3 years, 8 months ago (2017-04-13 12:53:35 UTC) #47
satorux1
lgtm with a nit: https://codereview.chromium.org/2808983002/diff/120001/dbus/bus.cc File dbus/bus.cc (right): https://codereview.chromium.org/2808983002/diff/120001/dbus/bus.cc#newcode1050 dbus/bus.cc:1050: // message_pump_libevent.h. update this comment?
3 years, 8 months ago (2017-04-14 01:25:33 UTC) #48
satorux1
nit: illegal-> invalid in the patch description in favor of not using legal terms? :)
3 years, 8 months ago (2017-04-14 01:26:48 UTC) #49
hashimoto
lgtm
3 years, 8 months ago (2017-04-14 04:34:36 UTC) #50
fdoray
On 2017/04/14 01:26:48, satorux1 wrote: > nit: illegal-> invalid in the patch description in favor ...
3 years, 8 months ago (2017-04-18 12:43:16 UTC) #52
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/2808983002/140001
3 years, 8 months ago (2017-04-18 12:44:11 UTC) #57
commit-bot: I haz the power
3 years, 8 months ago (2017-04-18 13:40:37 UTC) #60
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://chromium.googlesource.com/chromium/src/+/ebc379c0d84a4c0447bcc95317c8...

Powered by Google App Engine
This is Rietveld 408576698