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

Issue 2125763003: Remove MessageLoop::current() from base::win::ObjectWatcher. (Closed)

Created:
4 years, 5 months ago by fdoray
Modified:
4 years, 4 months ago
CC:
chromium-reviews, grt+watch_chromium.org, wfh+watch_chromium.org, jschuh
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove MessageLoop::current() from base::win::ObjectWatcher. Why? The fact that there's a MessageLoop on the thread is an unnecessary implementation detail. When browser threads are migrated to base/task_scheduler, tasks will no longer have access to a MessageLoop but they will be able to get the current ThreadTaskRunnerHandle. Before this CL, ObjectWatcher implemented WillDestroyCurrentMessageLoop() to stop the watch when the MessageLoop responsible for running the callback was destroyed. This prevented the watch callback from being sent to a destroyed MessageLoop. Now that ObjectWatcher keeps a reference to a TaskRunner, this is no longer required. The TaskRunner can't be deleted while there are references to it. If the underlying MessageLoop has been deleted when the watch callback is posted, the callback will simply not run. Note that the watch will still be stopped when the ObjectWatcher is deleted. TBR=ben@chromium.org BUG=616447 Committed: https://crrev.com/76db1513714741d8d6e6dd6e872d50f20b090fce Cr-Commit-Position: refs/heads/master@{#407874}

Patch Set 1 #

Patch Set 2 : fix #

Total comments: 10

Patch Set 3 : CR grt #10 #

Patch Set 4 : self-review #

Total comments: 8

Patch Set 5 : CR grt #12 (comments) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -50 lines) Patch
M base/files/file_path_watcher_win.cc View 1 chunk +1 line, -0 lines 0 comments Download
M base/process/kill_win.cc View 1 chunk +1 line, -0 lines 0 comments Download
M base/win/object_watcher.h View 1 2 3 4 3 chunks +25 lines, -16 lines 0 comments Download
M base/win/object_watcher.cc View 1 2 3 4 6 chunks +20 lines, -34 lines 0 comments Download
M chrome/common/service_process_util_win.cc View 1 chunk +1 line, -0 lines 0 comments Download
M ui/gfx/font_fallback_win.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 26 (13 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2125763003/20001
4 years, 5 months ago (2016-07-07 14:47:21 UTC) #2
fdoray
Can you review this CL? Thanks.
4 years, 5 months ago (2016-07-07 14:50:12 UTC) #4
fdoray
cpu@: Can you review this CL? (jschuh@ very slow)
4 years, 5 months ago (2016-07-07 17:04:49 UTC) #6
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 5 months ago (2016-07-07 17:25:36 UTC) #8
grt (UTC plus 2)
mostly good to me. https://codereview.chromium.org/2125763003/diff/20001/base/win/object_watcher.cc File base/win/object_watcher.cc (right): https://codereview.chromium.org/2125763003/diff/20001/base/win/object_watcher.cc#newcode46 base/win/object_watcher.cc:46: object_ = NULL; nit: nullptr ...
4 years, 5 months ago (2016-07-14 07:19:11 UTC) #10
fdoray
PTAnL https://codereview.chromium.org/2125763003/diff/20001/base/win/object_watcher.cc File base/win/object_watcher.cc (right): https://codereview.chromium.org/2125763003/diff/20001/base/win/object_watcher.cc#newcode46 base/win/object_watcher.cc:46: object_ = NULL; On 2016/07/14 07:19:11, grt (UTC ...
4 years, 5 months ago (2016-07-18 16:05:18 UTC) #11
grt (UTC plus 2)
lgtm w/ nits https://codereview.chromium.org/2125763003/diff/60001/base/win/object_watcher.cc File base/win/object_watcher.cc (right): https://codereview.chromium.org/2125763003/diff/60001/base/win/object_watcher.cc#newcode87 base/win/object_watcher.cc:87: callback_ = base::Bind(&ObjectWatcher::Signal, weak_factory_.GetWeakPtr(), nit: omit ...
4 years, 5 months ago (2016-07-18 19:42:35 UTC) #12
fdoray
cpu@: PTAL https://codereview.chromium.org/2125763003/diff/60001/base/win/object_watcher.cc File base/win/object_watcher.cc (right): https://codereview.chromium.org/2125763003/diff/60001/base/win/object_watcher.cc#newcode87 base/win/object_watcher.cc:87: callback_ = base::Bind(&ObjectWatcher::Signal, weak_factory_.GetWeakPtr(), On 2016/07/18 19:42:34, ...
4 years, 5 months ago (2016-07-18 21:42:04 UTC) #13
fdoray
ben@: PTAL to missing includes added to base/files/file_path_watcher_win.cc, base/process/kill_win.cc, chrome/common/service_process_util_win.cc and ui/gfx/font_fallback_win.cc
4 years, 4 months ago (2016-07-26 18:21:10 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/2125763003/80001
4 years, 4 months ago (2016-07-26 18:21:50 UTC) #21
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 4 months ago (2016-07-26 19:10:30 UTC) #23
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/76db1513714741d8d6e6dd6e872d50f20b090fce Cr-Commit-Position: refs/heads/master@{#407874}
4 years, 4 months ago (2016-07-26 19:14:06 UTC) #25
fdoray
4 years, 3 months ago (2016-08-25 16:14:02 UTC) #26
Message was sent while issue was closed.
A revert of this CL (patchset #5 id:80001) has been created in
https://codereview.chromium.org/2277333002/ by fdoray@chromium.org.

The reason for reverting is: Breaks Win10 builder. crbug.com/632184.

Powered by Google App Engine
This is Rietveld 408576698