aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/navigation.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2025-01-11 12:49:22 +0100
committerGitHub <noreply@github.com>2025-01-11 11:49:22 +0000
commit748954d610e5357b19506d0f9390bc769dd32213 (patch)
tree2e035c4dceefe825353cf6b4545d7d3387c98672 /components/script/navigation.rs
parente2be55b873e7bd28c7bd8f92688e7f2035611326 (diff)
downloadservo-748954d610e5357b19506d0f9390bc769dd32213.tar.gz
servo-748954d610e5357b19506d0f9390bc769dd32213.zip
net: Use `RequestId` to cancel fetches instead of creating an IPC channel (#34883)
Instead of creating an IPC channel for every fetch, allow cancelling fetches based on the `RequestId` of the original request. This requires that `RequestId`s be UUIDs so that they are unique between processes that might communicating with the resource process. In addition, the resource process loop now keeps a `HashMap` or `Weak` handles to cancellers and cleans them up. This allows for creating mutiple `FetchCanceller`s in `script` for a single fetch request, allowing integration of the media and video elements to integrate with the `Document` canceller list -- meaning these fetches also get cancelled when the `Document` unloads. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/script/navigation.rs')
-rw-r--r--components/script/navigation.rs3
1 files changed, 0 insertions, 3 deletions
diff --git a/components/script/navigation.rs b/components/script/navigation.rs
index 109b079239f..1ec54ad397e 100644
--- a/components/script/navigation.rs
+++ b/components/script/navigation.rs
@@ -13,7 +13,6 @@ use base::id::{BrowsingContextId, PipelineId, TopLevelBrowsingContextId};
use content_security_policy::Destination;
use crossbeam_channel::Sender;
use http::header;
-use ipc_channel::ipc;
use net_traits::request::{CredentialsMode, RedirectMode, RequestBuilder, RequestMode};
use net_traits::response::ResponseInit;
use net_traits::{
@@ -55,13 +54,11 @@ impl NavigationListener {
self,
core_resource_thread: &CoreResourceThread,
response_init: Option<ResponseInit>,
- cancellation_receiver: Option<ipc::IpcReceiver<()>>,
) {
fetch_async(
core_resource_thread,
self.request_builder.clone(),
response_init,
- cancellation_receiver,
self.into_callback(),
);
}