| Index: test/inspector-protocol/task-runner.h
|
| diff --git a/test/inspector-protocol/task-runner.h b/test/inspector-protocol/task-runner.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..dc80cc44a6447c9ef6cb6f3b77997d95bc479045
|
| --- /dev/null
|
| +++ b/test/inspector-protocol/task-runner.h
|
| @@ -0,0 +1,45 @@
|
| +// Copyright 2016 the V8 project 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 V8_TEST_INSPECTOR_PROTOCOL_TASK_RUNNER_H_
|
| +#define V8_TEST_INSPECTOR_PROTOCOL_TASK_RUNNER_H_
|
| +
|
| +#include "include/v8-platform.h"
|
| +#include "include/v8.h"
|
| +#include "src/base/atomic-utils.h"
|
| +#include "src/base/macros.h"
|
| +#include "src/base/platform/platform.h"
|
| +
|
| +namespace v8_inspector {
|
| +
|
| +class Task;
|
| +class TaskQueue;
|
| +
|
| +class TaskRunner : public v8::base::Thread {
|
| + public:
|
| + enum State { kRunning, kStopRequested };
|
| +
|
| + explicit TaskRunner(TaskQueue* queue);
|
| + virtual ~TaskRunner();
|
| +
|
| + void SetContext(v8::Local<v8::Context>);
|
| + TaskQueue* Queue() const { return queue_; }
|
| +
|
| + // Thread implementation.
|
| + void Run() override;
|
| + void Stop();
|
| +
|
| + private:
|
| + TaskQueue* queue_;
|
| + v8::base::AtomicValue<State> state_;
|
| +
|
| + v8::Isolate* isolate_;
|
| + v8::Global<v8::Context> context_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(TaskRunner);
|
| +};
|
| +
|
| +} // v8_inspector
|
| +
|
| +#endif // V8_TEST_INSPECTOR_PROTOCOL_TASK_RUNNER_H_
|
|
|