aboutsummaryrefslogtreecommitdiffstats
path: root/components/net_traits/request.rs
diff options
context:
space:
mode:
authorDelan Azabani <dazabani@igalia.com>2023-09-06 17:52:37 +0800
committerGitHub <noreply@github.com>2023-09-06 09:52:37 +0000
commitc3c6c95a9b1fd81d740aa8a300174fbbead8f38c (patch)
treecaa4ac1773d0cd1e94160cd17abc3f163e94cbde /components/net_traits/request.rs
parent1b6351486cb7c61f45f6e3c395e73c1582cddf69 (diff)
downloadservo-c3c6c95a9b1fd81d740aa8a300174fbbead8f38c.tar.gz
servo-c3c6c95a9b1fd81d740aa8a300174fbbead8f38c.zip
constellation: crash to a new “sad tab” error page (#30290)
* constellation: crash to a new “sad tab” page * check in resources/crash.html * use a separate enum variant instead of keying on reason * fmt + tidy * rename Resource::Crash to Resource::CrashHTML * clean up crash page and add details (reason + backtrace) * avoid repeating crash errors in script::script_thread warn log * make new LoadData init more idiomatic * clarify comments and new fields * fix doc comment style
Diffstat (limited to 'components/net_traits/request.rs')
-rw-r--r--components/net_traits/request.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/components/net_traits/request.rs b/components/net_traits/request.rs
index 1fb33e37bbd..3a76d3d5185 100644
--- a/components/net_traits/request.rs
+++ b/components/net_traits/request.rs
@@ -254,6 +254,8 @@ pub struct RequestBuilder {
pub initiator: Initiator,
pub https_state: HttpsState,
pub response_tainting: ResponseTainting,
+ /// Servo internal: if crash details are present, trigger a crash error page with these details.
+ pub crash: Option<String>,
}
impl RequestBuilder {
@@ -284,6 +286,7 @@ impl RequestBuilder {
csp_list: None,
https_state: HttpsState::None,
response_tainting: ResponseTainting::Basic,
+ crash: None,
}
}
@@ -382,6 +385,11 @@ impl RequestBuilder {
self
}
+ pub fn crash(mut self, crash: Option<String>) -> Self {
+ self.crash = crash;
+ self
+ }
+
pub fn build(self) -> Request {
let mut request = Request::new(
self.url.clone(),
@@ -415,6 +423,7 @@ impl RequestBuilder {
request.parser_metadata = self.parser_metadata;
request.csp_list = self.csp_list;
request.response_tainting = self.response_tainting;
+ request.crash = self.crash;
request
}
}
@@ -488,6 +497,8 @@ pub struct Request {
#[ignore_malloc_size_of = "Defined in rust-content-security-policy"]
pub csp_list: Option<CspList>,
pub https_state: HttpsState,
+ /// Servo internal: if crash details are present, trigger a crash error page with these details.
+ pub crash: Option<String>,
}
impl Request {
@@ -528,6 +539,7 @@ impl Request {
response_tainting: ResponseTainting::Basic,
csp_list: None,
https_state: https_state,
+ crash: None,
}
}