| Index: test/inspector/task-runner.h
|
| diff --git a/test/inspector/task-runner.h b/test/inspector/task-runner.h
|
| index 045bba0d259513ec9e36f891ff083723808817e0..0f980fbfaa1e2eab842e50738bdf4c639d016d2e 100644
|
| --- a/test/inspector/task-runner.h
|
| +++ b/test/inspector/task-runner.h
|
| @@ -5,6 +5,8 @@
|
| #ifndef V8_TEST_INSPECTOR_PROTOCOL_TASK_RUNNER_H_
|
| #define V8_TEST_INSPECTOR_PROTOCOL_TASK_RUNNER_H_
|
|
|
| +#include <map>
|
| +
|
| #include "include/v8-inspector.h"
|
| #include "include/v8-platform.h"
|
| #include "include/v8.h"
|
| @@ -14,6 +16,16 @@
|
| #include "src/locked-queue-inl.h"
|
| #include "src/vector.h"
|
|
|
| +struct VectorCompare {
|
| + bool operator()(const v8::internal::Vector<uint16_t>& lhs,
|
| + const v8::internal::Vector<uint16_t>& rhs) const {
|
| + for (int i = 0; i < lhs.length() && i < rhs.length(); ++i) {
|
| + if (lhs[i] != rhs[i]) return lhs[i] < rhs[i];
|
| + }
|
| + return false;
|
| + }
|
| +};
|
| +
|
| class TaskRunner : public v8::base::Thread {
|
| public:
|
| class Task {
|
| @@ -42,6 +54,12 @@ class TaskRunner : public v8::base::Thread {
|
|
|
| void Terminate();
|
|
|
| + void RegisterModule(v8::internal::Vector<uint16_t> name,
|
| + v8::Local<v8::Module> module);
|
| + static v8::MaybeLocal<v8::Module> ModuleResolveCallback(
|
| + v8::Local<v8::Context> context, v8::Local<v8::String> specifier,
|
| + v8::Local<v8::Module> referrer);
|
| +
|
| private:
|
| void InitializeContext();
|
| Task* GetNext(bool only_protocol);
|
| @@ -60,6 +78,10 @@ class TaskRunner : public v8::base::Thread {
|
| v8::internal::LockedQueue<Task*> deffered_queue_;
|
| v8::base::Semaphore process_queue_semaphore_;
|
|
|
| + std::map<v8::internal::Vector<uint16_t>, v8::Global<v8::Module>,
|
| + VectorCompare>
|
| + modules_;
|
| +
|
| int nested_loop_count_;
|
|
|
| v8::base::AtomicNumber<int> is_terminated_;
|
| @@ -86,7 +108,8 @@ class ExecuteStringTask : public AsyncTask {
|
| ExecuteStringTask(const v8::internal::Vector<uint16_t>& expression,
|
| v8::Local<v8::String> name,
|
| v8::Local<v8::Integer> line_offset,
|
| - v8::Local<v8::Integer> column_offset, const char* task_name,
|
| + v8::Local<v8::Integer> column_offset,
|
| + v8::Local<v8::Boolean> is_module, const char* task_name,
|
| v8_inspector::V8Inspector* inspector);
|
| explicit ExecuteStringTask(
|
| const v8::internal::Vector<const char>& expression);
|
| @@ -99,8 +122,9 @@ class ExecuteStringTask : public AsyncTask {
|
| v8::internal::Vector<uint16_t> expression_;
|
| v8::internal::Vector<const char> expression_utf8_;
|
| v8::internal::Vector<uint16_t> name_;
|
| - int32_t line_offset_;
|
| - int32_t column_offset_;
|
| + int32_t line_offset_ = 0;
|
| + int32_t column_offset_ = 0;
|
| + bool is_module_ = false;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ExecuteStringTask);
|
| };
|
|
|