servo: Merge #16013 - Enable the debugger on Android (from nox:mio); r=larsbergstrom

Apparently mio 0.6.5 now fully supports Android.

Source-Repo: https://github.com/servo/servo
Source-Revision: c2f4a59474692c5e75a388d1c47a2ca0e069bac0

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 361bc658e4f6054dddccf0fcf47f658e0a11cb4b
This commit is contained in:
Anthony Ramine 2017-03-17 08:36:27 -07:00
Родитель 11b31109d6
Коммит c3603de9fc
2 изменённых файлов: 0 добавлений и 18 удалений

Просмотреть файл

@ -12,6 +12,4 @@ crate_type = ["rlib"]
[dependencies]
log = "0.3.5"
[target.'cfg(not(target_os = "android"))'.dependencies]
ws = "0.6"

Просмотреть файл

@ -4,13 +4,11 @@
#[macro_use]
extern crate log;
#[cfg(not(target_os = "android"))]
extern crate ws;
use std::sync::mpsc;
use std::sync::mpsc::channel;
use std::thread;
#[cfg(not(target_os = "android"))]
use ws::{Builder, CloseCode, Handler, Handshake};
enum Message {
@ -19,12 +17,10 @@ enum Message {
pub struct Sender(mpsc::Sender<Message>);
#[cfg(not(target_os = "android"))]
struct Connection {
sender: ws::Sender
}
#[cfg(not(target_os = "android"))]
impl Handler for Connection {
fn on_open(&mut self, _: Handshake) -> ws::Result<()> {
debug!("Connection opened.");
@ -40,7 +36,6 @@ impl Handler for Connection {
}
}
#[cfg(not(target_os = "android"))]
pub fn start_server(port: u16) -> Sender {
debug!("Starting server.");
let (sender, receiver) = channel();
@ -64,12 +59,6 @@ pub fn start_server(port: u16) -> Sender {
Sender(sender)
}
#[cfg(target_os = "android")]
pub fn start_server(_: u16) -> Sender {
panic!("Debugger is not supported on Android");
}
#[cfg(not(target_os = "android"))]
pub fn shutdown_server(sender: &Sender) {
debug!("Shutting down server.");
let &Sender(ref sender) = sender;
@ -77,8 +66,3 @@ pub fn shutdown_server(sender: &Sender) {
warn!("Failed to shut down server.");
}
}
#[cfg(target_os = "android")]
pub fn shutdown_server(_: &Sender) {
panic!("Debugger is not supported on Android");
}