summaryrefslogtreecommitdiff
path: root/ext/web
diff options
context:
space:
mode:
Diffstat (limited to 'ext/web')
-rw-r--r--ext/web/benches/encoding.rs7
-rw-r--r--ext/web/benches/timers_ops.rs8
-rw-r--r--ext/web/blob.rs18
3 files changed, 12 insertions, 21 deletions
diff --git a/ext/web/benches/encoding.rs b/ext/web/benches/encoding.rs
index bfae07937..e9ef3a563 100644
--- a/ext/web/benches/encoding.rs
+++ b/ext/web/benches/encoding.rs
@@ -7,6 +7,7 @@ use deno_bench_util::bencher::Bencher;
use deno_core::Extension;
use deno_core::ExtensionFileSource;
use deno_core::ExtensionFileSourceCode;
+use deno_core::OpState;
use deno_web::BlobStore;
struct Permissions;
@@ -15,11 +16,7 @@ impl deno_web::TimersPermission for Permissions {
fn allow_hrtime(&mut self) -> bool {
false
}
- fn check_unstable(
- &self,
- _state: &deno_core::OpState,
- _api_name: &'static str,
- ) {
+ fn check_unstable(&self, _state: &OpState, _api_name: &'static str) {
unreachable!()
}
}
diff --git a/ext/web/benches/timers_ops.rs b/ext/web/benches/timers_ops.rs
index 657082df4..f177f7d83 100644
--- a/ext/web/benches/timers_ops.rs
+++ b/ext/web/benches/timers_ops.rs
@@ -7,6 +7,7 @@ use deno_bench_util::bencher::Bencher;
use deno_core::Extension;
use deno_core::ExtensionFileSource;
use deno_core::ExtensionFileSourceCode;
+use deno_core::OpState;
use deno_web::BlobStore;
struct Permissions;
@@ -15,12 +16,7 @@ impl deno_web::TimersPermission for Permissions {
fn allow_hrtime(&mut self) -> bool {
true
}
- fn check_unstable(
- &self,
- _state: &deno_core::OpState,
- _api_name: &'static str,
- ) {
- }
+ fn check_unstable(&self, _state: &OpState, _api_name: &'static str) {}
}
fn setup() -> Vec<Extension> {
diff --git a/ext/web/blob.rs b/ext/web/blob.rs
index 1a7992792..44c8f0ace 100644
--- a/ext/web/blob.rs
+++ b/ext/web/blob.rs
@@ -12,6 +12,7 @@ use deno_core::error::AnyError;
use deno_core::op;
use deno_core::parking_lot::Mutex;
use deno_core::url::Url;
+use deno_core::OpState;
use deno_core::ZeroCopyBuf;
use serde::Deserialize;
use serde::Serialize;
@@ -159,10 +160,7 @@ impl BlobPart for SlicedBlobPart {
}
#[op]
-pub fn op_blob_create_part(
- state: &mut deno_core::OpState,
- data: ZeroCopyBuf,
-) -> Uuid {
+pub fn op_blob_create_part(state: &mut OpState, data: ZeroCopyBuf) -> Uuid {
let blob_store = state.borrow::<BlobStore>();
let part = InMemoryBlobPart(data.to_vec());
blob_store.insert_part(Arc::new(part))
@@ -177,7 +175,7 @@ pub struct SliceOptions {
#[op]
pub fn op_blob_slice_part(
- state: &mut deno_core::OpState,
+ state: &mut OpState,
id: Uuid,
options: SliceOptions,
) -> Result<Uuid, AnyError> {
@@ -203,7 +201,7 @@ pub fn op_blob_slice_part(
#[op]
pub async fn op_blob_read_part(
- state: Rc<RefCell<deno_core::OpState>>,
+ state: Rc<RefCell<OpState>>,
id: Uuid,
) -> Result<ZeroCopyBuf, AnyError> {
let part = {
@@ -217,14 +215,14 @@ pub async fn op_blob_read_part(
}
#[op]
-pub fn op_blob_remove_part(state: &mut deno_core::OpState, id: Uuid) {
+pub fn op_blob_remove_part(state: &mut OpState, id: Uuid) {
let blob_store = state.borrow::<BlobStore>();
blob_store.remove_part(&id);
}
#[op]
pub fn op_blob_create_object_url(
- state: &mut deno_core::OpState,
+ state: &mut OpState,
media_type: String,
part_ids: Vec<Uuid>,
) -> Result<String, AnyError> {
@@ -250,7 +248,7 @@ pub fn op_blob_create_object_url(
#[op]
pub fn op_blob_revoke_object_url(
- state: &mut deno_core::OpState,
+ state: &mut OpState,
url: String,
) -> Result<(), AnyError> {
let url = Url::parse(&url)?;
@@ -273,7 +271,7 @@ pub struct ReturnBlobPart {
#[op]
pub fn op_blob_from_object_url(
- state: &mut deno_core::OpState,
+ state: &mut OpState,
url: String,
) -> Result<Option<ReturnBlob>, AnyError> {
let url = Url::parse(&url)?;