Skip to main content

register_worker_scope_callback

Function register_worker_scope_callback 

Source
pub fn register_worker_scope_callback(
    callback: Box<dyn FnOnce(*mut c_void, *mut c_void) + Send>,
)
Expand description

Register a callback to be executed on the Worker thread the next time a servo-native DedicatedWorkerGlobalScope::run_worker_scope finishes constructing the Worker global object.

The callback receives (cx: *mut JSContext, global: *mut JSObject) which are actually (*mut mozjs::jsapi::JSContext, *mut mozjs::jsapi::JSObject). It runs on the Worker thread (not the ScriptThread).