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

@ -87,6 +87,11 @@ const char *prompt_input(const char *message, const char *default,
}
}
void on_devtools_started(Servo::DevtoolsServerState result,
const unsigned int port) {
// FIXME
}
Servo::Servo(hstring url, hstring args, GLsizei width, GLsizei height,
float dpi, ServoDelegate &aDelegate)
: mWindowHeight(height), mWindowWidth(width), mDelegate(aDelegate) {
@ -147,6 +152,7 @@ Servo::Servo(hstring url, hstring args, GLsizei width, GLsizei height,
c.prompt_ok_cancel = &prompt_ok_cancel;
c.prompt_yes_no = &prompt_yes_no;
c.prompt_input = &prompt_input;
c.on_devtools_started = &on_devtools_started;
capi::register_panic_handler(&on_panic);