diff options
Diffstat (limited to 'runtime/ops')
-rw-r--r-- | runtime/ops/plugin.rs | 3 | ||||
-rw-r--r-- | runtime/ops/web_worker.rs | 5 | ||||
-rw-r--r-- | runtime/ops/worker_host.rs | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/runtime/ops/plugin.rs b/runtime/ops/plugin.rs index 6892b66c3..17d39405f 100644 --- a/runtime/ops/plugin.rs +++ b/runtime/ops/plugin.rs @@ -104,9 +104,10 @@ impl<'a> plugin_api::Interface for PluginInterface<'a> { dispatch_op_fn: plugin_api::DispatchOpFn, ) -> OpId { let plugin_lib = self.plugin_lib.clone(); - let plugin_op_fn: Box<OpFn> = Box::new(move |state_rc, _payload, buf| { + let plugin_op_fn: Box<OpFn> = Box::new(move |state_rc, payload| { let mut state = state_rc.borrow_mut(); let mut interface = PluginInterface::new(&mut state, &plugin_lib); + let (_, buf): ((), Option<ZeroCopyBuf>) = payload.deserialize().unwrap(); let op = dispatch_op_fn(&mut interface, buf); match op { sync_op @ Op::Sync(..) => sync_op, diff --git a/runtime/ops/web_worker.rs b/runtime/ops/web_worker.rs index 17b72cb38..1689b2587 100644 --- a/runtime/ops/web_worker.rs +++ b/runtime/ops/web_worker.rs @@ -6,13 +6,14 @@ use deno_core::error::null_opbuf; use deno_core::futures::channel::mpsc; use deno_core::op_sync; use deno_core::Extension; +use deno_core::ZeroCopyBuf; pub fn init() -> Extension { Extension::builder() .ops(vec![ ( "op_worker_post_message", - op_sync(move |state, _args: (), buf| { + op_sync(move |state, _args: (), buf: Option<ZeroCopyBuf>| { let buf = buf.ok_or_else(null_opbuf)?; let msg_buf: Box<[u8]> = (*buf).into(); let mut sender = state.borrow::<mpsc::Sender<WorkerEvent>>().clone(); @@ -25,7 +26,7 @@ pub fn init() -> Extension { // Notify host that guest worker closes. ( "op_worker_close", - op_sync(move |state, _args: (), _bufs| { + op_sync(move |state, _: (), _: ()| { // Notify parent that we're finished let mut sender = state.borrow::<mpsc::Sender<WorkerEvent>>().clone(); sender.close_channel(); diff --git a/runtime/ops/worker_host.rs b/runtime/ops/worker_host.rs index 3a4554226..cd650c2c0 100644 --- a/runtime/ops/worker_host.rs +++ b/runtime/ops/worker_host.rs @@ -96,7 +96,7 @@ pub fn init( ("op_host_get_message", op_async(op_host_get_message)), ( "op_host_unhandled_error", - op_sync(move |state, message: String, _| { + op_sync(move |state, message: String, _: ()| { if is_main_worker { return Err(generic_error("Cannot be called from main worker.")); } |