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

Unified Diff: test/inspector-protocol/task-runner.h

Issue 2358943002: [inspector] added inspector protocol test runner (Closed)
Patch Set: a Created 4 years, 3 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: 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_

Powered by Google App Engine
This is Rietveld 408576698