• fdoray's avatar
    Revert of Remove MessageLoop::current() from base::win::ObjectWatcher.... · 00108e0c
    fdoray authored
    Revert of Remove MessageLoop::current() from base::win::ObjectWatcher. (patchset #5 id:80001 of https://codereview.chromium.org/2125763003/ )
    
    Reason for revert:
    Breaks Win10 builder. crbug.com/632184
    
    Original issue's 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}
    
    TBR=grt@chromium.org,ben@chromium.org
    # Not skipping CQ checks because original CL landed more than 1 days ago.
    BUG=616447
    
    Review-Url: https://codereview.chromium.org/2277333002
    Cr-Commit-Position: refs/heads/master@{#414465}
    00108e0c
kill_win.cc 6.74 KB