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.
Migrate to base::FileDescriptionWatcher in dbus/bus.cc.
Before this CL, dbus::Bus::OnAddWatch called MessageLoopForIO::current()->WatchFileDescriptor(), which is invalid from a non-MessageLoopForIO thread. This caused a crash when dbus::Bus::OnAddWatch was called from a TaskScheduler thread. With this CL, dbus::Bus::OnAddWatch uses base::FileDescriptorWatcher::WatchReadable/Writable instead of MessageLoopForIO::current()->WatchFileDescriptor(). This works from base::Threads that run a MessageLoopForIO and TaskScheduler threads. This CL also instantiates a base::FileDescriptorWatcher in tests that use dbus::Bus::OnAddWatch. This is required to allow usage of base::FileDescriptorWatcher::WatchReadable/Writable on the main thread of a test. BUG=708142 Review-Url: https://codereview.chromium.org/2808983002 Cr-Commit-Position: refs/heads/master@{#465215}
- Loading branch information
Showing
3 changed files
with
44 additions
and
42 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
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