summaryrefslogtreecommitdiff
path: root/ext/web
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-06-06 23:37:53 -0400
committerGitHub <noreply@github.com>2024-06-06 23:37:53 -0400
commit386d5c8310891c5dc9627abbf2374e60bb4e50d2 (patch)
tree920367bb6e14a5d259a01765962e93ff991c1fa0 /ext/web
parenta17794d5cf0c8d1ecc624c490071e5b3a5856bc7 (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/web')
-rw-r--r--ext/web/Cargo.toml1
-rw-r--r--ext/web/timers.rs7
2 files changed, 8 insertions, 0 deletions
diff --git a/ext/web/Cargo.toml b/ext/web/Cargo.toml
index f99193e0b..ec65d51b4 100644
--- a/ext/web/Cargo.toml
+++ b/ext/web/Cargo.toml
@@ -18,6 +18,7 @@ async-trait.workspace = true
base64-simd = "0.8"
bytes.workspace = true
deno_core.workspace = true
+deno_permissions.workspace = true
encoding_rs.workspace = true
flate2 = { workspace = true, features = ["default"] }
futures.workspace = true
diff --git a/ext/web/timers.rs b/ext/web/timers.rs
index b3060a46f..648be5715 100644
--- a/ext/web/timers.rs
+++ b/ext/web/timers.rs
@@ -10,6 +10,13 @@ pub trait TimersPermission {
fn allow_hrtime(&mut self) -> bool;
}
+impl TimersPermission for deno_permissions::PermissionsContainer {
+ #[inline(always)]
+ fn allow_hrtime(&mut self) -> bool {
+ deno_permissions::PermissionsContainer::allow_hrtime(self)
+ }
+}
+
pub type StartTime = Instant;
// Returns a milliseconds and nanoseconds subsec