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

Function toMeasureMode

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

Source from the content-addressed store, hash-verified

823 return proxy;
824}
825
826JSValueRef JavaScriptRuntime::runtimePerformSyncWithMainThread(JSFunctionNativeCallContext& callContext) {
827 auto wrappedJsFunctionResult = callContext.getParameterAsValue(0);
828 CHECK_CALL_CONTEXT(callContext);
829 auto wrappedJsFunction = wrappedJsFunctionResult.getFunctionRef();
830 if (wrappedJsFunction == nullptr) {
831 return callContext.throwError(Error("Expecting function"));
832 }
833
834 dispatchOnMainThread([wrappedJsFunction] {
835 // This wrapped function will automatically manage the main thread batch.
836 (*wrappedJsFunction)(Valdi::ValueFunctionFlagsCallSync, {});
837 });
838
839 return callContext.getContext().newUndefined();
840}

Callers 1

runtimeMeasureContextMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected