1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 15:24:46 -05:00

store debugger url on DenoInspector (#4793)

This commit is contained in:
Bartek Iwańczuk 2020-04-18 12:51:51 +02:00 committed by GitHub
parent 9d53a7a523
commit 10469ec279
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 8 deletions

View file

@ -239,6 +239,7 @@ pub struct DenoInspector {
flags: RefCell<InspectorFlags>,
waker: Arc<InspectorWaker>,
_canary_tx: oneshot::Sender<Never>,
pub debugger_url: String,
}
impl Deref for DenoInspector {
@ -324,6 +325,14 @@ impl DenoInspector {
let (new_websocket_tx, new_websocket_rx) = mpsc::unbounded::<WebSocket>();
let (canary_tx, canary_rx) = oneshot::channel::<Never>();
let info = InspectorInfo {
host,
uuid: Uuid::new_v4(),
thread_name: thread::current().name().map(|n| n.to_owned()),
new_websocket_tx,
canary_rx,
};
// Create DenoInspector instance.
let mut self_ = new_box_with(|self_ptr| {
let v8_inspector_client =
@ -342,6 +351,7 @@ impl DenoInspector {
flags,
waker,
_canary_tx: canary_tx,
debugger_url: info.get_websocket_debugger_url(),
}
});
@ -354,13 +364,6 @@ impl DenoInspector {
// Note: poll_sessions() might block if we need to wait for a
// debugger front-end to connect. Therefore the server thread must to be
// nofified *before* polling.
let info = InspectorInfo {
host,
uuid: Uuid::new_v4(),
thread_name: thread::current().name().map(|n| n.to_owned()),
new_websocket_tx,
canary_rx,
};
InspectorServer::register_inspector(info);
// Poll the session handler so we will get notified whenever there is

View file

@ -92,7 +92,7 @@ pub struct Worker {
pub waker: AtomicWaker,
pub(crate) internal_channels: WorkerChannelsInternal,
external_channels: WorkerHandle,
inspector: Option<Box<DenoInspector>>,
pub(crate) inspector: Option<Box<DenoInspector>>,
}
impl Worker {