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

Issue 2639043002: Fix double-close in EventConverterEvdevImpl (Closed)

Created:
3 years, 11 months ago by spang
Modified:
3 years, 11 months ago
CC:
chromium-reviews, kalyank, ozone-reviews_chromium.org, tdresser+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix double-close in EventConverterEvdevImpl This fixes a double close that occurs when a keyboard or mouse is unplugged from the system, which will cause breakage if there is a concurrent open(). It also switches to a scoped file descriptor wrapper, with a special close function because close() can return ENODEV on an input device that was unplugged. BUG=681865, 660960 TEST=events_unittests Review-Url: https://codereview.chromium.org/2639043002 Cr-Commit-Position: refs/heads/master@{#444544} Committed: https://chromium.googlesource.com/chromium/src/+/13ad1ff07b21ed9f4b7b5cb7c7cebdff0b8fe0c1

Patch Set 1 #

Total comments: 2

Patch Set 2 : remove base::debug::Alias #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+134 lines, -69 lines) Patch
M ui/events/ozone/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
M ui/events/ozone/evdev/event_converter_evdev.cc View 1 chunk +0 lines, -2 lines 0 comments Download
M ui/events/ozone/evdev/event_converter_evdev_impl.h View 3 chunks +5 lines, -1 line 0 comments Download
M ui/events/ozone/evdev/event_converter_evdev_impl.cc View 2 chunks +5 lines, -5 lines 0 comments Download
M ui/events/ozone/evdev/event_converter_evdev_impl_unittest.cc View 5 chunks +9 lines, -10 lines 0 comments Download
M ui/events/ozone/evdev/input_device_factory_evdev.cc View 5 chunks +16 lines, -14 lines 0 comments Download
M ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.h View 2 chunks +2 lines, -1 line 0 comments Download
M ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.cc View 3 chunks +3 lines, -4 lines 2 comments Download
A ui/events/ozone/evdev/scoped_input_device.h View 1 chunk +25 lines, -0 lines 0 comments Download
A ui/events/ozone/evdev/scoped_input_device.cc View 1 1 chunk +31 lines, -0 lines 2 comments Download
M ui/events/ozone/evdev/tablet_event_converter_evdev.h View 3 chunks +5 lines, -1 line 0 comments Download
M ui/events/ozone/evdev/tablet_event_converter_evdev.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc View 5 chunks +13 lines, -14 lines 0 comments Download
M ui/events/ozone/evdev/touch_event_converter_evdev.h View 3 chunks +5 lines, -1 line 0 comments Download
M ui/events/ozone/evdev/touch_event_converter_evdev.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc View 5 chunks +7 lines, -12 lines 0 comments Download

Messages

Total messages: 32 (13 generated)
spang
I am not really sure about forking ScopedFD, but it's clear that the current implementation ...
3 years, 11 months ago (2017-01-17 20:28:47 UTC) #2
spang
3 years, 11 months ago (2017-01-17 20:32:49 UTC) #3
spang
Hm, I suppose we should really just fix ScopedFD. It seems like it would fix ...
3 years, 11 months ago (2017-01-17 20:39:53 UTC) #4
davidben
On 2017/01/17 20:39:53, spang wrote: > Hm, I suppose we should really just fix ScopedFD. ...
3 years, 11 months ago (2017-01-17 20:44:26 UTC) #5
davidben
On 2017/01/17 20:44:26, davidben wrote: > On 2017/01/17 20:39:53, spang wrote: > > Hm, I ...
3 years, 11 months ago (2017-01-17 20:54:23 UTC) #6
spang
On 2017/01/17 20:44:26, davidben wrote: > On 2017/01/17 20:39:53, spang wrote: > > Hm, I ...
3 years, 11 months ago (2017-01-17 21:17:37 UTC) #7
davidben
On 2017/01/17 21:17:37, spang wrote: > On 2017/01/17 20:44:26, davidben wrote: > > On 2017/01/17 ...
3 years, 11 months ago (2017-01-17 21:23:34 UTC) #8
spang
On 2017/01/17 21:23:34, davidben wrote: > On 2017/01/17 21:17:37, spang wrote: > > On 2017/01/17 ...
3 years, 11 months ago (2017-01-17 22:05:27 UTC) #9
davidben
lgtm modulo the ScopedFD vs ScopedInputDevice question which is getting resolved in the other CL. ...
3 years, 11 months ago (2017-01-18 19:48:10 UTC) #10
spang
https://codereview.chromium.org/2639043002/diff/1/ui/events/ozone/evdev/scoped_input_device.cc File ui/events/ozone/evdev/scoped_input_device.cc (right): https://codereview.chromium.org/2639043002/diff/1/ui/events/ozone/evdev/scoped_input_device.cc#newcode32 ui/events/ozone/evdev/scoped_input_device.cc:32: base::debug::Alias(&close_errno); On 2017/01/18 19:48:10, davidben wrote: > (Same comment ...
3 years, 11 months ago (2017-01-18 20:40:35 UTC) #11
kpschoedel
LGTM https://codereview.chromium.org/2639043002/diff/20001/ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.cc File ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.cc (right): https://codereview.chromium.org/2639043002/diff/20001/ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.cc#newcode56 ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.cc:56: evdev_.fd = fd.release(); evdev_ owns the fd now, ...
3 years, 11 months ago (2017-01-18 21:31:07 UTC) #17
xiyuan
lgtm A plus would be use ScopedFD when the other CL is approved. Thank you ...
3 years, 11 months ago (2017-01-18 21:42:39 UTC) #18
spang
https://codereview.chromium.org/2639043002/diff/20001/ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.cc File ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.cc (right): https://codereview.chromium.org/2639043002/diff/20001/ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.cc#newcode56 ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.cc:56: evdev_.fd = fd.release(); On 2017/01/18 21:31:07, kpschoedel wrote: > ...
3 years, 11 months ago (2017-01-18 22:05:37 UTC) #19
spang
3 years, 11 months ago (2017-01-18 22:05:40 UTC) #20
spang
3 years, 11 months ago (2017-01-18 22:05:42 UTC) #21
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/2639043002/20001
3 years, 11 months ago (2017-01-18 23:30:25 UTC) #26
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/chromium/src/+/13ad1ff07b21ed9f4b7b5cb7c7cebdff0b8fe0c1
3 years, 11 months ago (2017-01-18 23:36:59 UTC) #29
satorux1
https://codereview.chromium.org/2639043002/diff/20001/ui/events/ozone/evdev/scoped_input_device.cc File ui/events/ozone/evdev/scoped_input_device.cc (right): https://codereview.chromium.org/2639043002/diff/20001/ui/events/ozone/evdev/scoped_input_device.cc#newcode27 ui/events/ozone/evdev/scoped_input_device.cc:27: PCHECK(0 == ret || errno != EBADF); dribe-by: maybe ...
3 years, 11 months ago (2017-01-20 02:06:32 UTC) #31
satorux1
3 years, 11 months ago (2017-01-20 02:10:36 UTC) #32
Message was sent while issue was closed.
https://codereview.chromium.org/2639043002/diff/20001/ui/events/ozone/evdev/s...
File ui/events/ozone/evdev/scoped_input_device.cc (right):

https://codereview.chromium.org/2639043002/diff/20001/ui/events/ozone/evdev/s...
ui/events/ozone/evdev/scoped_input_device.cc:27: PCHECK(0 == ret || errno !=
EBADF);
On 2017/01/20 02:06:32, satorux1 wrote:
> dribe-by: maybe add a comment explaining why EBADF is allowed?

my bad. errors other than EBADF are allowed.

Powered by Google App Engine
This is Rietveld 408576698