Add a new file descriptor watch API.

This API can be used from any task from which
SequencedTaskRunnerHandle::Get() returns a SequencedTaskRunner (i.e. in
particular, it can be used from SINGLE_THREADED and SEQUENCED tasks
running in base/task_scheduler). As opposed to the existing API which
is only available from single-threaded tasks running in a
MessageLoopForIO.

Threads that want to support this API must instantiate a
FileDescriptorWatcher. The constructor of FileDescriptorWatcher takes
as argument a MessageLoopForIO to use to watch file descriptors for
which callbacks are registered on the thread on which it is invoked. The
MessageLoopForIO does *not* have to run on that thread. When the
MessageLoopForIO detects that watched file descriptors are readable
and/or writable without blocking, it posts a task to run the callback on
the sequence on which it was registered.

Design doc:
https://docs.google.com/document/d/1F5CjON2JNtCtdEug3LOL8-avj188k_xOgqzdv288Q_s/edit?usp=sharing

Discussion on chromium-dev:
https://groups.google.com/a/chromium.org/d/msg/chromium-dev/voOAab4mV9A/S9xXdpPkBgAJ

BUG=645114

Review-Url: https://codereview.chromium.org/2332923004
Cr-Commit-Position: refs/heads/master@{#418853}
4 files changed