update_engine: Replace FileWatcher.

base::MessageLoop::WatchFileDescriptor() is removed in the next uprev.
This CL replaces the uses (including indirect uses), by FileDescriptorWatcher.

BUG=chromium:909719
TEST=Built locally. Ran cros_run_unit_tests.

Change-Id: Ide9f94daf2be28696ec6bc1f82ab46a2bd2b6c6f
diff --git a/libcurl_http_fetcher.h b/libcurl_http_fetcher.h
index cdd489d..8f4258d 100644
--- a/libcurl_http_fetcher.h
+++ b/libcurl_http_fetcher.h
@@ -24,6 +24,7 @@
 
 #include <curl/curl.h>
 
+#include <base/files/file_descriptor_watcher_posix.h>
 #include <base/logging.h>
 #include <base/macros.h>
 #include <brillo/message_loops/message_loop.h>
@@ -215,7 +216,7 @@
   }
 
   // Cleans up the following if they are non-null:
-  // curl(m) handles, fd_task_maps_, timeout_id_.
+  // curl(m) handles, fd_controller_maps_, timeout_id_.
   void CleanUp();
 
   // Force terminate the transfer. This will invoke the delegate's (if any)
@@ -252,7 +253,8 @@
   // the message loop. libcurl may open/close descriptors and switch their
   // directions so maintain two separate lists so that watch conditions can be
   // set appropriately.
-  std::map<int, brillo::MessageLoop::TaskId> fd_task_maps_[2];
+  std::map<int, std::unique_ptr<base::FileDescriptorWatcher::Controller>>
+      fd_controller_maps_[2];
 
   // The TaskId of the timer we're waiting on. kTaskIdNull if we are not waiting
   // on it.