forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove MessageLoop::current() from base::win::ObjectWatcher (reland).
--- This is a reland of https://codereview.chromium.org/2125763003 which was reverted because it broke the Win10 builder. It should not break anything now that TestSimpleTaskRunner is thread-safe (https://codereview.chromium.org/2296923003) --- 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=650318 Review-Url: https://codereview.chromium.org/2365423003 Cr-Commit-Position: refs/heads/master@{#421179}
- Loading branch information
Showing
6 changed files
with
49 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
#include <io.h> | ||
#include <stdint.h> | ||
|
||
#include <algorithm> | ||
#include <utility> | ||
|
||
#include "base/bind.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters