diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-06-06 23:37:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-06 23:37:53 -0400 |
commit | 386d5c8310891c5dc9627abbf2374e60bb4e50d2 (patch) | |
tree | 920367bb6e14a5d259a01765962e93ff991c1fa0 /ext/ffi | |
parent | a17794d5cf0c8d1ecc624c490071e5b3a5856bc7 (diff) |
refactor: remove `PermissionsContainer` in deno_runtime (#24119)
Also removes permissions being passed in for node resolution. It was
completely useless because we only checked it for reading package.json
files, but Deno reading package.json files for resolution is perfectly
fine.
My guess is this is also a perf improvement because Deno is doing less
work.
Diffstat (limited to 'ext/ffi')
-rw-r--r-- | ext/ffi/Cargo.toml | 1 | ||||
-rw-r--r-- | ext/ffi/lib.rs | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/ext/ffi/Cargo.toml b/ext/ffi/Cargo.toml index fb0d4ae2a..e8e984acb 100644 --- a/ext/ffi/Cargo.toml +++ b/ext/ffi/Cargo.toml @@ -15,6 +15,7 @@ path = "lib.rs" [dependencies] deno_core.workspace = true +deno_permissions.workspace = true dlopen2.workspace = true dynasmrt = "1.2.3" libffi = "=3.2.0" diff --git a/ext/ffi/lib.rs b/ext/ffi/lib.rs index 4e8129240..26b06d98f 100644 --- a/ext/ffi/lib.rs +++ b/ext/ffi/lib.rs @@ -53,6 +53,13 @@ pub trait FfiPermissions { fn check_partial(&mut self, path: Option<&Path>) -> Result<(), AnyError>; } +impl FfiPermissions for deno_permissions::PermissionsContainer { + #[inline(always)] + fn check_partial(&mut self, path: Option<&Path>) -> Result<(), AnyError> { + deno_permissions::PermissionsContainer::check_ffi_partial(self, path) + } +} + deno_core::extension!(deno_ffi, deps = [ deno_web ], parameters = [P: FfiPermissions], |