mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
refactor: add CanGc as argument to Promise::reject_native (#35640)
Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
This commit is contained in:
parent
3c3b6cfdc4
commit
31199076ec
18 changed files with 148 additions and 136 deletions
|
@ -605,21 +605,25 @@ impl AsyncWGPUListener for GPUDevice {
|
|||
),
|
||||
can_gc,
|
||||
),
|
||||
Err(webgpu::Error::Validation(msg)) => {
|
||||
promise.reject_native(&GPUPipelineError::new(
|
||||
Err(webgpu::Error::Validation(msg)) => promise.reject_native(
|
||||
&GPUPipelineError::new(
|
||||
&self.global(),
|
||||
msg.into(),
|
||||
GPUPipelineErrorReason::Validation,
|
||||
can_gc,
|
||||
))
|
||||
},
|
||||
),
|
||||
can_gc,
|
||||
),
|
||||
Err(webgpu::Error::OutOfMemory(msg) | webgpu::Error::Internal(msg)) => promise
|
||||
.reject_native(&GPUPipelineError::new(
|
||||
&self.global(),
|
||||
msg.into(),
|
||||
GPUPipelineErrorReason::Internal,
|
||||
.reject_native(
|
||||
&GPUPipelineError::new(
|
||||
&self.global(),
|
||||
msg.into(),
|
||||
GPUPipelineErrorReason::Internal,
|
||||
can_gc,
|
||||
),
|
||||
can_gc,
|
||||
)),
|
||||
),
|
||||
},
|
||||
WebGPUResponse::RenderPipeline(result) => match result {
|
||||
Ok(pipeline) => promise.resolve_native(
|
||||
|
@ -632,21 +636,25 @@ impl AsyncWGPUListener for GPUDevice {
|
|||
),
|
||||
can_gc,
|
||||
),
|
||||
Err(webgpu::Error::Validation(msg)) => {
|
||||
promise.reject_native(&GPUPipelineError::new(
|
||||
Err(webgpu::Error::Validation(msg)) => promise.reject_native(
|
||||
&GPUPipelineError::new(
|
||||
&self.global(),
|
||||
msg.into(),
|
||||
GPUPipelineErrorReason::Validation,
|
||||
can_gc,
|
||||
))
|
||||
},
|
||||
),
|
||||
can_gc,
|
||||
),
|
||||
Err(webgpu::Error::OutOfMemory(msg) | webgpu::Error::Internal(msg)) => promise
|
||||
.reject_native(&GPUPipelineError::new(
|
||||
&self.global(),
|
||||
msg.into(),
|
||||
GPUPipelineErrorReason::Internal,
|
||||
.reject_native(
|
||||
&GPUPipelineError::new(
|
||||
&self.global(),
|
||||
msg.into(),
|
||||
GPUPipelineErrorReason::Internal,
|
||||
can_gc,
|
||||
),
|
||||
can_gc,
|
||||
)),
|
||||
),
|
||||
},
|
||||
_ => unreachable!("Wrong response received on AsyncWGPUListener for GPUDevice"),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue