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

Issue 2368423002: Make WaitableEventWatcher TaskScheduler-friendly. (Closed)

Created:
4 years, 2 months ago by fdoray
Modified:
4 years, 2 months ago
Reviewers:
dcheng
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make WaitableEventWatcher TaskScheduler-friendly. With this CL, WaitableEventWatcher uses SequencedTaskRunnerHandle instead of MessageLoop::current() to post back to the sequence that called StartWatching(). Also, WaitableEventWatcher no longer registers itself as a destruction observer of the MessageLoop from which StartWatching() is called. If the watched WaitableEvent is signaled after the MessageLoop is destroyed, the task posted by WaitableEventWatcher to the SequencedTaskRunner will simply not run (no crash). MessageLoop::current() and destruction observer do not work with TaskScheduler. BUG=650318 Committed: https://crrev.com/cc6bd5c938f5d4dfa33ed1bbe962a2effc12d597 Cr-Commit-Position: refs/heads/master@{#422856}

Patch Set 1 #

Patch Set 2 : fix test error #

Patch Set 3 : self-review #

Total comments: 8

Patch Set 4 : CR dcheng #16 #

Patch Set 5 : add missing include #

Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -124 lines) Patch
M base/synchronization/waitable_event_watcher.h View 1 2 3 3 chunks +30 lines, -26 lines 0 comments Download
M base/synchronization/waitable_event_watcher_posix.cc View 1 2 3 4 6 chunks +49 lines, -86 lines 0 comments Download
M base/synchronization/waitable_event_watcher_unittest.cc View 1 chunk +0 lines, -5 lines 0 comments Download
M base/synchronization/waitable_event_watcher_win.cc View 2 chunks +1 line, -7 lines 0 comments Download

Messages

Total messages: 24 (17 generated)
fdoray
PTAL
4 years, 2 months ago (2016-09-27 12:27:06 UTC) #11
dcheng
Overall, looks good. Just a few minor nits. https://codereview.chromium.org/2368423002/diff/40001/base/synchronization/waitable_event_watcher.h File base/synchronization/waitable_event_watcher.h (right): https://codereview.chromium.org/2368423002/diff/40001/base/synchronization/waitable_event_watcher.h#newcode98 base/synchronization/waitable_event_watcher.h:98: // ...
4 years, 2 months ago (2016-10-03 21:24:02 UTC) #16
fdoray
PTAnL https://codereview.chromium.org/2368423002/diff/40001/base/synchronization/waitable_event_watcher.h File base/synchronization/waitable_event_watcher.h (right): https://codereview.chromium.org/2368423002/diff/40001/base/synchronization/waitable_event_watcher.h#newcode98 base/synchronization/waitable_event_watcher.h:98: // Initialized in StartWatching(). Set to true before ...
4 years, 2 months ago (2016-10-04 12:59:11 UTC) #17
dcheng
lgtm
4 years, 2 months ago (2016-10-04 16:39:11 UTC) #18
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/2368423002/80001
4 years, 2 months ago (2016-10-04 17:07:45 UTC) #20
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 2 months ago (2016-10-04 18:04:16 UTC) #22
commit-bot: I haz the power
4 years, 2 months ago (2016-10-04 18:06:52 UTC) #24
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/cc6bd5c938f5d4dfa33ed1bbe962a2effc12d597
Cr-Commit-Position: refs/heads/master@{#422856}

Powered by Google App Engine
This is Rietveld 408576698