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.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/deps/v8/test/inspector/isolate-data.h b/deps/v8/test/inspector/isolate-data.h
index 455b44b49b..5eb9803a74 100644
--- a/deps/v8/test/inspector/isolate-data.h
+++ b/deps/v8/test/inspector/isolate-data.h
@@ -30,7 +30,7 @@ class IsolateData : public v8_inspector::V8InspectorClient {
v8::StartupData* startup_data, bool with_inspector);
static IsolateData* FromContext(v8::Local<v8::Context> context);
- v8::Isolate* isolate() const { return isolate_; }
+ v8::Isolate* isolate() const { return isolate_.get(); }
TaskRunner* task_runner() const { return task_runner_; }
// Setting things up.
@@ -58,6 +58,12 @@ class IsolateData : public v8_inspector::V8InspectorClient {
bool recurring);
void AsyncTaskStarted(void* task);
void AsyncTaskFinished(void* task);
+
+ v8_inspector::V8StackTraceId StoreCurrentStackTrace(
+ const v8_inspector::StringView& description);
+ void ExternalAsyncTaskStarted(const v8_inspector::V8StackTraceId& parent);
+ void ExternalAsyncTaskFinished(const v8_inspector::V8StackTraceId& parent);
+
void AddInspectedObject(int session_id, v8::Local<v8::Value> object);
// Test utilities.
@@ -109,9 +115,17 @@ class IsolateData : public v8_inspector::V8InspectorClient {
bool isInspectableHeapObject(v8::Local<v8::Object>) override;
void maxAsyncCallStackDepthChanged(int depth) override;
+ // The isolate gets deleted by its {Dispose} method, not by the default
+ // deleter. Therefore we have to define a custom deleter for the unique_ptr to
+ // call {Dispose}. We have to use the unique_ptr so that the isolate get
+ // disposed in the right order, relative to other member variables.
+ struct IsolateDeleter {
+ void operator()(v8::Isolate* isolate) const { isolate->Dispose(); }
+ };
+
TaskRunner* task_runner_;
SetupGlobalTasks setup_global_tasks_;
- v8::Isolate* isolate_;
+ std::unique_ptr<v8::Isolate, IsolateDeleter> isolate_;
std::unique_ptr<v8_inspector::V8Inspector> inspector_;
int last_context_group_id_ = 0;
std::map<int, v8::Global<v8::Context>> contexts_;