diff options
Diffstat (limited to 'components')
62 files changed, 286 insertions, 288 deletions
diff --git a/components/atoms/Cargo.toml b/components/atoms/Cargo.toml index dd840f10f42..8d73fb2f70c 100644 --- a/components/atoms/Cargo.toml +++ b/components/atoms/Cargo.toml @@ -11,7 +11,7 @@ workspace = "../.." path = "lib.rs" [dependencies] -string_cache = {version = "0.3", features = ["heap_size"]} +string_cache = {version = "0.4", features = ["heapsize"]} [build-dependencies] string_cache_codegen = "0.3" diff --git a/components/bluetooth/Cargo.toml b/components/bluetooth/Cargo.toml index a3f70a836e5..f8fcb96058d 100644 --- a/components/bluetooth/Cargo.toml +++ b/components/bluetooth/Cargo.toml @@ -13,9 +13,9 @@ path = "lib.rs" bitflags = "0.7" bluetooth_traits = {path = "../bluetooth_traits"} device = {git = "https://github.com/servo/devices", features = ["bluetooth-test"]} -ipc-channel = "0.6.3" +ipc-channel = "0.7" servo_rand = {path = "../rand"} -uuid = {version = "0.3.1", features = ["v4"]} +uuid = {version = "0.4", features = ["v4"]} [target.'cfg(target_os = "linux")'.dependencies] tinyfiledialogs = "2.5.9" diff --git a/components/bluetooth_traits/Cargo.toml b/components/bluetooth_traits/Cargo.toml index 848693c0fd0..59238f61bce 100644 --- a/components/bluetooth_traits/Cargo.toml +++ b/components/bluetooth_traits/Cargo.toml @@ -10,8 +10,8 @@ name = "bluetooth_traits" path = "lib.rs" [dependencies] -ipc-channel = "0.6.3" +ipc-channel = "0.7" regex = "0.2" -serde = "0.8" -serde_derive = "0.8" +serde = "0.9" +serde_derive = "0.9" servo_config = {path = "../config"} diff --git a/components/canvas/Cargo.toml b/components/canvas/Cargo.toml index 3ad194328e6..ebea8e22c72 100644 --- a/components/canvas/Cargo.toml +++ b/components/canvas/Cargo.toml @@ -12,13 +12,13 @@ path = "lib.rs" [dependencies] azure = {git = "https://github.com/servo/rust-azure", features = ["plugins"]} canvas_traits = {path = "../canvas_traits"} -cssparser = {version = "0.9", features = ["heap_size", "serde-serialization"]} -euclid = "0.10.1" +cssparser = {version = "0.10", features = ["heapsize", "serde"]} +euclid = "0.11" gleam = "0.2.8" -ipc-channel = "0.6.3" +ipc-channel = "0.7" log = "0.3.5" num-traits = "0.1.32" -offscreen_gl_context = "0.5.0" +offscreen_gl_context = "0.6" plugins = {path = "../plugins"} servo_config = {path = "../config"} diff --git a/components/canvas_traits/Cargo.toml b/components/canvas_traits/Cargo.toml index d03d60e81dc..64e0cc1f0d5 100644 --- a/components/canvas_traits/Cargo.toml +++ b/components/canvas_traits/Cargo.toml @@ -10,14 +10,14 @@ name = "canvas_traits" path = "lib.rs" [dependencies] -cssparser = {version = "0.9", features = ["heap_size", "serde-serialization"]} -euclid = "0.10.1" +cssparser = {version = "0.10", features = ["heapsize", "serde"]} +euclid = "0.11" heapsize = "0.3.0" heapsize_derive = "0.1" -ipc-channel = "0.6.3" +ipc-channel = "0.7" plugins = {path = "../plugins"} -serde = {version = "0.8", features = ["unstable"]} -serde_derive = "0.8" +serde = {version = "0.9", features = ["unstable"]} +serde_derive = "0.9" [dependencies.webrender_traits] git = "https://github.com/servo/webrender" diff --git a/components/compositing/Cargo.toml b/components/compositing/Cargo.toml index 3ec7281717c..ba89a3d6ab0 100644 --- a/components/compositing/Cargo.toml +++ b/components/compositing/Cargo.toml @@ -10,11 +10,11 @@ name = "compositing" path = "lib.rs" [dependencies] -euclid = "0.10.1" +euclid = "0.11" gfx_traits = {path = "../gfx_traits"} gleam = "0.2.8" image = "0.12" -ipc-channel = "0.6.3" +ipc-channel = "0.7" log = "0.3.5" msg = {path = "../msg"} net_traits = {path = "../net_traits"} diff --git a/components/config/Cargo.toml b/components/config/Cargo.toml index 8cf9def9272..02af22c68fd 100644 --- a/components/config/Cargo.toml +++ b/components/config/Cargo.toml @@ -11,18 +11,18 @@ path = "lib.rs" [features] # servo as opposed to geckolib -servo = ["serde", "serde_derive", "url/heap_size", "url/serde", "plugins"] +servo = ["plugins", "serde", "serde_derive", "servo_url/servo"] [dependencies] -euclid = "0.10.1" +euclid = "0.11" getopts = "0.2.11" lazy_static = "0.2" log = "0.3.5" num_cpus = "1.1.0" plugins = {path = "../plugins", optional = true} rustc-serialize = "0.3" -serde = {version = "0.8", optional = true} -serde_derive = {version = "0.8", optional = true} +serde = {version = "0.9", optional = true} +serde_derive = {version = "0.9", optional = true} servo_geometry = {path = "../geometry"} servo_url = {path = "../url"} url = "1.2" diff --git a/components/constellation/Cargo.toml b/components/constellation/Cargo.toml index edd62d29230..4d3524b9d20 100644 --- a/components/constellation/Cargo.toml +++ b/components/constellation/Cargo.toml @@ -17,20 +17,20 @@ canvas_traits = {path = "../canvas_traits"} compositing = {path = "../compositing"} debugger = {path = "../debugger"} devtools_traits = {path = "../devtools_traits"} -euclid = "0.10.1" +euclid = "0.11" gfx = {path = "../gfx"} gfx_traits = {path = "../gfx_traits"} -ipc-channel = "0.6.3" +ipc-channel = "0.7" layout_traits = {path = "../layout_traits"} log = "0.3.5" msg = {path = "../msg"} net_traits = {path = "../net_traits"} -offscreen_gl_context = "0.5.0" +offscreen_gl_context = "0.6" plugins = {path = "../plugins"} profile_traits = {path = "../profile_traits"} script_traits = {path = "../script_traits"} -serde = "0.8" -serde_derive = "0.8" +serde = "0.9" +serde_derive = "0.9" style_traits = {path = "../style_traits"} servo_config = {path = "../config", features = ["servo"]} servo_rand = {path = "../rand"} diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index 16475c1a7fa..e6b1cb0f89f 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -78,7 +78,7 @@ use event_loop::EventLoop; use frame::{Frame, FrameChange, FrameState, FrameTreeIterator, FullFrameTreeIterator}; use gfx::font_cache_thread::FontCacheThread; use gfx_traits::Epoch; -use ipc_channel::SerializeError; +use ipc_channel::Error; use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::router::ROUTER; use layout_traits::LayoutThreadFactory; @@ -1228,7 +1228,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> self.pipelines.remove(&pipeline_id); } - fn handle_send_error(&mut self, pipeline_id: PipelineId, err: SerializeError) { + fn handle_send_error(&mut self, pipeline_id: PipelineId, err: Error) { // Treat send error the same as receiving a panic message debug!("Pipeline {:?} send error ({}).", pipeline_id, err); let top_level_frame_id = self.get_top_level_frame_for_pipeline(pipeline_id); diff --git a/components/constellation/event_loop.rs b/components/constellation/event_loop.rs index f12333f171e..c20a3e2dadd 100644 --- a/components/constellation/event_loop.rs +++ b/components/constellation/event_loop.rs @@ -6,7 +6,7 @@ //! view of a script thread. When an `EventLoop` is dropped, an `ExitScriptThread` //! message is sent to the script thread, asking it to shut down. -use ipc_channel::SerializeError; +use ipc_channel::Error; use ipc_channel::ipc::IpcSender; use script_traits::ConstellationControlMsg; use std::marker::PhantomData; @@ -34,7 +34,7 @@ impl EventLoop { } /// Send a message to the event loop. - pub fn send(&self, msg: ConstellationControlMsg) -> Result<(), SerializeError> { + pub fn send(&self, msg: ConstellationControlMsg) -> Result<(), Error> { self.script_chan.send(msg) } diff --git a/components/constellation/pipeline.rs b/components/constellation/pipeline.rs index 41dc6cf1667..19c68a2fefc 100644 --- a/components/constellation/pipeline.rs +++ b/components/constellation/pipeline.rs @@ -11,7 +11,7 @@ use euclid::scale_factor::ScaleFactor; use euclid::size::TypedSize2D; use event_loop::EventLoop; use gfx::font_cache_thread::FontCacheThread; -use ipc_channel::SerializeError; +use ipc_channel::Error; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::router::ROUTER; use layout_traits::LayoutThreadFactory; @@ -178,7 +178,7 @@ pub struct InitialPipelineState { impl Pipeline { /// Starts a layout thread, and possibly a script thread, in /// a new process if requested. - pub fn spawn<Message, LTF, STF>(state: InitialPipelineState) -> Result<Pipeline, SerializeError> + pub fn spawn<Message, LTF, STF>(state: InitialPipelineState) -> Result<Pipeline, Error> where LTF: LayoutThreadFactory<Message=Message>, STF: ScriptThreadFactory<Message=Message> { @@ -523,7 +523,7 @@ impl UnprivilegedPipelineContent { } #[cfg(not(target_os = "windows"))] - pub fn spawn_multiprocess(self) -> Result<(), SerializeError> { + pub fn spawn_multiprocess(self) -> Result<(), Error> { use gaol::sandbox::{self, Sandbox, SandboxMethods}; use ipc_channel::ipc::IpcOneShotServer; use sandboxing::content_process_sandbox_profile; @@ -571,7 +571,7 @@ impl UnprivilegedPipelineContent { } #[cfg(target_os = "windows")] - pub fn spawn_multiprocess(self) -> Result<(), SerializeError> { + pub fn spawn_multiprocess(self) -> Result<(), Error> { error!("Multiprocess is not supported on Windows."); process::exit(1); } diff --git a/components/devtools/Cargo.toml b/components/devtools/Cargo.toml index ebfab905527..75ecd3263a3 100644 --- a/components/devtools/Cargo.toml +++ b/components/devtools/Cargo.toml @@ -13,12 +13,12 @@ path = "lib.rs" devtools_traits = {path = "../devtools_traits"} encoding = "0.2" hyper = "0.9.9" -hyper_serde = "0.1.4" -ipc-channel = "0.6.3" +hyper_serde = "0.5" +ipc-channel = "0.7" log = "0.3.5" msg = {path = "../msg"} plugins = {path = "../plugins"} -serde = "0.8" -serde_derive = "0.8" -serde_json = "0.8" +serde = "0.9" +serde_derive = "0.9" +serde_json = "0.9" time = "0.1" diff --git a/components/devtools/actor.rs b/components/devtools/actor.rs index 6d2e4ab1869..1e517bd1ef9 100644 --- a/components/devtools/actor.rs +++ b/components/devtools/actor.rs @@ -5,10 +5,10 @@ /// General actor system infrastructure. use devtools_traits::PreciseTime; -use serde_json::Value; +use serde_json::{Map, Value}; use std::any::Any; use std::cell::{Cell, RefCell}; -use std::collections::{BTreeMap, HashMap}; +use std::collections::HashMap; use std::mem::replace; use std::net::TcpStream; use std::sync::{Arc, Mutex}; @@ -26,7 +26,7 @@ pub trait Actor: Any + ActorAsAny { fn handle_message(&self, registry: &ActorRegistry, msg_type: &str, - msg: &BTreeMap<String, Value>, + msg: &Map<String, Value>, stream: &mut TcpStream) -> Result<ActorMessageStatus, ()>; fn name(&self) -> String; } @@ -150,7 +150,7 @@ impl ActorRegistry { /// Attempt to process a message as directed by its `to` property. If the actor is not /// found or does not indicate that it knew how to process the message, ignore the failure. pub fn handle_message(&mut self, - msg: &BTreeMap<String, Value>, + msg: &Map<String, Value>, stream: &mut TcpStream) -> Result<(), ()> { let to = msg.get("to").unwrap().as_str().unwrap(); diff --git a/components/devtools/actors/console.rs b/components/devtools/actors/console.rs index 99dd0d62811..498426684ca 100644 --- a/components/devtools/actors/console.rs +++ b/components/devtools/actors/console.rs @@ -16,9 +16,8 @@ use devtools_traits::EvaluateJSReply::{NullValue, NumberValue, VoidValue}; use ipc_channel::ipc::{self, IpcSender}; use msg::constellation_msg::PipelineId; use protocol::JsonPacketStream; -use serde_json::{self, Value}; +use serde_json::{self, Map, Number, Value}; use std::cell::RefCell; -use std::collections::BTreeMap; use std::net::TcpStream; trait EncodableConsoleMessage { @@ -50,7 +49,7 @@ struct StartedListenersReply { #[derive(Serialize)] struct GetCachedMessagesReply { from: String, - messages: Vec<BTreeMap<String, Value>>, + messages: Vec<Map<String, Value>>, } #[derive(Serialize)] @@ -98,7 +97,7 @@ impl Actor for ConsoleActor { fn handle_message(&self, registry: &ActorRegistry, msg_type: &str, - msg: &BTreeMap<String, Value>, + msg: &Map<String, Value>, stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { Ok(match msg_type { "getCachedMessages" => { @@ -182,46 +181,46 @@ impl Actor for ConsoleActor { //TODO: extract conversion into protocol module or some other useful place let result = match try!(port.recv().map_err(|_| ())) { VoidValue => { - let mut m = BTreeMap::new(); - m.insert("type".to_owned(), serde_json::to_value("undefined")); + let mut m = Map::new(); + m.insert("type".to_owned(), Value::String("undefined".to_owned())); Value::Object(m) } NullValue => { - let mut m = BTreeMap::new(); - m.insert("type".to_owned(), serde_json::to_value("null")); + let mut m = Map::new(); + m.insert("type".to_owned(), Value::String("null".to_owned())); Value::Object(m) } BooleanValue(val) => Value::Bool(val), NumberValue(val) => { if val.is_nan() { - let mut m = BTreeMap::new(); - m.insert("type".to_owned(), serde_json::to_value("NaN")); + let mut m = Map::new(); + m.insert("type".to_owned(), Value::String("NaN".to_owned())); Value::Object(m) } else if val.is_infinite() { - let mut m = BTreeMap::new(); + let mut m = Map::new(); if val < 0. { - m.insert("type".to_owned(), serde_json::to_value("-Infinity")); + m.insert("type".to_owned(), Value::String("-Infinity".to_owned())); } else { - m.insert("type".to_owned(), serde_json::to_value("Infinity")); + m.insert("type".to_owned(), Value::String("Infinity".to_owned())); } Value::Object(m) } else if val == 0. && val.is_sign_negative() { - let mut m = BTreeMap::new(); - m.insert("type".to_owned(), serde_json::to_value("-0")); + let mut m = Map::new(); + m.insert("type".to_owned(), Value::String("-0".to_owned())); Value::Object(m) } else { - serde_json::to_value(&val) + Value::Number(Number::from_f64(val).unwrap()) } } StringValue(s) => Value::String(s), ActorValue { class, uuid } => { //TODO: make initial ActorValue message include these properties? - let mut m = BTreeMap::new(); + let mut m = Map::new(); let actor = ObjectActor::new(registry, uuid); - m.insert("type".to_owned(), serde_json::to_value("object")); - m.insert("class".to_owned(), serde_json::to_value(&class)); - m.insert("actor".to_owned(), serde_json::to_value(&actor)); + m.insert("type".to_owned(), Value::String("object".to_owned())); + m.insert("class".to_owned(), Value::String(class)); + m.insert("actor".to_owned(), Value::String(actor)); m.insert("extensible".to_owned(), Value::Bool(true)); m.insert("frozen".to_owned(), Value::Bool(false)); m.insert("sealed".to_owned(), Value::Bool(false)); @@ -235,9 +234,9 @@ impl Actor for ConsoleActor { input: input, result: result, timestamp: 0, - exception: Value::Object(BTreeMap::new()), + exception: Value::Object(Map::new()), exceptionMessage: "".to_owned(), - helperResult: Value::Object(BTreeMap::new()), + helperResult: Value::Object(Map::new()), }; stream.write_json_packet(&msg); ActorMessageStatus::Processed diff --git a/components/devtools/actors/framerate.rs b/components/devtools/actors/framerate.rs index 01c00796369..e5edc70c6b2 100644 --- a/components/devtools/actors/framerate.rs +++ b/components/devtools/actors/framerate.rs @@ -7,8 +7,7 @@ use actors::timeline::HighResolutionStamp; use devtools_traits::DevtoolScriptControlMsg; use ipc_channel::ipc::IpcSender; use msg::constellation_msg::PipelineId; -use serde_json::Value; -use std::collections::BTreeMap; +use serde_json::{Map, Value}; use std::mem; use std::net::TcpStream; use time::precise_time_ns; @@ -31,7 +30,7 @@ impl Actor for FramerateActor { fn handle_message(&self, _registry: &ActorRegistry, _msg_type: &str, - _msg: &BTreeMap<String, Value>, + _msg: &Map<String, Value>, _stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { Ok(ActorMessageStatus::Ignored) } diff --git a/components/devtools/actors/inspector.rs b/components/devtools/actors/inspector.rs index aa500699686..9749b69e813 100644 --- a/components/devtools/actors/inspector.rs +++ b/components/devtools/actors/inspector.rs @@ -12,9 +12,8 @@ use devtools_traits::DevtoolScriptControlMsg::{GetLayout, ModifyAttribute}; use ipc_channel::ipc::{self, IpcSender}; use msg::constellation_msg::PipelineId; use protocol::JsonPacketStream; -use serde_json::{self, Value}; +use serde_json::{self, Map, Value}; use std::cell::RefCell; -use std::collections::BTreeMap; use std::net::TcpStream; pub struct InspectorActor { @@ -65,7 +64,7 @@ impl Actor for HighlighterActor { fn handle_message(&self, _registry: &ActorRegistry, msg_type: &str, - _msg: &BTreeMap<String, Value>, + _msg: &Map<String, Value>, stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { Ok(match msg_type { "showBoxModel" => { @@ -102,7 +101,7 @@ impl Actor for NodeActor { fn handle_message(&self, registry: &ActorRegistry, msg_type: &str, - msg: &BTreeMap<String, Value>, + msg: &Map<String, Value>, stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { Ok(match msg_type { "modifyAttributes" => { @@ -276,7 +275,7 @@ impl Actor for WalkerActor { fn handle_message(&self, registry: &ActorRegistry, msg_type: &str, - msg: &BTreeMap<String, Value>, + msg: &Map<String, Value>, stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { Ok(match msg_type { "querySelector" => { @@ -451,7 +450,7 @@ impl Actor for PageStyleActor { fn handle_message(&self, registry: &ActorRegistry, msg_type: &str, - msg: &BTreeMap<String, Value>, + msg: &Map<String, Value>, stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { Ok(match msg_type { "getApplied" => { @@ -503,7 +502,7 @@ impl Actor for PageStyleActor { zIndex: zIndex, boxSizing: boxSizing, autoMargins: if auto_margins { - let mut m = BTreeMap::new(); + let mut m = Map::new(); let auto = serde_json::value::Value::String("auto".to_owned()); if autoMargins.top { m.insert("top".to_owned(), auto.clone()); } if autoMargins.right { m.insert("right".to_owned(), auto.clone()); } @@ -547,7 +546,7 @@ impl Actor for InspectorActor { fn handle_message(&self, registry: &ActorRegistry, msg_type: &str, - _msg: &BTreeMap<String, Value>, + _msg: &Map<String, Value>, stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { Ok(match msg_type { "getWalker" => { diff --git a/components/devtools/actors/memory.rs b/components/devtools/actors/memory.rs index 6a97e6448b8..25dc2733b66 100644 --- a/components/devtools/actors/memory.rs +++ b/components/devtools/actors/memory.rs @@ -3,8 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use actor::{Actor, ActorMessageStatus, ActorRegistry}; -use serde_json::Value; -use std::collections::BTreeMap; +use serde_json::{Map, Value}; use std::net::TcpStream; #[derive(Serialize)] @@ -32,7 +31,7 @@ impl Actor for MemoryActor { fn handle_message(&self, _registry: &ActorRegistry, _msg_type: &str, - _msg: &BTreeMap<String, Value>, + _msg: &Map<String, Value>, _stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { Ok(ActorMessageStatus::Ignored) } diff --git a/components/devtools/actors/network_event.rs b/components/devtools/actors/network_event.rs index f4f513159aa..3d63a5ea691 100644 --- a/components/devtools/actors/network_event.rs +++ b/components/devtools/actors/network_event.rs @@ -16,9 +16,8 @@ use hyper::header::Headers; use hyper::http::RawStatus; use hyper::method::Method; use protocol::JsonPacketStream; -use serde_json::Value; +use serde_json::{Map, Value}; use std::borrow::Cow; -use std::collections::BTreeMap; use std::net::TcpStream; use time; use time::Tm; @@ -185,7 +184,7 @@ impl Actor for NetworkEventActor { fn handle_message(&self, _registry: &ActorRegistry, msg_type: &str, - _msg: &BTreeMap<String, Value>, + _msg: &Map<String, Value>, stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { Ok(match msg_type { "getRequestHeaders" => { diff --git a/components/devtools/actors/object.rs b/components/devtools/actors/object.rs index c950967e418..81f972a763c 100644 --- a/components/devtools/actors/object.rs +++ b/components/devtools/actors/object.rs @@ -3,8 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use actor::{Actor, ActorMessageStatus, ActorRegistry}; -use serde_json::Value; -use std::collections::BTreeMap; +use serde_json::{Map, Value}; use std::net::TcpStream; pub struct ObjectActor { @@ -19,7 +18,7 @@ impl Actor for ObjectActor { fn handle_message(&self, _: &ActorRegistry, _: &str, - _: &BTreeMap<String, Value>, + _: &Map<String, Value>, _: &mut TcpStream) -> Result<ActorMessageStatus, ()> { Ok(ActorMessageStatus::Ignored) } diff --git a/components/devtools/actors/performance.rs b/components/devtools/actors/performance.rs index 6d0bc2556e0..c246cb26fa4 100644 --- a/components/devtools/actors/performance.rs +++ b/components/devtools/actors/performance.rs @@ -4,8 +4,7 @@ use actor::{Actor, ActorMessageStatus, ActorRegistry}; use protocol::{ActorDescription, JsonPacketStream, Method}; -use serde_json::Value; -use std::collections::BTreeMap; +use serde_json::{Map, Value}; use std::net::TcpStream; pub struct PerformanceActor { @@ -55,7 +54,7 @@ impl Actor for PerformanceActor { fn handle_message(&self, _registry: &ActorRegistry, msg_type: &str, - _msg: &BTreeMap<String, Value>, + _msg: &Map<String, Value>, stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { Ok(match msg_type { "connect" => { diff --git a/components/devtools/actors/profiler.rs b/components/devtools/actors/profiler.rs index 9de9364744a..a80e3c0018b 100644 --- a/components/devtools/actors/profiler.rs +++ b/components/devtools/actors/profiler.rs @@ -3,8 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use actor::{Actor, ActorMessageStatus, ActorRegistry}; -use serde_json::Value; -use std::collections::BTreeMap; +use serde_json::{Map, Value}; use std::net::TcpStream; pub struct ProfilerActor { @@ -19,7 +18,7 @@ impl Actor for ProfilerActor { fn handle_message(&self, _registry: &ActorRegistry, _msg_type: &str, - _msg: &BTreeMap<String, Value>, + _msg: &Map<String, Value>, _stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { Ok(ActorMessageStatus::Ignored) } diff --git a/components/devtools/actors/root.rs b/components/devtools/actors/root.rs index 1885e775ff6..20629ea7a7b 100644 --- a/components/devtools/actors/root.rs +++ b/components/devtools/actors/root.rs @@ -11,8 +11,7 @@ use actor::{Actor, ActorMessageStatus, ActorRegistry}; use actors::performance::PerformanceActor; use actors::tab::{TabActor, TabActorMsg}; use protocol::{ActorDescription, JsonPacketStream}; -use serde_json::Value; -use std::collections::BTreeMap; +use serde_json::{Map, Value}; use std::net::TcpStream; #[derive(Serialize)] @@ -69,7 +68,7 @@ impl Actor for RootActor { fn handle_message(&self, registry: &ActorRegistry, msg_type: &str, - _msg: &BTreeMap<String, Value>, + _msg: &Map<String, Value>, stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { Ok(match msg_type { "listAddons" => { diff --git a/components/devtools/actors/tab.rs b/components/devtools/actors/tab.rs index 53b3766b124..916c5319386 100644 --- a/components/devtools/actors/tab.rs +++ b/components/devtools/actors/tab.rs @@ -11,8 +11,7 @@ use actor::{Actor, ActorMessageStatus, ActorRegistry}; use actors::console::ConsoleActor; use devtools_traits::DevtoolScriptControlMsg::{self, WantsLiveNotifications}; use protocol::JsonPacketStream; -use serde_json::Value; -use std::collections::BTreeMap; +use serde_json::{Map, Value}; use std::net::TcpStream; #[derive(Serialize)] @@ -88,7 +87,7 @@ impl Actor for TabActor { fn handle_message(&self, registry: &ActorRegistry, msg_type: &str, - msg: &BTreeMap<String, Value>, + msg: &Map<String, Value>, stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { Ok(match msg_type { "reconfigure" => { diff --git a/components/devtools/actors/thread.rs b/components/devtools/actors/thread.rs index 102f428bc8b..7be5bc55f23 100644 --- a/components/devtools/actors/thread.rs +++ b/components/devtools/actors/thread.rs @@ -4,8 +4,7 @@ use actor::{Actor, ActorMessageStatus, ActorRegistry}; use protocol::JsonPacketStream; -use serde_json::Value; -use std::collections::BTreeMap; +use serde_json::{Map, Value}; use std::net::TcpStream; #[derive(Serialize)] @@ -68,7 +67,7 @@ impl Actor for ThreadActor { fn handle_message(&self, registry: &ActorRegistry, msg_type: &str, - _msg: &BTreeMap<String, Value>, + _msg: &Map<String, Value>, stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { Ok(match msg_type { "attach" => { diff --git a/components/devtools/actors/timeline.rs b/components/devtools/actors/timeline.rs index 6285faafabf..1fdb7b0c408 100644 --- a/components/devtools/actors/timeline.rs +++ b/components/devtools/actors/timeline.rs @@ -12,9 +12,8 @@ use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use msg::constellation_msg::PipelineId; use protocol::JsonPacketStream; use serde::{Serialize, Serializer}; -use serde_json::Value; +use serde_json::{Map, Value}; use std::cell::RefCell; -use std::collections::BTreeMap; use std::net::TcpStream; use std::sync::{Arc, Mutex}; use std::thread; @@ -115,7 +114,7 @@ impl HighResolutionStamp { } impl Serialize for HighResolutionStamp { - fn serialize<S: Serializer>(&self, s: &mut S) -> Result<(), S::Error> { + fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error> { self.0.serialize(s) } } @@ -175,7 +174,7 @@ impl Actor for TimelineActor { fn handle_message(&self, registry: &ActorRegistry, msg_type: &str, - msg: &BTreeMap<String, Value>, + msg: &Map<String, Value>, stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { Ok(match msg_type { "start" => { diff --git a/components/devtools/actors/worker.rs b/components/devtools/actors/worker.rs index 7e1301db43e..1beead719dc 100644 --- a/components/devtools/actors/worker.rs +++ b/components/devtools/actors/worker.rs @@ -4,8 +4,7 @@ use actor::{Actor, ActorMessageStatus, ActorRegistry}; use devtools_traits::WorkerId; -use serde_json::Value; -use std::collections::BTreeMap; +use serde_json::{Map, Value}; use std::net::TcpStream; pub struct WorkerActor { @@ -21,7 +20,7 @@ impl Actor for WorkerActor { fn handle_message(&self, _: &ActorRegistry, _: &str, - _: &BTreeMap<String, Value>, + _: &Map<String, Value>, _: &mut TcpStream) -> Result<ActorMessageStatus, ()> { Ok(ActorMessageStatus::Processed) } diff --git a/components/devtools/protocol.rs b/components/devtools/protocol.rs index eb46ed38489..f0bfce4b3d7 100644 --- a/components/devtools/protocol.rs +++ b/components/devtools/protocol.rs @@ -40,9 +40,9 @@ impl JsonPacketStream for TcpStream { } fn write_merged_json_packet<T: Serialize, U: Serialize>(&mut self, base: &T, extra: &U) { - let mut obj = serde_json::to_value(base); + let mut obj = serde_json::to_value(base).unwrap(); let obj = obj.as_object_mut().unwrap(); - let extra = serde_json::to_value(extra); + let extra = serde_json::to_value(extra).unwrap(); let extra = extra.as_object().unwrap(); for (key, value) in extra { @@ -79,14 +79,7 @@ impl JsonPacketStream for TcpStream { debug!("{}", packet); return match serde_json::from_str(&packet) { Ok(json) => Ok(Some(json)), - Err(err) => match err { - serde_json::Error::Io(ioerr) => { - return Err(ioerr.description().to_owned()) - }, - serde_json::Error::Syntax(_, l, c) => { - return Err(format!("syntax at {}:{}", l, c)) - }, - }, + Err(err) => Err(err.description().to_owned()), }; }, c => buffer.push(c), diff --git a/components/devtools_traits/Cargo.toml b/components/devtools_traits/Cargo.toml index 4ccb83dcf28..542c803b8e9 100644 --- a/components/devtools_traits/Cargo.toml +++ b/components/devtools_traits/Cargo.toml @@ -14,10 +14,10 @@ bitflags = "0.7" heapsize = "0.3.0" heapsize_derive = "0.1" hyper = "0.9.9" -hyper_serde = "0.1.4" -ipc-channel = "0.6.3" +hyper_serde = "0.5" +ipc-channel = "0.7" msg = {path = "../msg"} -serde = "0.8" -serde_derive = "0.8" +serde = "0.9" +serde_derive = "0.9" servo_url = {path = "../url"} time = "0.1" diff --git a/components/geometry/Cargo.toml b/components/geometry/Cargo.toml index 28480439060..73368f5dfbf 100644 --- a/components/geometry/Cargo.toml +++ b/components/geometry/Cargo.toml @@ -11,9 +11,9 @@ path = "lib.rs" [features] # servo as opposed to geckolib -servo = ["app_units/plugins", "euclid/unstable"] +servo = ["euclid/unstable"] [dependencies] -app_units = "0.3" -euclid = "0.10.1" +app_units = "0.4" +euclid = "0.11" heapsize = "0.3.0" diff --git a/components/gfx/Cargo.toml b/components/gfx/Cargo.toml index 2a8cfb939ad..c51adb5d5c4 100644 --- a/components/gfx/Cargo.toml +++ b/components/gfx/Cargo.toml @@ -11,16 +11,16 @@ name = "gfx" path = "lib.rs" [dependencies] -app_units = "0.3" +app_units = "0.4" bitflags = "0.7" -euclid = "0.10.1" +euclid = "0.11" fnv = "1.0" fontsan = {git = "https://github.com/servo/fontsan"} gfx_traits = {path = "../gfx_traits"} harfbuzz-sys = "0.1" heapsize = "0.3.0" heapsize_derive = "0.1" -ipc-channel = "0.6.3" +ipc-channel = "0.7" lazy_static = "0.2" libc = "0.2" log = "0.3.5" @@ -29,8 +29,8 @@ net_traits = {path = "../net_traits"} ordered-float = "0.4" plugins = {path = "../plugins"} range = {path = "../range"} -serde = "0.8" -serde_derive = "0.8" +serde = "0.9" +serde_derive = "0.9" servo_atoms = {path = "../atoms"} servo_geometry = {path = "../geometry"} servo_url = {path = "../url"} @@ -49,8 +49,8 @@ features = ["serde_derive", "ipc"] [target.'cfg(target_os = "macos")'.dependencies] byteorder = "1.0" core-foundation = "0.3" -core-graphics = "0.6" -core-text = "3.0" +core-graphics = "0.7" +core-text = "4.0" [target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies] freetype = "0.2" @@ -60,5 +60,5 @@ servo-fontconfig = "0.2.1" simd = "0.2.0" [target.'cfg(target_os = "windows")'.dependencies] -dwrote = "0.1.5" +dwrote = {git = "https://github.com/servo/dwrote-rs.git", rev = "servo"} truetype = "0.26" diff --git a/components/gfx/platform/macos/font_template.rs b/components/gfx/platform/macos/font_template.rs index cba1738b926..3465f935360 100644 --- a/components/gfx/platform/macos/font_template.rs +++ b/components/gfx/platform/macos/font_template.rs @@ -13,6 +13,7 @@ use servo_atoms::Atom; use servo_url::ServoUrl; use std::borrow::ToOwned; use std::collections::HashMap; +use std::fmt; use std::fs::File; use std::io::{Read, Error as IoError}; use std::ops::Deref; @@ -121,21 +122,25 @@ impl Deref for CachedCTFont { } impl Serialize for CachedCTFont { - fn serialize<S>(&self, serializer: &mut S) -> Result<(), S::Error> where S: Serializer { + fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: Serializer { serializer.serialize_none() } } impl Deserialize for CachedCTFont { - fn deserialize<D>(deserializer: &mut D) -> Result<CachedCTFont, D::Error> + fn deserialize<D>(deserializer: D) -> Result<CachedCTFont, D::Error> where D: Deserializer { struct NoneOptionVisitor; impl Visitor for NoneOptionVisitor { type Value = CachedCTFont; + fn expecting(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + write!(fmt, "none") + } + #[inline] - fn visit_none<E>(&mut self) -> Result<CachedCTFont, E> where E: Error { + fn visit_none<E>(self) -> Result<CachedCTFont, E> where E: Error { Ok(CachedCTFont(Mutex::new(HashMap::new()))) } } diff --git a/components/gfx_traits/Cargo.toml b/components/gfx_traits/Cargo.toml index 8ea8ca14f82..f832ebb3004 100644 --- a/components/gfx_traits/Cargo.toml +++ b/components/gfx_traits/Cargo.toml @@ -14,5 +14,5 @@ heapsize = "0.3.0" heapsize_derive = "0.1" plugins = {path = "../plugins"} range = {path = "../range"} -serde = "0.8" -serde_derive = "0.8" +serde = "0.9" +serde_derive = "0.9" diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml index 9a7a640a989..85b7ddb1d38 100644 --- a/components/layout/Cargo.toml +++ b/components/layout/Cargo.toml @@ -10,18 +10,18 @@ name = "layout" path = "lib.rs" [dependencies] -app_units = "0.3" +app_units = "0.4" atomic_refcell = "0.1" bitflags = "0.7" canvas_traits = {path = "../canvas_traits"} -cssparser = {version = "0.9", features = ["heap_size", "serde-serialization"]} -euclid = "0.10.1" +cssparser = {version = "0.10", features = ["heapsize", "serde"]} +euclid = "0.11" fnv = "1.0" gfx = {path = "../gfx"} gfx_traits = {path = "../gfx_traits"} heapsize = "0.3.0" -html5ever-atoms = "0.1" -ipc-channel = "0.6.3" +html5ever-atoms = "0.2" +ipc-channel = "0.7" libc = "0.2" log = "0.3.5" msg = {path = "../msg"} @@ -35,10 +35,10 @@ rayon = "0.6" script_layout_interface = {path = "../script_layout_interface"} script_traits = {path = "../script_traits"} selectors = { path = "../selectors" } -serde = "0.8" -serde_derive = "0.8" +serde = "0.9" +serde_derive = "0.9" servo_geometry = {path = "../geometry"} -serde_json = "0.8" +serde_json = "0.9" servo_config = {path = "../config"} servo_url = {path = "../url"} smallvec = "0.1" diff --git a/components/layout/block.rs b/components/layout/block.rs index 00cfa774c06..5f526e3c09f 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -524,7 +524,7 @@ bitflags! { } impl Serialize for BlockFlowFlags { - fn serialize<S: Serializer>(&self, serializer: &mut S) -> Result<(), S::Error> { + fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> { self.bits().serialize(serializer) } } diff --git a/components/layout/flow.rs b/components/layout/flow.rs index aa9d600243c..0ad6540724b 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -42,7 +42,7 @@ use inline::InlineFlow; use model::{CollapsibleMargins, IntrinsicISizes, MarginCollapseInfo}; use multicol::MulticolFlow; use parallel::FlowParallelInfo; -use serde::{Serialize, Serializer}; +use serde::ser::{Serialize, SerializeStruct, Serializer}; use servo_geometry::{au_rect_to_f32_rect, f32_rect_to_au_rect}; use std::{fmt, mem, raw}; use std::iter::Zip; @@ -1013,16 +1013,16 @@ impl fmt::Debug for BaseFlow { } impl Serialize for BaseFlow { - fn serialize<S: Serializer>(&self, serializer: &mut S) -> Result<(), S::Error> { - let mut state = try!(serializer.serialize_struct("base", 5)); - try!(serializer.serialize_struct_elt(&mut state, "id", self.debug_id())); - try!(serializer.serialize_struct_elt(&mut state, "stacking_relative_position", - &self.stacking_relative_position)); - try!(serializer.serialize_struct_elt(&mut state, "intrinsic_inline_sizes", - &self.intrinsic_inline_sizes)); - try!(serializer.serialize_struct_elt(&mut state, "position", &self.position)); - try!(serializer.serialize_struct_elt(&mut state, "children", &self.children)); - serializer.serialize_struct_end(state) + fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> { + let mut serializer = try!(serializer.serialize_struct("base", 5)); + try!(serializer.serialize_field("id", &self.debug_id())); + try!(serializer.serialize_field("stacking_relative_position", + &self.stacking_relative_position)); + try!(serializer.serialize_field("intrinsic_inline_sizes", + &self.intrinsic_inline_sizes)); + try!(serializer.serialize_field("position", &self.position)); + try!(serializer.serialize_field("children", &self.children)); + serializer.end() } } diff --git a/components/layout/flow_list.rs b/components/layout/flow_list.rs index 42ff71bf4ea..60423bad154 100644 --- a/components/layout/flow_list.rs +++ b/components/layout/flow_list.rs @@ -4,9 +4,8 @@ use flow::{Flow, FlowClass}; use flow_ref::FlowRef; -use serde::{Serialize, Serializer}; -use serde_json::{to_value, Value}; -use serde_json::builder::ObjectBuilder; +use serde::ser::{Serialize, SerializeSeq, Serializer}; +use serde_json::{Map, Value, to_value}; use std::collections::{LinkedList, linked_list}; use std::sync::Arc; @@ -24,30 +23,29 @@ pub struct FlowList { } impl Serialize for FlowList { - fn serialize<S: Serializer>(&self, serializer: &mut S) -> Result<(), S::Error> { - let mut state = try!(serializer.serialize_seq(Some(self.len()))); + fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> { + let mut serializer = try!(serializer.serialize_seq(Some(self.len()))); for f in self.iter() { - let flow_val = ObjectBuilder::new() - .insert("class", f.class()) - .insert("data", match f.class() { - FlowClass::Block => to_value(f.as_block()), - FlowClass::Inline => to_value(f.as_inline()), - FlowClass::Table => to_value(f.as_table()), - FlowClass::TableWrapper => to_value(f.as_table_wrapper()), - FlowClass::TableRowGroup => to_value(f.as_table_rowgroup()), - FlowClass::TableRow => to_value(f.as_table_row()), - FlowClass::TableCell => to_value(f.as_table_cell()), - FlowClass::Flex => to_value(f.as_flex()), - FlowClass::ListItem | FlowClass::TableColGroup | FlowClass::TableCaption | - FlowClass::Multicol | FlowClass::MulticolColumn => { - Value::Null // Not implemented yet - } - }) - .build(); - - try!(serializer.serialize_seq_elt(&mut state, flow_val)); + let mut flow_val = Map::new(); + flow_val.insert("class".to_owned(), to_value(f.class()).unwrap()); + let data = match f.class() { + FlowClass::Block => to_value(f.as_block()).unwrap(), + FlowClass::Inline => to_value(f.as_inline()).unwrap(), + FlowClass::Table => to_value(f.as_table()).unwrap(), + FlowClass::TableWrapper => to_value(f.as_table_wrapper()).unwrap(), + FlowClass::TableRowGroup => to_value(f.as_table_rowgroup()).unwrap(), + FlowClass::TableRow => to_value(f.as_table_row()).unwrap(), + FlowClass::TableCell => to_value(f.as_table_cell()).unwrap(), + FlowClass::Flex => to_value(f.as_flex()).unwrap(), + FlowClass::ListItem | FlowClass::TableColGroup | FlowClass::TableCaption | + FlowClass::Multicol | FlowClass::MulticolColumn => { + Value::Null // Not implemented yet + } + }; + flow_val.insert("data".to_owned(), data); + try!(serializer.serialize_element(&flow_val)); } - serializer.serialize_seq_end(state) + serializer.end() } } diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index 8f17894bc98..ec1e87e6dd2 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -32,7 +32,7 @@ use range::*; use script_layout_interface::HTMLCanvasData; use script_layout_interface::SVGSVGData; use script_layout_interface::wrapper_traits::{PseudoElementType, ThreadSafeLayoutElement, ThreadSafeLayoutNode}; -use serde::{Serialize, Serializer}; +use serde::ser::{Serialize, SerializeStruct, Serializer}; use servo_url::ServoUrl; use std::{f32, fmt}; use std::borrow::ToOwned; @@ -142,12 +142,12 @@ pub struct Fragment { } impl Serialize for Fragment { - fn serialize<S: Serializer>(&self, serializer: &mut S) -> Result<(), S::Error> { - let mut state = try!(serializer.serialize_struct("fragment", 3)); - try!(serializer.serialize_struct_elt(&mut state, "id", &self.debug_id)); - try!(serializer.serialize_struct_elt(&mut state, "border_box", &self.border_box)); - try!(serializer.serialize_struct_elt(&mut state, "margin", &self.margin)); - serializer.serialize_struct_end(state) + fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> { + let mut serializer = try!(serializer.serialize_struct("fragment", 3)); + try!(serializer.serialize_field("id", &self.debug_id)); + try!(serializer.serialize_field("border_box", &self.border_box)); + try!(serializer.serialize_field("margin", &self.margin)); + serializer.end() } } @@ -3179,14 +3179,14 @@ impl fmt::Display for DebugId { #[cfg(not(debug_assertions))] impl Serialize for DebugId { - fn serialize<S: Serializer>(&self, serializer: &mut S) -> Result<(), S::Error> { + fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> { serializer.serialize_str(&format!("{:p}", &self)) } } #[cfg(debug_assertions)] impl Serialize for DebugId { - fn serialize<S: Serializer>(&self, serializer: &mut S) -> Result<(), S::Error> { + fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> { serializer.serialize_u16(self.0) } } diff --git a/components/layout/layout_debug.rs b/components/layout/layout_debug.rs index 9b67077add0..84ee68becc2 100644 --- a/components/layout/layout_debug.rs +++ b/components/layout/layout_debug.rs @@ -63,7 +63,7 @@ impl Scope { pub fn new(name: String) -> Scope { STATE_KEY.with(|ref r| { if let Some(ref mut state) = *r.borrow_mut() { - let flow_trace = to_value(&flow::base(&*state.flow_root)); + let flow_trace = to_value(&flow::base(&*state.flow_root)).unwrap(); let data = box ScopeData::new(name.clone(), flow_trace); state.scope_stack.push(data); } @@ -78,7 +78,7 @@ impl Drop for Scope { STATE_KEY.with(|ref r| { if let Some(ref mut state) = *r.borrow_mut() { let mut current_scope = state.scope_stack.pop().unwrap(); - current_scope.post = to_value(&flow::base(&*state.flow_root)); + current_scope.post = to_value(&flow::base(&*state.flow_root)).unwrap(); let previous_scope = state.scope_stack.last_mut().unwrap(); previous_scope.children.push(current_scope); } @@ -100,7 +100,7 @@ pub fn begin_trace(flow_root: FlowRef) { assert!(STATE_KEY.with(|ref r| r.borrow().is_none())); STATE_KEY.with(|ref r| { - let flow_trace = to_value(&flow::base(&*flow_root)); + let flow_trace = to_value(&flow::base(&*flow_root)).unwrap(); let state = State { scope_stack: vec![box ScopeData::new("root".to_owned(), flow_trace)], flow_root: flow_root.clone(), @@ -116,7 +116,7 @@ pub fn end_trace(generation: u32) { let mut thread_state = STATE_KEY.with(|ref r| r.borrow_mut().take().unwrap()); assert!(thread_state.scope_stack.len() == 1); let mut root_scope = thread_state.scope_stack.pop().unwrap(); - root_scope.post = to_value(&flow::base(&*thread_state.flow_root)); + root_scope.post = to_value(&flow::base(&*thread_state.flow_root)).unwrap(); let result = to_string(&root_scope).unwrap(); let mut file = File::create(format!("layout_trace-{}.json", generation)).unwrap(); diff --git a/components/layout/table_row.rs b/components/layout/table_row.rs index 0370d785e15..d1c7146d247 100644 --- a/components/layout/table_row.rs +++ b/components/layout/table_row.rs @@ -69,7 +69,7 @@ pub struct TableRowFlow { } impl Serialize for TableRowFlow { - fn serialize<S: Serializer>(&self, serializer: &mut S) -> Result<(), S::Error> { + fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> { self.block_flow.serialize(serializer) } } @@ -578,8 +578,8 @@ pub struct CollapsedBorder { } impl Serialize for CollapsedBorder { - fn serialize<S: Serializer>(&self, _: &mut S) -> Result<(), S::Error> { - Ok(()) + fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> { + serializer.serialize_unit() } } diff --git a/components/layout/table_rowgroup.rs b/components/layout/table_rowgroup.rs index 0dde584ec77..e4c4291bce4 100644 --- a/components/layout/table_rowgroup.rs +++ b/components/layout/table_rowgroup.rs @@ -45,7 +45,7 @@ pub struct TableRowGroupFlow { } impl Serialize for TableRowGroupFlow { - fn serialize<S: Serializer>(&self, serializer: &mut S) -> Result<(), S::Error> { + fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> { self.block_flow.serialize(serializer) } } diff --git a/components/layout_thread/Cargo.toml b/components/layout_thread/Cargo.toml index a61309a83ce..865bfdb68e9 100644 --- a/components/layout_thread/Cargo.toml +++ b/components/layout_thread/Cargo.toml @@ -10,13 +10,13 @@ name = "layout_thread" path = "lib.rs" [dependencies] -app_units = "0.3" -euclid = "0.10.1" +app_units = "0.4" +euclid = "0.11" fnv = "1.0" gfx = {path = "../gfx"} gfx_traits = {path = "../gfx_traits"} heapsize = "0.3.0" -ipc-channel = "0.6.3" +ipc-channel = "0.7" layout = {path = "../layout"} layout_traits = {path = "../layout_traits"} lazy_static = "0.2" @@ -31,8 +31,8 @@ script = {path = "../script"} script_layout_interface = {path = "../script_layout_interface"} script_traits = {path = "../script_traits"} selectors = { path = "../selectors" } -serde_derive = "0.8" -serde_json = "0.8" +serde_derive = "0.9" +serde_json = "0.9" servo_config = {path = "../config"} servo_geometry = {path = "../geometry"} servo_url = {path = "../url"} diff --git a/components/layout_traits/Cargo.toml b/components/layout_traits/Cargo.toml index d2b78708895..3391077d93a 100644 --- a/components/layout_traits/Cargo.toml +++ b/components/layout_traits/Cargo.toml @@ -11,7 +11,7 @@ path = "lib.rs" [dependencies] gfx = {path = "../gfx"} -ipc-channel = "0.6.3" +ipc-channel = "0.7" msg = {path = "../msg"} net_traits = {path = "../net_traits"} profile_traits = {path = "../profile_traits"} diff --git a/components/msg/Cargo.toml b/components/msg/Cargo.toml index 33abb5cdaac..abcd274e79d 100644 --- a/components/msg/Cargo.toml +++ b/components/msg/Cargo.toml @@ -11,12 +11,12 @@ path = "lib.rs" [dependencies] bitflags = "0.7" -cssparser = {version = "0.9", features = ["heap_size", "serde-serialization"]} +cssparser = {version = "0.10", features = ["heapsize", "serde"]} heapsize = "0.3.0" heapsize_derive = "0.1" plugins = {path = "../plugins"} -serde = "0.8" -serde_derive = "0.8" +serde = "0.9" +serde_derive = "0.9" [dependencies.webrender_traits] git = "https://github.com/servo/webrender" diff --git a/components/net/Cargo.toml b/components/net/Cargo.toml index b86f6ce2a16..612f3e786b3 100644 --- a/components/net/Cargo.toml +++ b/components/net/Cargo.toml @@ -11,14 +11,14 @@ path = "lib.rs" [dependencies] brotli = "1.0.6" -content-blocker = "0.2.1" +content-blocker = "0.2.3" cookie = {version = "0.2.5", features = ["serialize-rustc"]} devtools_traits = {path = "../devtools_traits"} flate2 = "0.2.0" hyper = "0.9.9" -hyper_serde = "0.1.4" +hyper_serde = "0.5" immeta = "0.3.1" -ipc-channel = "0.6.3" +ipc-channel = "0.7" lazy_static = "0.2" log = "0.3.5" matches = "0.1" @@ -37,7 +37,7 @@ threadpool = "1.0" time = "0.1.17" unicase = "1.4.0" url = {version = "1.2", features = ["heap_size", "rustc-serialize"]} -uuid = {version = "0.3.1", features = ["v4"]} +uuid = {version = "0.4", features = ["v4"]} websocket = "0.17" [dependencies.webrender_traits] diff --git a/components/net_traits/Cargo.toml b/components/net_traits/Cargo.toml index c0e14a81ba1..b7f512dd336 100644 --- a/components/net_traits/Cargo.toml +++ b/components/net_traits/Cargo.toml @@ -14,19 +14,19 @@ cookie = {version = "0.2.5", features = ["serialize-rustc"]} heapsize = "0.3.0" heapsize_derive = "0.1" hyper = "0.9.9" -hyper_serde = "0.1.4" +hyper_serde = "0.5" image = "0.12" -ipc-channel = "0.6.3" +ipc-channel = "0.7" lazy_static = "0.2" log = "0.3.5" msg = {path = "../msg"} num-traits = "0.1.32" -serde = "0.8" -serde_derive = "0.8" +serde = "0.9" +serde_derive = "0.9" servo_config = {path = "../config", features = ["servo"]} servo_url = {path = "../url", features = ["servo"]} url = {version = "1.2", features = ["heap_size"]} -uuid = { version = "0.3.1", features = ["v4", "serde"] } +uuid = {version = "0.4", features = ["v4", "serde"]} websocket = "0.17" [dependencies.webrender_traits] diff --git a/components/net_traits/lib.rs b/components/net_traits/lib.rs index 22308edaf24..8f1e004e8b0 100644 --- a/components/net_traits/lib.rs +++ b/components/net_traits/lib.rs @@ -39,7 +39,7 @@ use hyper::header::{ContentType, Headers, ReferrerPolicy as ReferrerPolicyHeader use hyper::http::RawStatus; use hyper::mime::{Attr, Mime}; use hyper_serde::Serde; -use ipc_channel::SerializeError; +use ipc_channel::Error; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::router::ROUTER; use request::{Request, RequestInit}; @@ -266,7 +266,7 @@ impl<T: FetchResponseListener> Action<T> for FetchResponseMsg { /// Handle to a resource thread pub type CoreResourceThread = IpcSender<CoreResourceMsg>; -pub type IpcSendResult = Result<(), SerializeError>; +pub type IpcSendResult = Result<(), Error>; /// Abstraction of the ability to send a particular type of message, /// used by net_traits::ResourceThreads to ease the use its IpcSender sub-fields diff --git a/components/profile/Cargo.toml b/components/profile/Cargo.toml index e686af807ee..f85f5264aa0 100644 --- a/components/profile/Cargo.toml +++ b/components/profile/Cargo.toml @@ -12,12 +12,12 @@ path = "lib.rs" [dependencies] profile_traits = {path = "../profile_traits"} plugins = {path = "../plugins"} -ipc-channel = "0.6.3" +ipc-channel = "0.7" heartbeats-simple = "0.4" log = "0.3.5" -serde = "0.8" -serde_derive = "0.8" -serde_json = "0.8" +serde = "0.9" +serde_derive = "0.9" +serde_json = "0.9" servo_config = {path = "../config", features = ["servo"]} time = "0.1.12" diff --git a/components/profile_traits/Cargo.toml b/components/profile_traits/Cargo.toml index 2a418bd91f8..15afbf0dfc9 100644 --- a/components/profile_traits/Cargo.toml +++ b/components/profile_traits/Cargo.toml @@ -15,11 +15,11 @@ energy-profiling = ["energymon", "energy-monitor"] [dependencies] energy-monitor = {version = "0.2.0", optional = true} energymon = {git = "https://github.com/energymon/energymon-rust.git", optional = true} -ipc-channel = "0.6.3" +ipc-channel = "0.7" log = "0.3.5" plugins = {path = "../plugins"} -serde = "0.8" -serde_derive = "0.8" +serde = "0.9" +serde_derive = "0.9" servo_config = {path = "../config"} signpost = {git = "https://github.com/pcwalton/signpost.git"} time = "0.1.12" diff --git a/components/range/Cargo.toml b/components/range/Cargo.toml index d93df765089..bd12842b5d1 100644 --- a/components/range/Cargo.toml +++ b/components/range/Cargo.toml @@ -14,5 +14,5 @@ path = "lib.rs" heapsize = "0.3.0" heapsize_derive = "0.1" num-traits = "0.1.32" -serde = "0.8" -serde_derive = "0.8" +serde = "0.9" +serde_derive = "0.9" diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml index 765b18319ea..4007e7ae040 100644 --- a/components/script/Cargo.toml +++ b/components/script/Cargo.toml @@ -18,14 +18,14 @@ debugmozjs = ['js/debugmozjs'] cmake = "0.1" phf_codegen = "0.7.18" phf_shared = "0.7.18" -serde_json = "0.8" +serde_json = "0.9" [target.'cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))'.dependencies] tinyfiledialogs = "2.5.9" [dependencies] angle = {git = "https://github.com/servo/angle", branch = "servo"} -app_units = "0.3" +app_units = "0.4" audio-video-metadata = "0.1.2" atomic_refcell = "0.1" bitflags = "0.7" @@ -34,22 +34,22 @@ byteorder = "1.0" canvas_traits = {path = "../canvas_traits"} caseless = "0.1.0" cookie = {version = "0.2.5", features = ["serialize-rustc"]} -cssparser = {version = "0.9", features = ["heap_size", "serde-serialization"]} +cssparser = {version = "0.10", features = ["heapsize", "serde"]} deny_public_fields = {path = "../deny_public_fields"} devtools_traits = {path = "../devtools_traits"} domobject_derive = {path = "../domobject_derive"} encoding = "0.2" -euclid = "0.10.1" +euclid = "0.11" fnv = "1.0" gfx_traits = {path = "../gfx_traits"} heapsize = "0.3.6" heapsize_derive = "0.1" -html5ever = {version = "0.12.1", features = ["heap_size", "unstable"]} -html5ever-atoms = {version = "0.1", features = ["heap_size"]} +html5ever = {version = "0.13", features = ["heap_size", "unstable"]} +html5ever-atoms = {version = "0.2", features = ["heap_size"]} hyper = "0.9.9" -hyper_serde = "0.1.4" +hyper_serde = "0.5" image = "0.12" -ipc-channel = "0.6.3" +ipc-channel = "0.7" js = {git = "https://github.com/servo/rust-mozjs", features = ["promises"]} jstraceable_derive = {path = "../jstraceable_derive"} libc = "0.2" @@ -59,7 +59,7 @@ mime_guess = "1.8.0" msg = {path = "../msg"} net_traits = {path = "../net_traits"} num-traits = "0.1.32" -offscreen_gl_context = "0.5.0" +offscreen_gl_context = "0.6" open = "1.1.1" parking_lot = "0.3" phf = "0.7.18" @@ -74,7 +74,7 @@ script_layout_interface = {path = "../script_layout_interface"} script_plugins = {path = "../script_plugins"} script_traits = {path = "../script_traits"} selectors = { path = "../selectors" } -serde = "0.8" +serde = "0.9" servo_atoms = {path = "../atoms"} servo_config = {path = "../config", features = ["servo"] } servo_geometry = {path = "../geometry" } @@ -85,9 +85,9 @@ style = {path = "../style"} style_traits = {path = "../style_traits"} time = "0.1.12" url = {version = "1.2", features = ["heap_size", "query_encoding"]} -uuid = {version = "0.3.1", features = ["v4"]} +uuid = {version = "0.4", features = ["v4"]} websocket = "0.17" -xml5ever = {version = "0.3.1", features = ["unstable"]} +xml5ever = {version = "0.4", features = ["unstable"]} webvr = {path = "../webvr"} webvr_traits = {path = "../webvr_traits"} diff --git a/components/script_layout_interface/Cargo.toml b/components/script_layout_interface/Cargo.toml index 3831761a41d..6476693f758 100644 --- a/components/script_layout_interface/Cargo.toml +++ b/components/script_layout_interface/Cargo.toml @@ -10,16 +10,16 @@ name = "script_layout_interface" path = "lib.rs" [dependencies] -app_units = "0.3" +app_units = "0.4" atomic_refcell = "0.1" canvas_traits = {path = "../canvas_traits"} -cssparser = {version = "0.9", features = ["heap_size", "serde-serialization"]} -euclid = "0.10.1" +cssparser = {version = "0.10", features = ["heapsize", "serde"]} +euclid = "0.11" gfx_traits = {path = "../gfx_traits"} heapsize = "0.3.0" heapsize_derive = "0.1" -html5ever-atoms = "0.1" -ipc-channel = "0.6.3" +html5ever-atoms = "0.2" +ipc-channel = "0.7" libc = "0.2" log = "0.3.5" msg = {path = "../msg"} diff --git a/components/script_traits/Cargo.toml b/components/script_traits/Cargo.toml index 26b11f3e49c..682eb002f81 100644 --- a/components/script_traits/Cargo.toml +++ b/components/script_traits/Cargo.toml @@ -10,27 +10,27 @@ name = "script_traits" path = "lib.rs" [dependencies] -app_units = "0.3" +app_units = "0.4" bluetooth_traits = {path = "../bluetooth_traits"} canvas_traits = {path = "../canvas_traits"} cookie = {version = "0.2.5", features = ["serialize-rustc"]} devtools_traits = {path = "../devtools_traits"} -euclid = "0.10.1" +euclid = "0.11" gfx_traits = {path = "../gfx_traits"} heapsize = "0.3.0" heapsize_derive = "0.1" hyper = "0.9.9" -hyper_serde = "0.1.4" -ipc-channel = "0.6.3" +hyper_serde = "0.5" +ipc-channel = "0.7" libc = "0.2" msg = {path = "../msg"} net_traits = {path = "../net_traits"} -offscreen_gl_context = "0.5.0" +offscreen_gl_context = "0.6" plugins = {path = "../plugins"} profile_traits = {path = "../profile_traits"} rustc-serialize = "0.3.4" -serde = "0.8" -serde_derive = "0.8" +serde = "0.9" +serde_derive = "0.9" servo_url = {path = "../url", features = ["servo"]} style_traits = {path = "../style_traits", features = ["servo"]} time = "0.1.12" diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 5be4cb7d2bc..92a2304bda8 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -91,13 +91,13 @@ impl HeapSizeOf for UntrustedNodeAddress { unsafe impl Send for UntrustedNodeAddress {} impl Serialize for UntrustedNodeAddress { - fn serialize<S: Serializer>(&self, s: &mut S) -> Result<(), S::Error> { + fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error> { (self.0 as usize).serialize(s) } } impl Deserialize for UntrustedNodeAddress { - fn deserialize<D: Deserializer>(d: &mut D) -> Result<UntrustedNodeAddress, D::Error> { + fn deserialize<D: Deserializer>(d: D) -> Result<UntrustedNodeAddress, D::Error> { let value: usize = try!(Deserialize::deserialize(d)); Ok(UntrustedNodeAddress::from_id(value)) } diff --git a/components/selectors/Cargo.toml b/components/selectors/Cargo.toml index 573811a6c51..714cb213138 100644 --- a/components/selectors/Cargo.toml +++ b/components/selectors/Cargo.toml @@ -18,5 +18,5 @@ path = "lib.rs" [dependencies] bitflags = "0.7" matches = "0.1" -cssparser = "0.9" +cssparser = "0.10" fnv = "1.0" diff --git a/components/servo/Cargo.toml b/components/servo/Cargo.toml index bc19eeca990..8c66ba323b8 100644 --- a/components/servo/Cargo.toml +++ b/components/servo/Cargo.toml @@ -31,10 +31,10 @@ debugger = {path = "../debugger"} devtools = {path = "../devtools"} devtools_traits = {path = "../devtools_traits"} env_logger = "0.4" -euclid = "0.10.1" +euclid = "0.11" gfx = {path = "../gfx"} gleam = "0.2" -ipc-channel = "0.6.3" +ipc-channel = "0.7" layout_thread = {path = "../layout_thread"} log = "0.3" msg = {path = "../msg"} diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml index 9ed90574c5a..563c7ed0967 100644 --- a/components/style/Cargo.toml +++ b/components/style/Cargo.toml @@ -16,23 +16,23 @@ doctest = false gecko = ["nsstring_vendor", "num_cpus", "rayon/unstable"] use_bindgen = ["bindgen", "regex"] servo = ["serde/unstable", "serde", "serde_derive", "heapsize_derive", - "style_traits/servo", "app_units/plugins", "servo_atoms", "html5ever-atoms", - "cssparser/heap_size", "cssparser/serde-serialization", + "style_traits/servo", "servo_atoms", "html5ever-atoms", + "cssparser/heapsize", "cssparser/serde", "rayon/unstable", "servo_url/servo"] testing = [] [dependencies] -app_units = "0.3" +app_units = "0.4" atomic_refcell = "0.1" bitflags = "0.7" cfg-if = "0.1.0" -cssparser = "0.9" +cssparser = "0.10" encoding = "0.2" -euclid = "0.10.1" +euclid = "0.11" fnv = "1.0" heapsize = "0.3.0" heapsize_derive = {version = "0.1", optional = true} -html5ever-atoms = {version = "0.1", optional = true} +html5ever-atoms = {version = "0.2", optional = true} lazy_static = "0.2" log = "0.3.5" matches = "0.1" @@ -47,8 +47,8 @@ pdqsort = "0.1.0" rayon = "0.6" rustc-serialize = "0.3" selectors = { path = "../selectors" } -serde = {version = "0.8", optional = true} -serde_derive = {version = "0.8", optional = true} +serde = {version = "0.9", optional = true} +serde_derive = {version = "0.9", optional = true} servo_atoms = {path = "../atoms", optional = true} servo_config = {path = "../config"} smallvec = "0.1" diff --git a/components/style_traits/Cargo.toml b/components/style_traits/Cargo.toml index 1d60a8c5d14..2f28568aa6d 100644 --- a/components/style_traits/Cargo.toml +++ b/components/style_traits/Cargo.toml @@ -11,14 +11,14 @@ path = "lib.rs" [features] servo = ["heapsize", "heapsize_derive", "serde", "serde_derive", - "cssparser/heap_size", "cssparser/serde-serialization"] + "cssparser/heapsize", "cssparser/serde"] [dependencies] -app_units = "0.3" -cssparser = "0.9" -euclid = "0.10.1" +app_units = "0.4" +cssparser = "0.10" +euclid = "0.11" heapsize = {version = "0.3.0", optional = true} heapsize_derive = {version = "0.1", optional = true} rustc-serialize = "0.3" -serde = {version = "0.8", optional = true} -serde_derive = {version = "0.8", optional = true} +serde = {version = "0.9", optional = true} +serde_derive = {version = "0.9", optional = true} diff --git a/components/url/Cargo.toml b/components/url/Cargo.toml index 11ce6296a93..e6acfe07649 100644 --- a/components/url/Cargo.toml +++ b/components/url/Cargo.toml @@ -10,13 +10,11 @@ name = "servo_url" path = "lib.rs" [features] -servo = ["heapsize", "heapsize_derive", "serde", "serde_derive", - "url/heap_size", "url/serde"] - +servo = ["heapsize", "heapsize_derive", "serde", "url/heap_size", "url_serde"] [dependencies] heapsize = {version = "0.3.0", optional = true} heapsize_derive = {version = "0.1", optional = true} -serde = {version = "0.8", optional = true} -serde_derive = {version = "0.8", optional = true} +serde = {version = "0.9", optional = true} url = "1.2" +url_serde = {version = "0.1", optional = true} diff --git a/components/url/lib.rs b/components/url/lib.rs index d9f69497aba..85933a509c7 100644 --- a/components/url/lib.rs +++ b/components/url/lib.rs @@ -7,11 +7,10 @@ #![crate_name = "servo_url"] #![crate_type = "rlib"] -#![cfg_attr(feature = "servo", feature(plugin))] - -#[cfg(feature = "servo")] #[macro_use] extern crate serde_derive; #[cfg(feature = "servo")] extern crate heapsize; #[cfg(feature = "servo")] #[macro_use] extern crate heapsize_derive; +#[cfg(feature = "servo")] extern crate serde; +#[cfg(feature = "servo")] extern crate url_serde; extern crate url; @@ -23,7 +22,7 @@ use std::sync::Arc; use url::{Url, Origin, Position}; #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[cfg_attr(feature = "servo", derive(HeapSizeOf, Serialize, Deserialize))] +#[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct ServoUrl(Arc<Url>); impl ServoUrl { @@ -196,3 +195,21 @@ impl From<Url> for ServoUrl { ServoUrl::from_url(url) } } + +#[cfg(feature = "servo")] +impl serde::Serialize for ServoUrl { + fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> + where S: serde::Serializer, + { + url_serde::serialize(&*self.0, serializer) + } +} + +#[cfg(feature = "servo")] +impl serde::Deserialize for ServoUrl { + fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> + where D: serde::Deserializer, + { + url_serde::deserialize(deserializer).map(Self::from_url) + } +} diff --git a/components/webdriver_server/Cargo.toml b/components/webdriver_server/Cargo.toml index b06f26b04cb..51ebd48b330 100644 --- a/components/webdriver_server/Cargo.toml +++ b/components/webdriver_server/Cargo.toml @@ -11,10 +11,10 @@ path = "lib.rs" [dependencies] cookie = {version = "0.2.5", features = ["serialize-rustc"]} -euclid = "0.10.1" +euclid = "0.11" hyper = "0.9.9" image = "0.12" -ipc-channel = "0.6.3" +ipc-channel = "0.7" log = "0.3.5" msg = {path = "../msg"} net_traits = {path = "../net_traits"} @@ -25,5 +25,5 @@ script_traits = {path = "../script_traits"} servo_config = {path = "../config", features = ["servo"]} servo_url = {path = "../url", features = ["servo"]} url = {version = "1.2", features = ["heap_size"]} -uuid = { version = "0.3.1", features = ["v4"] } +uuid = {version = "0.4", features = ["v4"]} webdriver = "0.20" diff --git a/components/webvr/Cargo.toml b/components/webvr/Cargo.toml index 970dcff12f1..ce23e9f89be 100644 --- a/components/webvr/Cargo.toml +++ b/components/webvr/Cargo.toml @@ -10,7 +10,7 @@ name = "webvr" path = "lib.rs" [dependencies] -ipc-channel = "0.6.3" +ipc-channel = "0.7" log = "0.3" msg = {path = "../msg"} script_traits = {path = "../script_traits"} diff --git a/components/webvr_traits/Cargo.toml b/components/webvr_traits/Cargo.toml index 142f9ef5575..9ec8e33462c 100644 --- a/components/webvr_traits/Cargo.toml +++ b/components/webvr_traits/Cargo.toml @@ -10,8 +10,8 @@ name = "webvr_traits" path = "lib.rs" [dependencies] -ipc-channel = "0.6.3" +ipc-channel = "0.7" msg = {path = "../msg"} -rust-webvr = {version = "0.1", features = ["serde-serialization"]} -serde = "0.8" -serde_derive = "0.8" +rust-webvr = {version = "0.2", features = ["serde-serialization"]} +serde = "0.9" +serde_derive = "0.9" |