script: Migrate JobResult to GenericCallback (#39074)

Use the new GenericCallback abstraction for serviceworker job results.

Testing: Covered by service worker wpt tests

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This commit is contained in:
Jonathan Schwender 2025-09-01 19:22:39 +02:00 committed by GitHub
parent fc30a26005
commit eece4c24b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 15 deletions

View file

@ -8,7 +8,7 @@ use std::collections::HashMap;
use std::fmt;
use base::Epoch;
use base::generic_channel::{GenericSender, SendResult};
use base::generic_channel::{GenericCallback, GenericSender, SendResult};
use base::id::{
BroadcastChannelRouterId, BrowsingContextId, HistoryStateId, MessagePortId,
MessagePortRouterId, PipelineId, ServiceWorkerId, ServiceWorkerRegistrationId, WebViewId,
@ -290,7 +290,7 @@ pub struct Job {
/// <https://w3c.github.io/ServiceWorker/#dfn-job-script-url>
pub script_url: ServoUrl,
/// <https://w3c.github.io/ServiceWorker/#dfn-job-client>
pub client: IpcSender<JobResult>,
pub client: GenericCallback<JobResult>,
/// <https://w3c.github.io/ServiceWorker/#job-referrer>
pub referrer: ServoUrl,
/// Various data needed to process job.
@ -303,7 +303,7 @@ impl Job {
job_type: JobType,
scope_url: ServoUrl,
script_url: ServoUrl,
client: IpcSender<JobResult>,
client: GenericCallback<JobResult>,
referrer: ServoUrl,
scope_things: Option<ScopeThings>,
) -> Job {