diff options
Diffstat (limited to 'runtime/worker.rs')
-rw-r--r-- | runtime/worker.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/runtime/worker.rs b/runtime/worker.rs index 7a3a6c1c3..1dc9504d6 100644 --- a/runtime/worker.rs +++ b/runtime/worker.rs @@ -51,8 +51,9 @@ pub struct WorkerOptions { pub user_agent: String, pub seed: Option<u64>, pub module_loader: Rc<dyn ModuleLoader>, - // Callback invoked when creating new instance of WebWorker + // Callbacks invoked when creating new instance of WebWorker pub create_web_worker_cb: Arc<ops::worker_host::CreateWebWorkerCb>, + pub web_worker_preload_module_cb: Arc<ops::worker_host::PreloadModuleCb>, pub js_error_create_fn: Option<Rc<JsErrorCreateFn>>, pub maybe_inspector_server: Option<Arc<InspectorServer>>, pub should_break_on_first_statement: bool, @@ -126,7 +127,10 @@ impl MainWorker { deno_ffi::init::<Permissions>(unstable), // Runtime ops ops::runtime::init(main_module.clone()), - ops::worker_host::init(options.create_web_worker_cb.clone()), + ops::worker_host::init( + options.create_web_worker_cb.clone(), + options.web_worker_preload_module_cb.clone(), + ), ops::fs_events::init(), ops::fs::init(), ops::io::init(), @@ -367,6 +371,7 @@ mod tests { root_cert_store: None, seed: None, js_error_create_fn: None, + web_worker_preload_module_cb: Arc::new(|_| unreachable!()), create_web_worker_cb: Arc::new(|_| unreachable!()), maybe_inspector_server: None, should_break_on_first_statement: false, |