| 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_
|
|
|