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

@ -423,6 +423,13 @@ impl HostTrait for HostCallbacks {
}
fn set_clipboard_contents(&self, _contents: String) {}
fn on_devtools_started(&self, port: Result<u16, ()>) {
match port {
Ok(p) => info!("Devtools Server running on port {}", p),
Err(()) => error!("Error running Devtools server"),
}
}
}
pub struct ServoInstance {