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

Unified Diff: mojo/public/cpp/bindings/tests/thread_per_task_sequenced_task_runner.h

Issue 2608163003: Change single-interface mojo bindings to use SequencedTaskRunner. (Closed)
Patch Set: Created 3 years, 11 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
Index: mojo/public/cpp/bindings/tests/thread_per_task_sequenced_task_runner.h
diff --git a/mojo/public/cpp/bindings/tests/thread_per_task_sequenced_task_runner.h b/mojo/public/cpp/bindings/tests/thread_per_task_sequenced_task_runner.h
new file mode 100644
index 0000000000000000000000000000000000000000..0e3d0690e1afad7954866396d92bee9118207e39
--- /dev/null
+++ b/mojo/public/cpp/bindings/tests/thread_per_task_sequenced_task_runner.h
@@ -0,0 +1,35 @@
+// Copyright 2017 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 MOJO_PUBLIC_CPP_BINDINGS_TESTS_THREAD_PER_TASK_SEQUENCED_TASK_RUNNER_H_
+#define MOJO_PUBLIC_CPP_BINDINGS_TESTS_THREAD_PER_TASK_SEQUENCED_TASK_RUNNER_H_
+
+#include "base/macros.h"
+#include "base/sequenced_task_runner.h"
+
+namespace mojo {
+namespace test {
+
+// Holds a base::SequencedTaskRunner implementation that runs each task on a
+// separate thread. Note that task delays are ignored and non-nestable tasks are
+// treated as nestable.
+class ThreadPerTaskSequencedTaskRunnerOwner {
+ public:
+ ThreadPerTaskSequencedTaskRunnerOwner();
+ ~ThreadPerTaskSequencedTaskRunnerOwner();
+
+ scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner();
+
+ private:
+ class TaskRunnerImpl;
+
+ scoped_refptr<TaskRunnerImpl> task_runner_;
+
+ DISALLOW_COPY_AND_ASSIGN(ThreadPerTaskSequencedTaskRunnerOwner);
+};
+
+} // namespace test
+} // namespace mojo
+
+#endif // MOJO_PUBLIC_CPP_BINDINGS_TESTS_THREAD_PER_TASK_SEQUENCED_TASK_RUNNER_H_

Powered by Google App Engine
This is Rietveld 408576698