| 254 | } |
| 255 | |
| 256 | void JsV8InspectorClient::init() { |
| 257 | if (inspector_ != nullptr) { |
| 258 | return; |
| 259 | } |
| 260 | |
| 261 | v8::Locker locker(isolate_); |
| 262 | v8::Isolate::Scope isolate_scope(isolate_); |
| 263 | v8::HandleScope handle_scope(isolate_); |
| 264 | v8::Local<Context> context = Runtime::GetRuntime(isolate_)->GetContext(); |
| 265 | |
| 266 | inspector_ = V8Inspector::create(isolate_, this); |
| 267 | |
| 268 | inspector_->contextCreated(v8_inspector::V8ContextInfo(context, JsV8InspectorClient::contextGroupId, {})); |
| 269 | |
| 270 | context_.Reset(isolate_, context); |
| 271 | |
| 272 | createInspectorSession(); |
| 273 | |
| 274 | tracing_agent_.reset(new tns::inspector::TracingAgentImpl()); |
| 275 | |
| 276 | try { |
| 277 | this->registerModules(); |
| 278 | } catch (NativeScriptException& e) { |
| 279 | // we don't want to throw if registering modules failed. |
| 280 | // e.ReThrowToV8(); |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | JsV8InspectorClient* JsV8InspectorClient::GetInstance() { |
| 285 | if (instance == nullptr) { |
nothing calls this directly
no test coverage detected