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

Unified Diff: base/message_loop/bindable_single_thread_task_runner.h

Issue 1206893003: base: Make it possible to replace the MessageLoop's task runner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change in media/blink/webmediaplayer_impl.cc is not needed Created 5 years, 6 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/base.gypi ('k') | base/message_loop/message_loop.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/bindable_single_thread_task_runner.h
diff --git a/base/message_loop/bindable_single_thread_task_runner.h b/base/message_loop/bindable_single_thread_task_runner.h
new file mode 100644
index 0000000000000000000000000000000000000000..9243dfafd7cd062ac4ff853736d9dd69a61c3316
--- /dev/null
+++ b/base/message_loop/bindable_single_thread_task_runner.h
@@ -0,0 +1,27 @@
+// Copyright 2015 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.
+
+#ifndef BASE_MESSAGE_LOOP_BINDABLE_SINGLE_THREAD_TASK_RUNNER_H_
+#define BASE_MESSAGE_LOOP_BINDABLE_SINGLE_THREAD_TASK_RUNNER_H_
+
+#include "base/single_thread_task_runner.h"
+
+namespace base {
+
+// A SingleThreadTaskRunner which can be created on any thread and subsequently
+// be bound to the specific thread it's intended to run tasks on. Binding is
+// required before any tasks can be posted.
+class BASE_EXPORT BindableSingleThreadTaskRunner
+ : public SingleThreadTaskRunner {
+ public:
+ // Initialize this task runner on the current thread.
+ virtual void BindToCurrentThread() = 0;
+
+ protected:
+ ~BindableSingleThreadTaskRunner() override {}
+};
+
+} // namespace base
+
+#endif // BASE_MESSAGE_LOOP_BINDABLE_SINGLE_THREAD_TASK_RUNNER_H_
« no previous file with comments | « base/base.gypi ('k') | base/message_loop/message_loop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698