mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
devtools: Make contentType optional in source actor source responses (#38330)
This is allowed by the [protocol docs](https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html#loading-script-sources), and eliminates an unwrap(). Testing: does not get exercised yet, but will be used in #37667 Fixes: part of #36027 Signed-off-by: Delan Azabani <dazabani@igalia.com> Co-authored-by: Delan Azabani <dazabani@igalia.com>
This commit is contained in:
parent
7761030250
commit
4ef15ec42f
2 changed files with 5 additions and 5 deletions
|
@ -52,14 +52,14 @@ pub struct SourceActor {
|
||||||
pub is_black_boxed: bool,
|
pub is_black_boxed: bool,
|
||||||
|
|
||||||
pub content: Option<String>,
|
pub content: Option<String>,
|
||||||
pub content_type: String,
|
pub content_type: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
struct SourceContentReply {
|
struct SourceContentReply {
|
||||||
from: String,
|
from: String,
|
||||||
#[serde(rename = "contentType")]
|
#[serde(rename = "contentType")]
|
||||||
content_type: String,
|
content_type: Option<String>,
|
||||||
source: String,
|
source: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ impl SourceActor {
|
||||||
name: String,
|
name: String,
|
||||||
url: ServoUrl,
|
url: ServoUrl,
|
||||||
content: Option<String>,
|
content: Option<String>,
|
||||||
content_type: String,
|
content_type: Option<String>,
|
||||||
) -> SourceActor {
|
) -> SourceActor {
|
||||||
SourceActor {
|
SourceActor {
|
||||||
name,
|
name,
|
||||||
|
@ -106,7 +106,7 @@ impl SourceActor {
|
||||||
pipeline_id: PipelineId,
|
pipeline_id: PipelineId,
|
||||||
url: ServoUrl,
|
url: ServoUrl,
|
||||||
content: Option<String>,
|
content: Option<String>,
|
||||||
content_type: String,
|
content_type: Option<String>,
|
||||||
) -> &SourceActor {
|
) -> &SourceActor {
|
||||||
let source_actor_name = actors.new_name("source");
|
let source_actor_name = actors.new_name("source");
|
||||||
|
|
||||||
|
|
|
@ -548,7 +548,7 @@ impl DevtoolsInstance {
|
||||||
pipeline_id,
|
pipeline_id,
|
||||||
source_info.url,
|
source_info.url,
|
||||||
source_info.content,
|
source_info.content,
|
||||||
source_info.content_type.unwrap(),
|
source_info.content_type,
|
||||||
);
|
);
|
||||||
let source_actor_name = source_actor.name.clone();
|
let source_actor_name = source_actor.name.clone();
|
||||||
let source_form = source_actor.source_form();
|
let source_form = source_actor.source_form();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue