| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_TEST_INSPECTOR_PROTOCOL_TASK_RUNNER_H_ | 5 #ifndef V8_TEST_INSPECTOR_PROTOCOL_TASK_RUNNER_H_ |
| 6 #define V8_TEST_INSPECTOR_PROTOCOL_TASK_RUNNER_H_ | 6 #define V8_TEST_INSPECTOR_PROTOCOL_TASK_RUNNER_H_ |
| 7 | 7 |
| 8 #include "include/v8-inspector.h" | 8 #include "include/v8-inspector.h" |
| 9 #include "include/v8-platform.h" | 9 #include "include/v8-platform.h" |
| 10 #include "include/v8.h" | 10 #include "include/v8.h" |
| 11 #include "src/base/macros.h" | 11 #include "src/base/macros.h" |
| 12 #include "src/base/platform/platform.h" | 12 #include "src/base/platform/platform.h" |
| 13 #include "src/inspector/string-16.h" | |
| 14 #include "src/locked-queue-inl.h" | 13 #include "src/locked-queue-inl.h" |
| 14 #include "src/vector.h" |
| 15 | 15 |
| 16 class TaskRunner : public v8::base::Thread { | 16 class TaskRunner : public v8::base::Thread { |
| 17 public: | 17 public: |
| 18 class Task { | 18 class Task { |
| 19 public: | 19 public: |
| 20 virtual ~Task() {} | 20 virtual ~Task() {} |
| 21 virtual bool is_inspector_task() = 0; | 21 virtual bool is_inspector_task() = 0; |
| 22 virtual void Run(v8::Isolate* isolate, | 22 virtual void Run(v8::Isolate* isolate, |
| 23 const v8::Global<v8::Context>& context) = 0; | 23 const v8::Global<v8::Context>& context) = 0; |
| 24 }; | 24 }; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 v8::internal::LockedQueue<Task*> deffered_queue_; | 58 v8::internal::LockedQueue<Task*> deffered_queue_; |
| 59 v8::base::Semaphore process_queue_semaphore_; | 59 v8::base::Semaphore process_queue_semaphore_; |
| 60 | 60 |
| 61 int nested_loop_count_; | 61 int nested_loop_count_; |
| 62 | 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(TaskRunner); | 63 DISALLOW_COPY_AND_ASSIGN(TaskRunner); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 class ExecuteStringTask : public TaskRunner::Task { | 66 class ExecuteStringTask : public TaskRunner::Task { |
| 67 public: | 67 public: |
| 68 explicit ExecuteStringTask(const v8_inspector::String16& expression); | 68 explicit ExecuteStringTask(const v8::internal::Vector<uint16_t>& expression); |
| 69 explicit ExecuteStringTask( |
| 70 const v8::internal::Vector<const char>& expression); |
| 69 bool is_inspector_task() override { return false; } | 71 bool is_inspector_task() override { return false; } |
| 70 | 72 |
| 71 void Run(v8::Isolate* isolate, | 73 void Run(v8::Isolate* isolate, |
| 72 const v8::Global<v8::Context>& context) override; | 74 const v8::Global<v8::Context>& context) override; |
| 73 | 75 |
| 74 private: | 76 private: |
| 75 v8_inspector::String16 expression_; | 77 v8::internal::Vector<uint16_t> expression_; |
| 78 v8::internal::Vector<const char> expression_utf8_; |
| 76 | 79 |
| 77 DISALLOW_COPY_AND_ASSIGN(ExecuteStringTask); | 80 DISALLOW_COPY_AND_ASSIGN(ExecuteStringTask); |
| 78 }; | 81 }; |
| 79 | 82 |
| 80 #endif // V8_TEST_INSPECTOR_PROTOCOL_TASK_RUNNER_H_ | 83 #endif // V8_TEST_INSPECTOR_PROTOCOL_TASK_RUNNER_H_ |
| OLD | NEW |