DescriptionRemove 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) #
Messages
Total messages: 26 (13 generated)
|