From b9c0e7cd550ab14fa7da7e33ed87cbeeeb9785a0 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Sat, 1 Jul 2023 23:52:30 +0100 Subject: Reland "fix(cli): don't store blob and data urls in the module cache" (#18581) Relands #18261 now that https://github.com/lucacasonato/esbuild_deno_loader/pull/54 is landed and used by fresh. Fixes #18260. --- runtime/build.rs | 2 +- runtime/ops/web_worker/sync_fetch.rs | 4 +++- runtime/web_worker.rs | 2 +- runtime/worker.rs | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) (limited to 'runtime') diff --git a/runtime/build.rs b/runtime/build.rs index f656682a1..e5d0067a7 100644 --- a/runtime/build.rs +++ b/runtime/build.rs @@ -298,7 +298,7 @@ mod startup_snapshot { deno_console::deno_console::init_ops_and_esm(), deno_url::deno_url::init_ops_and_esm(), deno_web::deno_web::init_ops_and_esm::( - deno_web::BlobStore::default(), + Default::default(), Default::default(), ), deno_fetch::deno_fetch::init_ops_and_esm::( diff --git a/runtime/ops/web_worker/sync_fetch.rs b/runtime/ops/web_worker/sync_fetch.rs index 4b45f5eca..4d2f4ca5a 100644 --- a/runtime/ops/web_worker/sync_fetch.rs +++ b/runtime/ops/web_worker/sync_fetch.rs @@ -1,5 +1,7 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. +use std::sync::Arc; + use crate::web_worker::WebWorkerInternalHandle; use crate::web_worker::WebWorkerType; use deno_core::error::type_error; @@ -46,7 +48,7 @@ pub fn op_worker_sync_fetch( // URLs when none of the script URLs use the blob scheme. // Also, in which contexts are blob URLs not supported? let blob_store = state - .try_borrow::() + .try_borrow::>() .ok_or_else(|| type_error("Blob URLs are not supported in this context."))? .clone(); diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs index 2dde5a369..3efc98104 100644 --- a/runtime/web_worker.rs +++ b/runtime/web_worker.rs @@ -343,7 +343,7 @@ pub struct WebWorkerOptions { pub worker_type: WebWorkerType, pub maybe_inspector_server: Option>, pub get_error_class_fn: Option, - pub blob_store: BlobStore, + pub blob_store: Arc, pub broadcast_channel: InMemoryBroadcastChannel, pub shared_array_buffer_store: Option, pub compiled_wasm_module_store: Option, diff --git a/runtime/worker.rs b/runtime/worker.rs index 0293c332a..20fb6db84 100644 --- a/runtime/worker.rs +++ b/runtime/worker.rs @@ -123,7 +123,7 @@ pub struct WorkerOptions { pub get_error_class_fn: Option, pub cache_storage_dir: Option, pub origin_storage_dir: Option, - pub blob_store: BlobStore, + pub blob_store: Arc, pub broadcast_channel: InMemoryBroadcastChannel, /// The store to use for transferring SharedArrayBuffers between isolates. -- cgit v1.2.3