Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Optional pipeline_id #25338

Merged
merged 1 commit into from Dec 19, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -320,24 +320,20 @@ impl DedicatedWorkerGlobalScope {
.credentials_mode(CredentialsMode::CredentialsSameOrigin)
.parser_metadata(ParserMetadata::NotParserInserted)
.use_url_credentials(true)
.pipeline_id(pipeline_id)
.pipeline_id(Some(pipeline_id))
.referrer(referrer)
.referrer_policy(referrer_policy)
.origin(origin);

let runtime = unsafe {
if let Some(pipeline_id) = pipeline_id {
let task_source = NetworkingTaskSource(
Box::new(WorkerThreadWorkerChan {
sender: own_sender.clone(),
worker: worker.clone(),
}),
pipeline_id,
);
new_child_runtime(parent, Some(task_source))
} else {
new_child_runtime(parent, None)
}
let task_source = NetworkingTaskSource(
Box::new(WorkerThreadWorkerChan {
sender: own_sender.clone(),
worker: worker.clone(),
}),
pipeline_id,
);
new_child_runtime(parent, Some(task_source))
This conversation was marked as resolved by jdm
Comment on lines 328 to +336

This comment has been minimized.

@warren-fisher

warren-fisher Dec 19, 2019

Author Contributor

Not sure if changing this unsafe block is even ok. Assumed that WorkerScriptLoadOrigin's pipeline_id is never None because it is now changed to be a non-Optional and only created in components/script/dom/serviceworkerregistration.rs and components/script/dom/worker.rs as a non-Optional (after changes)

};

let (devtools_mpsc_chan, devtools_mpsc_port) = unbounded();
@@ -375,7 +371,7 @@ impl DedicatedWorkerGlobalScope {
.send(CommonScriptMsg::Task(
WorkerEvent,
Box::new(SimpleWorkerErrorHandler::new(worker)),
pipeline_id,
Some(pipeline_id),
TaskSourceName::DOMManipulation,
))
.unwrap();
@@ -289,7 +289,7 @@ impl ServiceWorkerGlobalScope {
.credentials_mode(CredentialsMode::Include)
.parser_metadata(ParserMetadata::NotParserInserted)
.use_url_credentials(true)
.pipeline_id(pipeline_id)
.pipeline_id(Some(pipeline_id))
.referrer(referrer)
.referrer_policy(referrer_policy)
.origin(origin);
@@ -110,7 +110,7 @@ impl ServiceWorkerRegistration {
let worker_load_origin = WorkerScriptLoadOrigin {
referrer_url: None,
referrer_policy: None,
pipeline_id: Some(global.pipeline_id()),
pipeline_id: global.pipeline_id(),
};

let worker_id = WorkerId(Uuid::new_v4());
@@ -97,7 +97,7 @@ impl Worker {
let worker_load_origin = WorkerScriptLoadOrigin {
referrer_url: None,
referrer_policy: None,
pipeline_id: Some(global.pipeline_id()),
pipeline_id: global.pipeline_id(),
};

let (devtools_sender, devtools_receiver) = ipc::channel().unwrap();
@@ -962,7 +962,7 @@ pub struct WorkerScriptLoadOrigin {
/// the referrer policy which is used
pub referrer_policy: Option<ReferrerPolicy>,
/// the pipeline id of the entity requesting the load
pub pipeline_id: Option<PipelineId>,
pub pipeline_id: PipelineId,
}

/// Errors from executing a paint worklet
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.