Index: test/inspector-protocol/task-queue.h |
diff --git a/test/inspector-protocol/task-queue.h b/test/inspector-protocol/task-queue.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8b2bbd238b3cca17b4a98854a99088ad59c0dd96 |
--- /dev/null |
+++ b/test/inspector-protocol/task-queue.h |
@@ -0,0 +1,38 @@ |
+// 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_QUEUE_H_ |
+#define V8_TEST_INSPECTOR_PROTOCOL_TASK_QUEUE_H_ |
+ |
+#include "include/v8.h" |
+#include "src/base/macros.h" |
+#include "src/base/platform/platform.h" |
+#include "src/locked-queue-inl.h" |
+ |
+namespace v8_inspector { |
+ |
+class Task; |
+ |
+class TaskQueue { |
+ public: |
+ TaskQueue(); |
+ ~TaskQueue(); |
+ |
+ void Append(Task* task); |
+ Task* GetNext(bool only_protocol); |
+ |
+ void SetContext(v8::Local<v8::Context>); |
+ static TaskQueue* FromContext(v8::Local<v8::Context>); |
+ |
+ private: |
+ v8::internal::LockedQueue<Task*> queue_; |
+ v8::internal::LockedQueue<Task*> deffered_queue_; |
+ v8::base::Semaphore process_queue_semaphore_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(TaskQueue); |
+}; |
+ |
+} // v8_inspector |
+ |
+#endif // V8_TEST_INSPECTOR_PROTOCOL_TASK_QUEUE_H_ |