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

Issue 2598483004: Use TaskScheduler in EnsureProcessTerminated(). (Closed)

Created:
4 years ago by fdoray
Modified:
3 years, 11 months ago
Reviewers:
gab, Will Harris
CC:
chromium-reviews, vmpstr+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use TaskScheduler in EnsureProcessTerminated(). Before this CL, EnsureProcessTerminated() posted a task to the current thread using ThreadTaskRunnerHandle to terminate a process after a timeout. Unfortunately, ThreadTaskRunnerHandle doesn't work when used from sequenced or parallel tasks. Since there is no reason to terminate the process on the thread from which EnsureProcessTerminated() is called, this CL replaces ThreadTaskRunnerHandle with PostDelayedTaskWithTraits. This allows EnsureProcessTerminated to be called from any context. This CL also removes usage of base::win::ObjectWatcher from EnsureProcessTerminated(). Before, the process handle was closed as soon as the process exited. Now, the process is terminated (if need be) and the handle is closed only when the timeout expires. BUG=675631 Review-Url: https://codereview.chromium.org/2598483004 Cr-Commit-Position: refs/heads/master@{#442576} Committed: https://chromium.googlesource.com/chromium/src/+/c407aeeec23b49178d20068a39a762e2a6599537

Patch Set 1 #

Total comments: 2

Patch Set 2 : Use PostDelayedTaskWithTraits. #

Total comments: 4

Patch Set 3 : lambda #

Patch Set 4 : include #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -64 lines) Patch
M base/process/kill_win.cc View 1 2 3 3 chunks +15 lines, -64 lines 0 comments Download

Messages

Total messages: 27 (15 generated)
fdoray
PTAL AFAICT, this is only used on the process launcher thread [1], file thread [2], ...
4 years ago (2016-12-22 13:03:48 UTC) #6
gab
https://codereview.chromium.org/2598483004/diff/1/base/process/kill_win.cc File base/process/kill_win.cc (right): https://codereview.chromium.org/2598483004/diff/1/base/process/kill_win.cc#newcode202 base/process/kill_win.cc:202: CreateTaskRunnerWithTraits( Should we add PostDelayedTaskWithTraits()?
4 years ago (2016-12-22 20:23:02 UTC) #9
fdoray
PTAnL https://codereview.chromium.org/2598483004/diff/1/base/process/kill_win.cc File base/process/kill_win.cc (right): https://codereview.chromium.org/2598483004/diff/1/base/process/kill_win.cc#newcode202 base/process/kill_win.cc:202: CreateTaskRunnerWithTraits( On 2016/12/22 20:23:02, gab wrote: > Should ...
3 years, 11 months ago (2017-01-06 17:36:48 UTC) #11
gab
https://codereview.chromium.org/2598483004/diff/20001/base/process/kill_win.cc File base/process/kill_win.cc (left): https://codereview.chromium.org/2598483004/diff/20001/base/process/kill_win.cc#oldcode205 base/process/kill_win.cc:205: Owned(new TimerExpiredTask(std::move(process)))), TimerExpiredTask::watcher_::task_runner_ is set to SequencedTaskRunnerHandle::Get() and watcher_ ...
3 years, 11 months ago (2017-01-09 17:36:38 UTC) #12
fdoray
PTAnL https://codereview.chromium.org/2598483004/diff/20001/base/process/kill_win.cc File base/process/kill_win.cc (left): https://codereview.chromium.org/2598483004/diff/20001/base/process/kill_win.cc#oldcode205 base/process/kill_win.cc:205: Owned(new TimerExpiredTask(std::move(process)))), On 2017/01/09 17:36:38, gab wrote: > ...
3 years, 11 months ago (2017-01-09 21:16:49 UTC) #14
gab
lgtm, hadn't realized when I proposed it that not using the watcher would mean keeping ...
3 years, 11 months ago (2017-01-09 21:27:10 UTC) #15
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/2598483004/40001
3 years, 11 months ago (2017-01-09 21:30:25 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/360283)
3 years, 11 months ago (2017-01-09 22:14:33 UTC) #19
grt (UTC plus 2)
On 2017/01/09 21:27:10, gab wrote: > lgtm, hadn't realized when I proposed it that not ...
3 years, 11 months ago (2017-01-10 12:32:13 UTC) #20
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/2598483004/60001
3 years, 11 months ago (2017-01-10 13:02:26 UTC) #23
commit-bot: I haz the power
Committed patchset #4 (id:60001) as https://chromium.googlesource.com/chromium/src/+/c407aeeec23b49178d20068a39a762e2a6599537
3 years, 11 months ago (2017-01-10 14:07:01 UTC) #26
Will Harris
3 years, 11 months ago (2017-01-10 16:32:59 UTC) #27
Message was sent while issue was closed.
lgtm - but the notification was removed, was this because it wasn't being used?
I couldn't find any users of it.

Powered by Google App Engine
This is Rietveld 408576698