summaryrefslogtreecommitdiff
path: root/deps/v8/test/inspector/isolate-data.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/inspector/isolate-data.h')
-rw-r--r--deps/v8/test/inspector/isolate-data.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/deps/v8/test/inspector/isolate-data.h b/deps/v8/test/inspector/isolate-data.h
index b942d255de..7a953e6b3f 100644
--- a/deps/v8/test/inspector/isolate-data.h
+++ b/deps/v8/test/inspector/isolate-data.h
@@ -11,7 +11,9 @@
#include "include/v8-array-buffer.h"
#include "include/v8-inspector.h"
#include "include/v8-local-handle.h"
+#include "include/v8-locker.h"
#include "include/v8-script.h"
+#include "src/base/optional.h"
namespace v8 {
@@ -47,7 +49,9 @@ class InspectorIsolateData : public v8_inspector::V8InspectorClient {
~InspectorIsolateData() override {
// Enter the isolate before destructing this InspectorIsolateData, so that
// destructors that run before the Isolate's destructor still see it as
- // entered.
+ // entered. Use a v8::Locker, in case the thread destroying the isolate is
+ // not the last one that entered it.
+ locker_.emplace(isolate());
isolate()->Enter();
}
@@ -74,6 +78,7 @@ class InspectorIsolateData : public v8_inspector::V8InspectorClient {
void BreakProgram(int context_group_id,
const v8_inspector::StringView& reason,
const v8_inspector::StringView& details);
+ void Stop(int session_id);
void SchedulePauseOnNextStatement(int context_group_id,
const v8_inspector::StringView& reason,
const v8_inspector::StringView& details);
@@ -106,6 +111,7 @@ class InspectorIsolateData : public v8_inspector::V8InspectorClient {
bool AssociateExceptionData(v8::Local<v8::Value> exception,
v8::Local<v8::Name> key,
v8::Local<v8::Value> value);
+ void WaitForDebugger(int context_group_id);
private:
static v8::MaybeLocal<v8::Module> ModuleResolveCallback(
@@ -126,6 +132,7 @@ class InspectorIsolateData : public v8_inspector::V8InspectorClient {
v8::MaybeLocal<v8::Value> memoryInfo(v8::Isolate* isolate,
v8::Local<v8::Context>) override;
void runMessageLoopOnPause(int context_group_id) override;
+ void runIfWaitingForDebugger(int context_group_id) override;
void quitMessageLoopOnPause() override;
void installAdditionalCommandLineAPI(v8::Local<v8::Context>,
v8::Local<v8::Object>) override;
@@ -157,6 +164,9 @@ class InspectorIsolateData : public v8_inspector::V8InspectorClient {
SetupGlobalTasks setup_global_tasks_;
std::unique_ptr<v8::ArrayBuffer::Allocator> array_buffer_allocator_;
std::unique_ptr<v8::Isolate, IsolateDeleter> isolate_;
+ // The locker_ field has to come after isolate_ because the locker has to
+ // outlive the isolate.
+ base::Optional<v8::Locker> locker_;
std::unique_ptr<v8_inspector::V8Inspector> inspector_;
int last_context_group_id_ = 0;
std::map<int, std::vector<v8::Global<v8::Context>>> contexts_;
@@ -169,6 +179,7 @@ class InspectorIsolateData : public v8_inspector::V8InspectorClient {
double current_time_ = 0.0;
bool log_console_api_message_calls_ = false;
bool log_max_async_call_stack_depth_changed_ = false;
+ bool waiting_for_debugger_ = false;
v8::Global<v8::Private> not_inspectable_private_;
v8::Global<v8::String> resource_name_prefix_;
v8::Global<v8::String> additional_console_api_;