mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-15 17:55:15 -10:00
Bug 1975281 - refactor(webgpu): migrate ErrMsg::message from String to Cow<'static, str> r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D255877
This commit is contained in:
1 parent
c94c954f72
commit
1574174eb1
2 files changed
+10
-3
No files matched your search
@@ -6,6 +6,7 @@
|
||||
//! of this module is [`ErrorBuffer`](crate::server::ErrorBuffer).
|
||||
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
error::Error,
|
||||
fmt::{self, Display, Formatter},
|
||||
os::raw::c_char,
|
||||
@@ -163,7 +164,7 @@ pub(crate) enum ErrorBufferType {
|
||||
/// sources. Used for convenience in [`server`](crate::server) code.
|
||||
#[derive(Clone, Debug)]
|
||||
pub(crate) struct ErrMsg {
|
||||
pub(crate) message: String,
|
||||
pub(crate) message: Cow<'static, str>,
|
||||
pub(crate) r#type: ErrorType,
|
||||
}
|
||||
|
||||
|
||||
@@ -2153,7 +2153,7 @@ impl Global {
|
||||
|
||||
error_buf.init(
|
||||
ErrMsg {
|
||||
message: format!("Shader module creation failed: {message}"),
|
||||
message: format!("Shader module creation failed: {message}").into(),
|
||||
r#type: err.webgpu_error_type(),
|
||||
},
|
||||
device_id,
|
||||
@@ -2259,7 +2259,13 @@ impl Global {
|
||||
}
|
||||
}
|
||||
DeviceAction::Error { message, r#type } => {
|
||||
error_buf.init(ErrMsg { message, r#type }, device_id);
|
||||
error_buf.init(
|
||||
ErrMsg {
|
||||
message: message.into(),
|
||||
r#type,
|
||||
},
|
||||
device_id,
|
||||
);
|
||||
}
|
||||
DeviceAction::PushErrorScope(filter) => {
|
||||
unsafe {
|
||||
|
||||
Reference in new issue
Block a user