Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3066)

Unified Diff: base/task_scheduler/task_tracker_posix.cc

Issue 2427963002: Support FileDescriptorWatcher in TaskScheduler. (Closed)
Patch Set: fix build error (add BASE_EXPORT) Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/task_scheduler/task_tracker_posix.h ('k') | base/task_scheduler/task_tracker_posix_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/task_tracker_posix.cc
diff --git a/base/task_scheduler/task_tracker_posix.cc b/base/task_scheduler/task_tracker_posix.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5c54f371949acf6100eda4f0d8a301057402d4e5
--- /dev/null
+++ b/base/task_scheduler/task_tracker_posix.cc
@@ -0,0 +1,30 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/task_scheduler/task_tracker_posix.h"
+
+#include <utility>
+
+#include "base/files/file_descriptor_watcher_posix.h"
+#include "base/logging.h"
+
+namespace base {
+namespace internal {
+
+TaskTrackerPosix::TaskTrackerPosix(
+ MessageLoopForIO* watch_file_descriptor_message_loop)
+ : watch_file_descriptor_message_loop_(watch_file_descriptor_message_loop) {
+ DCHECK(watch_file_descriptor_message_loop_);
+}
+
+TaskTrackerPosix::~TaskTrackerPosix() = default;
+
+void TaskTrackerPosix::PerformRunTask(std::unique_ptr<Task> task) {
+ FileDescriptorWatcher file_descriptor_watcher(
+ watch_file_descriptor_message_loop_);
+ TaskTracker::PerformRunTask(std::move(task));
+}
+
+} // namespace internal
+} // namespace base
« no previous file with comments | « base/task_scheduler/task_tracker_posix.h ('k') | base/task_scheduler/task_tracker_posix_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698