MCPcopy Create free account
hub / github.com/Snapchat/Valdi / dispatchOnJsThread

Method dispatchOnJsThread

valdi/src/valdi/runtime/JavaScript/JavaScriptRuntime.cpp:3674–3696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3672 if (jsDebuggerInfo.has_value()) {
3673 daemonClient->sendJsDebuggerInfo(jsDebuggerInfo.value().debuggerPort,
3674 jsDebuggerInfo.value().websocketTargets);
3675 }
3676
3677 notifyDaemonClientEvent(DaemonClientEventTypeConnected, daemonClientJs.get(), JSValue(), jsEntry);
3678 if (!jsEntry.exceptionTracker) {
3679 onRecoverableError("daemonClientConnected", jsEntry.exceptionTracker);
3680 return;
3681 }
3682 });
3683}
3684
3685void JavaScriptRuntime::daemonClientDisconnected(const Shared<IDaemonClient>& daemonClient) {
3686 dispatchOnJsThreadUnattributed([=](JavaScriptEntryParameters& jsEntry) {
3687 const auto& it = _daemonClients.find(daemonClient->getConnectionId());
3688 if (it != _daemonClients.end()) {
3689 auto daemonClientJs = it->second;
3690 _daemonClients.erase(it);
3691
3692 notifyDaemonClientEvent(DaemonClientEventTypeDisconnected, daemonClientJs.get(), JSValue(), jsEntry);
3693 if (!jsEntry.exceptionTracker) {
3694 onRecoverableError("daemonClientDisconnected", jsEntry.exceptionTracker);
3695 return;
3696 }
3697 }
3698 });
3699}

Callers 10

callOnJsThreadMethod · 0.45
postInitMethod · 0.45
setHostOnMessageMethod · 0.45
postMessageMethod · 0.45
closeMethod · 0.45
onCreateMethod · 0.45
onDestroyMethod · 0.45
onViewModelUpdateMethod · 0.45
onAttributeChangeMethod · 0.45
onRuntimeIssueMethod · 0.45

Calls 5

RefInterface · 0.50
asyncAfterMethod · 0.45
isCurrentMethod · 0.45
syncMethod · 0.45
asyncMethod · 0.45

Tested by

no test coverage detected