mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Remove stub debugger server.
This commit is contained in:
parent
0cae5fd045
commit
79b3cc2a28
8 changed files with 1 additions and 143 deletions
11
Cargo.lock
generated
11
Cargo.lock
generated
|
@ -862,7 +862,6 @@ dependencies = [
|
|||
"canvas_traits",
|
||||
"compositing",
|
||||
"crossbeam-channel",
|
||||
"debugger",
|
||||
"devtools_traits",
|
||||
"embedder_traits",
|
||||
"euclid",
|
||||
|
@ -1217,15 +1216,6 @@ dependencies = [
|
|||
"libdbus-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "debugger"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"crossbeam-channel",
|
||||
"log",
|
||||
"ws",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "deflate"
|
||||
version = "0.7.20"
|
||||
|
@ -3223,7 +3213,6 @@ dependencies = [
|
|||
"compositing",
|
||||
"constellation",
|
||||
"crossbeam-channel",
|
||||
"debugger",
|
||||
"devtools",
|
||||
"devtools_traits",
|
||||
"embedder_traits",
|
||||
|
|
|
@ -108,10 +108,6 @@ pub struct Opts {
|
|||
/// Periodically print out on which events script threads spend their processing time.
|
||||
pub profile_script_events: bool,
|
||||
|
||||
/// `None` to disable debugger or `Some` with a port number to start a server to listen to
|
||||
/// remote Firefox debugger connections.
|
||||
pub debugger_port: Option<u16>,
|
||||
|
||||
/// Port number to start a server to listen to remote Firefox devtools connections.
|
||||
/// 0 for random port.
|
||||
pub devtools_port: u16,
|
||||
|
@ -484,7 +480,6 @@ pub fn default_opts() -> Opts {
|
|||
enable_subpixel_text_antialiasing: true,
|
||||
enable_canvas_antialiasing: true,
|
||||
trace_layout: false,
|
||||
debugger_port: None,
|
||||
devtools_port: 0,
|
||||
devtools_server_enabled: false,
|
||||
webdriver_port: None,
|
||||
|
@ -589,12 +584,6 @@ pub fn from_cmdline_args(mut opts: Options, args: &[String]) -> ArgumentParsingR
|
|||
"soft-fail",
|
||||
"Display about:failure on thread failure instead of exiting",
|
||||
);
|
||||
opts.optflagopt(
|
||||
"",
|
||||
"remote-debugging-port",
|
||||
"Start remote debugger server on port",
|
||||
"2794",
|
||||
);
|
||||
opts.optflagopt("", "devtools", "Start remote devtools server on port", "0");
|
||||
opts.optflagopt(
|
||||
"",
|
||||
|
@ -795,17 +784,6 @@ pub fn from_cmdline_args(mut opts: Options, args: &[String]) -> ArgumentParsingR
|
|||
bubble_inline_sizes_separately = true;
|
||||
}
|
||||
|
||||
let debugger_port = opt_match
|
||||
.opt_default("remote-debugging-port", "2794")
|
||||
.map(|port| {
|
||||
port.parse().unwrap_or_else(|err| {
|
||||
args_fail(&format!(
|
||||
"Error parsing option: --remote-debugging-port ({})",
|
||||
err
|
||||
))
|
||||
})
|
||||
});
|
||||
|
||||
let (devtools_enabled, devtools_port) = if opt_match.opt_present("devtools") {
|
||||
let port = opt_match
|
||||
.opt_str("devtools")
|
||||
|
@ -887,7 +865,6 @@ pub fn from_cmdline_args(mut opts: Options, args: &[String]) -> ArgumentParsingR
|
|||
bubble_inline_sizes_separately: bubble_inline_sizes_separately,
|
||||
profile_script_events: debug_options.profile_script_events,
|
||||
trace_layout: debug_options.trace_layout,
|
||||
debugger_port: debugger_port,
|
||||
devtools_port: devtools_port,
|
||||
devtools_server_enabled: devtools_enabled,
|
||||
webdriver_port: webdriver_port,
|
||||
|
|
|
@ -17,7 +17,6 @@ bluetooth_traits = { path = "../bluetooth_traits" }
|
|||
canvas_traits = { path = "../canvas_traits" }
|
||||
compositing = { path = "../compositing" }
|
||||
crossbeam-channel = "0.4"
|
||||
debugger = { path = "../debugger" }
|
||||
devtools_traits = { path = "../devtools_traits" }
|
||||
embedder_traits = { path = "../embedder_traits" }
|
||||
euclid = "0.20"
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
//! * The font cache, image cache, and resource manager, which load
|
||||
//! and cache shared fonts, images, or other resources.
|
||||
//! * The service worker manager.
|
||||
//! * The devtools, debugger and webdriver servers.
|
||||
//! * The devtools and webdriver servers.
|
||||
//!
|
||||
//! The constellation passes messages between the threads, and updates its state
|
||||
//! to track the evolving state of the browsing context tree.
|
||||
|
@ -356,10 +356,6 @@ pub struct Constellation<Message, LTF, STF, SWF> {
|
|||
/// cache thread.
|
||||
font_cache_thread: FontCacheThread,
|
||||
|
||||
/// A channel for the constellation to send messages to the
|
||||
/// debugger thread.
|
||||
debugger_chan: Option<debugger::Sender>,
|
||||
|
||||
/// A channel for the constellation to send messages to the
|
||||
/// devtools thread.
|
||||
devtools_chan: Option<Sender<DevtoolsControlMsg>>,
|
||||
|
@ -526,9 +522,6 @@ pub struct InitialConstellationState {
|
|||
/// A channel through which messages can be sent to the compositor.
|
||||
pub compositor_proxy: CompositorProxy,
|
||||
|
||||
/// A channel to the debugger, if applicable.
|
||||
pub debugger_chan: Option<debugger::Sender>,
|
||||
|
||||
/// A channel to the developer tools, if applicable.
|
||||
pub devtools_chan: Option<Sender<DevtoolsControlMsg>>,
|
||||
|
||||
|
@ -872,7 +865,6 @@ where
|
|||
compositor_proxy: state.compositor_proxy,
|
||||
active_browser_id: None,
|
||||
browsers: HashMap::new(),
|
||||
debugger_chan: state.debugger_chan,
|
||||
devtools_chan: state.devtools_chan,
|
||||
bluetooth_thread: state.bluetooth_thread,
|
||||
public_resource_threads: state.public_resource_threads,
|
||||
|
@ -2739,10 +2731,6 @@ where
|
|||
warn!("Exit resource thread failed ({})", e);
|
||||
}
|
||||
|
||||
if let Some(ref chan) = self.debugger_chan {
|
||||
debugger::shutdown_server(chan);
|
||||
}
|
||||
|
||||
if let Some(ref chan) = self.devtools_chan {
|
||||
debug!("Exiting devtools.");
|
||||
let msg = DevtoolsControlMsg::FromChrome(ChromeToDevtoolsControlMsg::ServerExitMsg);
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
[package]
|
||||
name = "debugger"
|
||||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
name = "debugger"
|
||||
path = "lib.rs"
|
||||
crate_type = ["rlib"]
|
||||
|
||||
[dependencies]
|
||||
crossbeam-channel = "0.4"
|
||||
log = "0.4"
|
||||
ws = "0.9"
|
|
@ -1,71 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
use std::thread;
|
||||
use ws::{self, Builder, CloseCode, Handler, Handshake};
|
||||
|
||||
enum Message {
|
||||
ShutdownServer,
|
||||
}
|
||||
|
||||
pub struct Sender(crossbeam_channel::Sender<Message>);
|
||||
|
||||
struct Connection {
|
||||
sender: ws::Sender,
|
||||
}
|
||||
|
||||
impl Handler for Connection {
|
||||
fn on_open(&mut self, _: Handshake) -> ws::Result<()> {
|
||||
debug!("Connection opened.");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn on_close(&mut self, _: CloseCode, _: &str) {
|
||||
debug!("Connection closed.");
|
||||
}
|
||||
|
||||
fn on_message(&mut self, message: ws::Message) -> ws::Result<()> {
|
||||
self.sender.send(message)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn start_server(port: u16) -> Sender {
|
||||
debug!("Starting server.");
|
||||
let (sender, receiver) = crossbeam_channel::unbounded();
|
||||
thread::Builder::new()
|
||||
.name("debugger".to_owned())
|
||||
.spawn(move || {
|
||||
let socket = Builder::new()
|
||||
.build(|sender: ws::Sender| Connection { sender: sender })
|
||||
.unwrap();
|
||||
let sender = socket.broadcaster();
|
||||
thread::Builder::new()
|
||||
.name("debugger-websocket".to_owned())
|
||||
.spawn(move || {
|
||||
socket.listen(("127.0.0.1", port)).unwrap();
|
||||
})
|
||||
.expect("Thread spawning failed");
|
||||
while let Ok(message) = receiver.recv() {
|
||||
match message {
|
||||
Message::ShutdownServer => {
|
||||
break;
|
||||
},
|
||||
}
|
||||
}
|
||||
sender.shutdown().unwrap();
|
||||
})
|
||||
.expect("Thread spawning failed");
|
||||
Sender(sender)
|
||||
}
|
||||
|
||||
pub fn shutdown_server(sender: &Sender) {
|
||||
debug!("Shutting down server.");
|
||||
let &Sender(ref sender) = sender;
|
||||
if let Err(_) = sender.send(Message::ShutdownServer) {
|
||||
warn!("Failed to shut down server.");
|
||||
}
|
||||
}
|
|
@ -46,7 +46,6 @@ canvas_traits = { path = "../canvas_traits" }
|
|||
compositing = { path = "../compositing", features = ["gl"] }
|
||||
constellation = { path = "../constellation" }
|
||||
crossbeam-channel = "0.4"
|
||||
debugger = { path = "../debugger" }
|
||||
devtools = { path = "../devtools" }
|
||||
devtools_traits = { path = "../devtools_traits" }
|
||||
embedder_traits = { path = "../embedder_traits" }
|
||||
|
|
|
@ -27,7 +27,6 @@ pub use canvas;
|
|||
pub use canvas_traits;
|
||||
pub use compositing;
|
||||
pub use constellation;
|
||||
pub use debugger;
|
||||
pub use devtools;
|
||||
pub use devtools_traits;
|
||||
pub use embedder_traits;
|
||||
|
@ -354,8 +353,6 @@ where
|
|||
);
|
||||
let mem_profiler_chan = profile_mem::Profiler::create(opts.mem_profiler_period);
|
||||
|
||||
let debugger_chan = opts.debugger_port.map(|port| debugger::start_server(port));
|
||||
|
||||
let devtools_chan = if opts.devtools_server_enabled {
|
||||
Some(devtools::start_server(
|
||||
opts.devtools_port,
|
||||
|
@ -500,7 +497,6 @@ where
|
|||
compositor_proxy.clone(),
|
||||
time_profiler_chan.clone(),
|
||||
mem_profiler_chan.clone(),
|
||||
debugger_chan,
|
||||
devtools_chan,
|
||||
webrender_document,
|
||||
webrender_api_sender,
|
||||
|
@ -857,7 +853,6 @@ fn create_constellation(
|
|||
compositor_proxy: CompositorProxy,
|
||||
time_profiler_chan: time::ProfilerChan,
|
||||
mem_profiler_chan: mem::ProfilerChan,
|
||||
debugger_chan: Option<debugger::Sender>,
|
||||
devtools_chan: Option<Sender<devtools_traits::DevtoolsControlMsg>>,
|
||||
webrender_document: webrender_api::DocumentId,
|
||||
webrender_api_sender: webrender_api::RenderApiSender,
|
||||
|
@ -899,7 +894,6 @@ fn create_constellation(
|
|||
let initial_state = InitialConstellationState {
|
||||
compositor_proxy,
|
||||
embedder_proxy,
|
||||
debugger_chan,
|
||||
devtools_chan,
|
||||
bluetooth_thread,
|
||||
font_cache_thread,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue