Add support for launching devtools server on random port

Assign random port to devtools server in case user does not specify a
port explicitly and report it to the embedding layer for display to user.
This commit is contained in:
Kunal Mohan 2020-03-07 20:23:14 +05:30
parent 6ab923c8e8
commit 94db0d61cb
No known key found for this signature in database
GPG key ID: 2B475A4524237BAC
10 changed files with 73 additions and 9 deletions

View file

@ -198,6 +198,8 @@ pub enum EmbedderMsg {
/// Notifies the embedder about media session events
/// (i.e. when there is metadata for the active media session, playback state changes...).
MediaSessionEvent(MediaSessionEvent),
/// Report the status of Devtools Server
OnDevtoolsStarted(Result<u16, ()>),
}
impl Debug for EmbedderMsg {
@ -232,6 +234,7 @@ impl Debug for EmbedderMsg {
EmbedderMsg::BrowserCreated(..) => write!(f, "BrowserCreated"),
EmbedderMsg::ReportProfile(..) => write!(f, "ReportProfile"),
EmbedderMsg::MediaSessionEvent(..) => write!(f, "MediaSessionEvent"),
EmbedderMsg::OnDevtoolsStarted(..) => write!(f, "OnDevtoolsStarted"),
}
}
}