Update serde to 0.9 (fixes #15325)

This commit is contained in:
Anthony Ramine 2017-02-10 02:35:26 +01:00
parent 26d6c96b18
commit fe3f4ff0c2
73 changed files with 630 additions and 604 deletions

618
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -11,7 +11,7 @@ workspace = "../.."
path = "lib.rs" path = "lib.rs"
[dependencies] [dependencies]
string_cache = {version = "0.3", features = ["heap_size"]} string_cache = {version = "0.4", features = ["heapsize"]}
[build-dependencies] [build-dependencies]
string_cache_codegen = "0.3" string_cache_codegen = "0.3"

View file

@ -13,9 +13,9 @@ path = "lib.rs"
bitflags = "0.7" bitflags = "0.7"
bluetooth_traits = {path = "../bluetooth_traits"} bluetooth_traits = {path = "../bluetooth_traits"}
device = {git = "https://github.com/servo/devices", features = ["bluetooth-test"]} device = {git = "https://github.com/servo/devices", features = ["bluetooth-test"]}
ipc-channel = "0.6.3" ipc-channel = "0.7"
servo_rand = {path = "../rand"} servo_rand = {path = "../rand"}
uuid = {version = "0.3.1", features = ["v4"]} uuid = {version = "0.4", features = ["v4"]}
[target.'cfg(target_os = "linux")'.dependencies] [target.'cfg(target_os = "linux")'.dependencies]
tinyfiledialogs = "2.5.9" tinyfiledialogs = "2.5.9"

View file

@ -10,8 +10,8 @@ name = "bluetooth_traits"
path = "lib.rs" path = "lib.rs"
[dependencies] [dependencies]
ipc-channel = "0.6.3" ipc-channel = "0.7"
regex = "0.2" regex = "0.2"
serde = "0.8" serde = "0.9"
serde_derive = "0.8" serde_derive = "0.9"
servo_config = {path = "../config"} servo_config = {path = "../config"}

View file

@ -12,13 +12,13 @@ path = "lib.rs"
[dependencies] [dependencies]
azure = {git = "https://github.com/servo/rust-azure", features = ["plugins"]} azure = {git = "https://github.com/servo/rust-azure", features = ["plugins"]}
canvas_traits = {path = "../canvas_traits"} canvas_traits = {path = "../canvas_traits"}
cssparser = {version = "0.9", features = ["heap_size", "serde-serialization"]} cssparser = {version = "0.10", features = ["heapsize", "serde"]}
euclid = "0.10.1" euclid = "0.11"
gleam = "0.2.8" gleam = "0.2.8"
ipc-channel = "0.6.3" ipc-channel = "0.7"
log = "0.3.5" log = "0.3.5"
num-traits = "0.1.32" num-traits = "0.1.32"
offscreen_gl_context = "0.5.0" offscreen_gl_context = "0.6"
plugins = {path = "../plugins"} plugins = {path = "../plugins"}
servo_config = {path = "../config"} servo_config = {path = "../config"}

View file

@ -10,14 +10,14 @@ name = "canvas_traits"
path = "lib.rs" path = "lib.rs"
[dependencies] [dependencies]
cssparser = {version = "0.9", features = ["heap_size", "serde-serialization"]} cssparser = {version = "0.10", features = ["heapsize", "serde"]}
euclid = "0.10.1" euclid = "0.11"
heapsize = "0.3.0" heapsize = "0.3.0"
heapsize_derive = "0.1" heapsize_derive = "0.1"
ipc-channel = "0.6.3" ipc-channel = "0.7"
plugins = {path = "../plugins"} plugins = {path = "../plugins"}
serde = {version = "0.8", features = ["unstable"]} serde = {version = "0.9", features = ["unstable"]}
serde_derive = "0.8" serde_derive = "0.9"
[dependencies.webrender_traits] [dependencies.webrender_traits]
git = "https://github.com/servo/webrender" git = "https://github.com/servo/webrender"

View file

@ -10,11 +10,11 @@ name = "compositing"
path = "lib.rs" path = "lib.rs"
[dependencies] [dependencies]
euclid = "0.10.1" euclid = "0.11"
gfx_traits = {path = "../gfx_traits"} gfx_traits = {path = "../gfx_traits"}
gleam = "0.2.8" gleam = "0.2.8"
image = "0.12" image = "0.12"
ipc-channel = "0.6.3" ipc-channel = "0.7"
log = "0.3.5" log = "0.3.5"
msg = {path = "../msg"} msg = {path = "../msg"}
net_traits = {path = "../net_traits"} net_traits = {path = "../net_traits"}

View file

@ -11,18 +11,18 @@ path = "lib.rs"
[features] [features]
# servo as opposed to geckolib # servo as opposed to geckolib
servo = ["serde", "serde_derive", "url/heap_size", "url/serde", "plugins"] servo = ["plugins", "serde", "serde_derive", "servo_url/servo"]
[dependencies] [dependencies]
euclid = "0.10.1" euclid = "0.11"
getopts = "0.2.11" getopts = "0.2.11"
lazy_static = "0.2" lazy_static = "0.2"
log = "0.3.5" log = "0.3.5"
num_cpus = "1.1.0" num_cpus = "1.1.0"
plugins = {path = "../plugins", optional = true} plugins = {path = "../plugins", optional = true}
rustc-serialize = "0.3" rustc-serialize = "0.3"
serde = {version = "0.8", optional = true} serde = {version = "0.9", optional = true}
serde_derive = {version = "0.8", optional = true} serde_derive = {version = "0.9", optional = true}
servo_geometry = {path = "../geometry"} servo_geometry = {path = "../geometry"}
servo_url = {path = "../url"} servo_url = {path = "../url"}
url = "1.2" url = "1.2"

View file

@ -17,20 +17,20 @@ canvas_traits = {path = "../canvas_traits"}
compositing = {path = "../compositing"} compositing = {path = "../compositing"}
debugger = {path = "../debugger"} debugger = {path = "../debugger"}
devtools_traits = {path = "../devtools_traits"} devtools_traits = {path = "../devtools_traits"}
euclid = "0.10.1" euclid = "0.11"
gfx = {path = "../gfx"} gfx = {path = "../gfx"}
gfx_traits = {path = "../gfx_traits"} gfx_traits = {path = "../gfx_traits"}
ipc-channel = "0.6.3" ipc-channel = "0.7"
layout_traits = {path = "../layout_traits"} layout_traits = {path = "../layout_traits"}
log = "0.3.5" log = "0.3.5"
msg = {path = "../msg"} msg = {path = "../msg"}
net_traits = {path = "../net_traits"} net_traits = {path = "../net_traits"}
offscreen_gl_context = "0.5.0" offscreen_gl_context = "0.6"
plugins = {path = "../plugins"} plugins = {path = "../plugins"}
profile_traits = {path = "../profile_traits"} profile_traits = {path = "../profile_traits"}
script_traits = {path = "../script_traits"} script_traits = {path = "../script_traits"}
serde = "0.8" serde = "0.9"
serde_derive = "0.8" serde_derive = "0.9"
style_traits = {path = "../style_traits"} style_traits = {path = "../style_traits"}
servo_config = {path = "../config", features = ["servo"]} servo_config = {path = "../config", features = ["servo"]}
servo_rand = {path = "../rand"} servo_rand = {path = "../rand"}

View file

@ -78,7 +78,7 @@ use event_loop::EventLoop;
use frame::{Frame, FrameChange, FrameState, FrameTreeIterator, FullFrameTreeIterator}; use frame::{Frame, FrameChange, FrameState, FrameTreeIterator, FullFrameTreeIterator};
use gfx::font_cache_thread::FontCacheThread; use gfx::font_cache_thread::FontCacheThread;
use gfx_traits::Epoch; use gfx_traits::Epoch;
use ipc_channel::SerializeError; use ipc_channel::Error;
use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::ipc::{self, IpcSender};
use ipc_channel::router::ROUTER; use ipc_channel::router::ROUTER;
use layout_traits::LayoutThreadFactory; use layout_traits::LayoutThreadFactory;
@ -1228,7 +1228,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
self.pipelines.remove(&pipeline_id); 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 // Treat send error the same as receiving a panic message
debug!("Pipeline {:?} send error ({}).", pipeline_id, err); debug!("Pipeline {:?} send error ({}).", pipeline_id, err);
let top_level_frame_id = self.get_top_level_frame_for_pipeline(pipeline_id); let top_level_frame_id = self.get_top_level_frame_for_pipeline(pipeline_id);

View file

@ -6,7 +6,7 @@
//! view of a script thread. When an `EventLoop` is dropped, an `ExitScriptThread` //! view of a script thread. When an `EventLoop` is dropped, an `ExitScriptThread`
//! message is sent to the script thread, asking it to shut down. //! 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 ipc_channel::ipc::IpcSender;
use script_traits::ConstellationControlMsg; use script_traits::ConstellationControlMsg;
use std::marker::PhantomData; use std::marker::PhantomData;
@ -34,7 +34,7 @@ impl EventLoop {
} }
/// Send a message to the event loop. /// 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) self.script_chan.send(msg)
} }

View file

@ -11,7 +11,7 @@ use euclid::scale_factor::ScaleFactor;
use euclid::size::TypedSize2D; use euclid::size::TypedSize2D;
use event_loop::EventLoop; use event_loop::EventLoop;
use gfx::font_cache_thread::FontCacheThread; use gfx::font_cache_thread::FontCacheThread;
use ipc_channel::SerializeError; use ipc_channel::Error;
use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER; use ipc_channel::router::ROUTER;
use layout_traits::LayoutThreadFactory; use layout_traits::LayoutThreadFactory;
@ -178,7 +178,7 @@ pub struct InitialPipelineState {
impl Pipeline { impl Pipeline {
/// Starts a layout thread, and possibly a script thread, in /// Starts a layout thread, and possibly a script thread, in
/// a new process if requested. /// 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>, where LTF: LayoutThreadFactory<Message=Message>,
STF: ScriptThreadFactory<Message=Message> STF: ScriptThreadFactory<Message=Message>
{ {
@ -523,7 +523,7 @@ impl UnprivilegedPipelineContent {
} }
#[cfg(not(target_os = "windows"))] #[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 gaol::sandbox::{self, Sandbox, SandboxMethods};
use ipc_channel::ipc::IpcOneShotServer; use ipc_channel::ipc::IpcOneShotServer;
use sandboxing::content_process_sandbox_profile; use sandboxing::content_process_sandbox_profile;
@ -571,7 +571,7 @@ impl UnprivilegedPipelineContent {
} }
#[cfg(target_os = "windows")] #[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."); error!("Multiprocess is not supported on Windows.");
process::exit(1); process::exit(1);
} }

View file

@ -13,12 +13,12 @@ path = "lib.rs"
devtools_traits = {path = "../devtools_traits"} devtools_traits = {path = "../devtools_traits"}
encoding = "0.2" encoding = "0.2"
hyper = "0.9.9" hyper = "0.9.9"
hyper_serde = "0.1.4" hyper_serde = "0.5"
ipc-channel = "0.6.3" ipc-channel = "0.7"
log = "0.3.5" log = "0.3.5"
msg = {path = "../msg"} msg = {path = "../msg"}
plugins = {path = "../plugins"} plugins = {path = "../plugins"}
serde = "0.8" serde = "0.9"
serde_derive = "0.8" serde_derive = "0.9"
serde_json = "0.8" serde_json = "0.9"
time = "0.1" time = "0.1"

View file

@ -5,10 +5,10 @@
/// General actor system infrastructure. /// General actor system infrastructure.
use devtools_traits::PreciseTime; use devtools_traits::PreciseTime;
use serde_json::Value; use serde_json::{Map, Value};
use std::any::Any; use std::any::Any;
use std::cell::{Cell, RefCell}; use std::cell::{Cell, RefCell};
use std::collections::{BTreeMap, HashMap}; use std::collections::HashMap;
use std::mem::replace; use std::mem::replace;
use std::net::TcpStream; use std::net::TcpStream;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
@ -26,7 +26,7 @@ pub trait Actor: Any + ActorAsAny {
fn handle_message(&self, fn handle_message(&self,
registry: &ActorRegistry, registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
msg: &BTreeMap<String, Value>, msg: &Map<String, Value>,
stream: &mut TcpStream) -> Result<ActorMessageStatus, ()>; stream: &mut TcpStream) -> Result<ActorMessageStatus, ()>;
fn name(&self) -> String; 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 /// 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. /// found or does not indicate that it knew how to process the message, ignore the failure.
pub fn handle_message(&mut self, pub fn handle_message(&mut self,
msg: &BTreeMap<String, Value>, msg: &Map<String, Value>,
stream: &mut TcpStream) stream: &mut TcpStream)
-> Result<(), ()> { -> Result<(), ()> {
let to = msg.get("to").unwrap().as_str().unwrap(); let to = msg.get("to").unwrap().as_str().unwrap();

View file

@ -16,9 +16,8 @@ use devtools_traits::EvaluateJSReply::{NullValue, NumberValue, VoidValue};
use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::ipc::{self, IpcSender};
use msg::constellation_msg::PipelineId; use msg::constellation_msg::PipelineId;
use protocol::JsonPacketStream; use protocol::JsonPacketStream;
use serde_json::{self, Value}; use serde_json::{self, Map, Number, Value};
use std::cell::RefCell; use std::cell::RefCell;
use std::collections::BTreeMap;
use std::net::TcpStream; use std::net::TcpStream;
trait EncodableConsoleMessage { trait EncodableConsoleMessage {
@ -50,7 +49,7 @@ struct StartedListenersReply {
#[derive(Serialize)] #[derive(Serialize)]
struct GetCachedMessagesReply { struct GetCachedMessagesReply {
from: String, from: String,
messages: Vec<BTreeMap<String, Value>>, messages: Vec<Map<String, Value>>,
} }
#[derive(Serialize)] #[derive(Serialize)]
@ -98,7 +97,7 @@ impl Actor for ConsoleActor {
fn handle_message(&self, fn handle_message(&self,
registry: &ActorRegistry, registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
msg: &BTreeMap<String, Value>, msg: &Map<String, Value>,
stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"getCachedMessages" => { "getCachedMessages" => {
@ -182,46 +181,46 @@ impl Actor for ConsoleActor {
//TODO: extract conversion into protocol module or some other useful place //TODO: extract conversion into protocol module or some other useful place
let result = match try!(port.recv().map_err(|_| ())) { let result = match try!(port.recv().map_err(|_| ())) {
VoidValue => { VoidValue => {
let mut m = BTreeMap::new(); let mut m = Map::new();
m.insert("type".to_owned(), serde_json::to_value("undefined")); m.insert("type".to_owned(), Value::String("undefined".to_owned()));
Value::Object(m) Value::Object(m)
} }
NullValue => { NullValue => {
let mut m = BTreeMap::new(); let mut m = Map::new();
m.insert("type".to_owned(), serde_json::to_value("null")); m.insert("type".to_owned(), Value::String("null".to_owned()));
Value::Object(m) Value::Object(m)
} }
BooleanValue(val) => Value::Bool(val), BooleanValue(val) => Value::Bool(val),
NumberValue(val) => { NumberValue(val) => {
if val.is_nan() { if val.is_nan() {
let mut m = BTreeMap::new(); let mut m = Map::new();
m.insert("type".to_owned(), serde_json::to_value("NaN")); m.insert("type".to_owned(), Value::String("NaN".to_owned()));
Value::Object(m) Value::Object(m)
} else if val.is_infinite() { } else if val.is_infinite() {
let mut m = BTreeMap::new(); let mut m = Map::new();
if val < 0. { if val < 0. {
m.insert("type".to_owned(), serde_json::to_value("-Infinity")); m.insert("type".to_owned(), Value::String("-Infinity".to_owned()));
} else { } else {
m.insert("type".to_owned(), serde_json::to_value("Infinity")); m.insert("type".to_owned(), Value::String("Infinity".to_owned()));
} }
Value::Object(m) Value::Object(m)
} else if val == 0. && val.is_sign_negative() { } else if val == 0. && val.is_sign_negative() {
let mut m = BTreeMap::new(); let mut m = Map::new();
m.insert("type".to_owned(), serde_json::to_value("-0")); m.insert("type".to_owned(), Value::String("-0".to_owned()));
Value::Object(m) Value::Object(m)
} else { } else {
serde_json::to_value(&val) Value::Number(Number::from_f64(val).unwrap())
} }
} }
StringValue(s) => Value::String(s), StringValue(s) => Value::String(s),
ActorValue { class, uuid } => { ActorValue { class, uuid } => {
//TODO: make initial ActorValue message include these properties? //TODO: make initial ActorValue message include these properties?
let mut m = BTreeMap::new(); let mut m = Map::new();
let actor = ObjectActor::new(registry, uuid); let actor = ObjectActor::new(registry, uuid);
m.insert("type".to_owned(), serde_json::to_value("object")); m.insert("type".to_owned(), Value::String("object".to_owned()));
m.insert("class".to_owned(), serde_json::to_value(&class)); m.insert("class".to_owned(), Value::String(class));
m.insert("actor".to_owned(), serde_json::to_value(&actor)); m.insert("actor".to_owned(), Value::String(actor));
m.insert("extensible".to_owned(), Value::Bool(true)); m.insert("extensible".to_owned(), Value::Bool(true));
m.insert("frozen".to_owned(), Value::Bool(false)); m.insert("frozen".to_owned(), Value::Bool(false));
m.insert("sealed".to_owned(), Value::Bool(false)); m.insert("sealed".to_owned(), Value::Bool(false));
@ -235,9 +234,9 @@ impl Actor for ConsoleActor {
input: input, input: input,
result: result, result: result,
timestamp: 0, timestamp: 0,
exception: Value::Object(BTreeMap::new()), exception: Value::Object(Map::new()),
exceptionMessage: "".to_owned(), exceptionMessage: "".to_owned(),
helperResult: Value::Object(BTreeMap::new()), helperResult: Value::Object(Map::new()),
}; };
stream.write_json_packet(&msg); stream.write_json_packet(&msg);
ActorMessageStatus::Processed ActorMessageStatus::Processed

View file

@ -7,8 +7,7 @@ use actors::timeline::HighResolutionStamp;
use devtools_traits::DevtoolScriptControlMsg; use devtools_traits::DevtoolScriptControlMsg;
use ipc_channel::ipc::IpcSender; use ipc_channel::ipc::IpcSender;
use msg::constellation_msg::PipelineId; use msg::constellation_msg::PipelineId;
use serde_json::Value; use serde_json::{Map, Value};
use std::collections::BTreeMap;
use std::mem; use std::mem;
use std::net::TcpStream; use std::net::TcpStream;
use time::precise_time_ns; use time::precise_time_ns;
@ -31,7 +30,7 @@ impl Actor for FramerateActor {
fn handle_message(&self, fn handle_message(&self,
_registry: &ActorRegistry, _registry: &ActorRegistry,
_msg_type: &str, _msg_type: &str,
_msg: &BTreeMap<String, Value>, _msg: &Map<String, Value>,
_stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { _stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(ActorMessageStatus::Ignored) Ok(ActorMessageStatus::Ignored)
} }

View file

@ -12,9 +12,8 @@ use devtools_traits::DevtoolScriptControlMsg::{GetLayout, ModifyAttribute};
use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::ipc::{self, IpcSender};
use msg::constellation_msg::PipelineId; use msg::constellation_msg::PipelineId;
use protocol::JsonPacketStream; use protocol::JsonPacketStream;
use serde_json::{self, Value}; use serde_json::{self, Map, Value};
use std::cell::RefCell; use std::cell::RefCell;
use std::collections::BTreeMap;
use std::net::TcpStream; use std::net::TcpStream;
pub struct InspectorActor { pub struct InspectorActor {
@ -65,7 +64,7 @@ impl Actor for HighlighterActor {
fn handle_message(&self, fn handle_message(&self,
_registry: &ActorRegistry, _registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
_msg: &BTreeMap<String, Value>, _msg: &Map<String, Value>,
stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"showBoxModel" => { "showBoxModel" => {
@ -102,7 +101,7 @@ impl Actor for NodeActor {
fn handle_message(&self, fn handle_message(&self,
registry: &ActorRegistry, registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
msg: &BTreeMap<String, Value>, msg: &Map<String, Value>,
stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"modifyAttributes" => { "modifyAttributes" => {
@ -276,7 +275,7 @@ impl Actor for WalkerActor {
fn handle_message(&self, fn handle_message(&self,
registry: &ActorRegistry, registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
msg: &BTreeMap<String, Value>, msg: &Map<String, Value>,
stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"querySelector" => { "querySelector" => {
@ -451,7 +450,7 @@ impl Actor for PageStyleActor {
fn handle_message(&self, fn handle_message(&self,
registry: &ActorRegistry, registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
msg: &BTreeMap<String, Value>, msg: &Map<String, Value>,
stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"getApplied" => { "getApplied" => {
@ -503,7 +502,7 @@ impl Actor for PageStyleActor {
zIndex: zIndex, zIndex: zIndex,
boxSizing: boxSizing, boxSizing: boxSizing,
autoMargins: if auto_margins { autoMargins: if auto_margins {
let mut m = BTreeMap::new(); let mut m = Map::new();
let auto = serde_json::value::Value::String("auto".to_owned()); let auto = serde_json::value::Value::String("auto".to_owned());
if autoMargins.top { m.insert("top".to_owned(), auto.clone()); } if autoMargins.top { m.insert("top".to_owned(), auto.clone()); }
if autoMargins.right { m.insert("right".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, fn handle_message(&self,
registry: &ActorRegistry, registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
_msg: &BTreeMap<String, Value>, _msg: &Map<String, Value>,
stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"getWalker" => { "getWalker" => {

View file

@ -3,8 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use actor::{Actor, ActorMessageStatus, ActorRegistry}; use actor::{Actor, ActorMessageStatus, ActorRegistry};
use serde_json::Value; use serde_json::{Map, Value};
use std::collections::BTreeMap;
use std::net::TcpStream; use std::net::TcpStream;
#[derive(Serialize)] #[derive(Serialize)]
@ -32,7 +31,7 @@ impl Actor for MemoryActor {
fn handle_message(&self, fn handle_message(&self,
_registry: &ActorRegistry, _registry: &ActorRegistry,
_msg_type: &str, _msg_type: &str,
_msg: &BTreeMap<String, Value>, _msg: &Map<String, Value>,
_stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { _stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(ActorMessageStatus::Ignored) Ok(ActorMessageStatus::Ignored)
} }

View file

@ -16,9 +16,8 @@ use hyper::header::Headers;
use hyper::http::RawStatus; use hyper::http::RawStatus;
use hyper::method::Method; use hyper::method::Method;
use protocol::JsonPacketStream; use protocol::JsonPacketStream;
use serde_json::Value; use serde_json::{Map, Value};
use std::borrow::Cow; use std::borrow::Cow;
use std::collections::BTreeMap;
use std::net::TcpStream; use std::net::TcpStream;
use time; use time;
use time::Tm; use time::Tm;
@ -185,7 +184,7 @@ impl Actor for NetworkEventActor {
fn handle_message(&self, fn handle_message(&self,
_registry: &ActorRegistry, _registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
_msg: &BTreeMap<String, Value>, _msg: &Map<String, Value>,
stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"getRequestHeaders" => { "getRequestHeaders" => {

View file

@ -3,8 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use actor::{Actor, ActorMessageStatus, ActorRegistry}; use actor::{Actor, ActorMessageStatus, ActorRegistry};
use serde_json::Value; use serde_json::{Map, Value};
use std::collections::BTreeMap;
use std::net::TcpStream; use std::net::TcpStream;
pub struct ObjectActor { pub struct ObjectActor {
@ -19,7 +18,7 @@ impl Actor for ObjectActor {
fn handle_message(&self, fn handle_message(&self,
_: &ActorRegistry, _: &ActorRegistry,
_: &str, _: &str,
_: &BTreeMap<String, Value>, _: &Map<String, Value>,
_: &mut TcpStream) -> Result<ActorMessageStatus, ()> { _: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(ActorMessageStatus::Ignored) Ok(ActorMessageStatus::Ignored)
} }

View file

@ -4,8 +4,7 @@
use actor::{Actor, ActorMessageStatus, ActorRegistry}; use actor::{Actor, ActorMessageStatus, ActorRegistry};
use protocol::{ActorDescription, JsonPacketStream, Method}; use protocol::{ActorDescription, JsonPacketStream, Method};
use serde_json::Value; use serde_json::{Map, Value};
use std::collections::BTreeMap;
use std::net::TcpStream; use std::net::TcpStream;
pub struct PerformanceActor { pub struct PerformanceActor {
@ -55,7 +54,7 @@ impl Actor for PerformanceActor {
fn handle_message(&self, fn handle_message(&self,
_registry: &ActorRegistry, _registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
_msg: &BTreeMap<String, Value>, _msg: &Map<String, Value>,
stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"connect" => { "connect" => {

View file

@ -3,8 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use actor::{Actor, ActorMessageStatus, ActorRegistry}; use actor::{Actor, ActorMessageStatus, ActorRegistry};
use serde_json::Value; use serde_json::{Map, Value};
use std::collections::BTreeMap;
use std::net::TcpStream; use std::net::TcpStream;
pub struct ProfilerActor { pub struct ProfilerActor {
@ -19,7 +18,7 @@ impl Actor for ProfilerActor {
fn handle_message(&self, fn handle_message(&self,
_registry: &ActorRegistry, _registry: &ActorRegistry,
_msg_type: &str, _msg_type: &str,
_msg: &BTreeMap<String, Value>, _msg: &Map<String, Value>,
_stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { _stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(ActorMessageStatus::Ignored) Ok(ActorMessageStatus::Ignored)
} }

View file

@ -11,8 +11,7 @@ use actor::{Actor, ActorMessageStatus, ActorRegistry};
use actors::performance::PerformanceActor; use actors::performance::PerformanceActor;
use actors::tab::{TabActor, TabActorMsg}; use actors::tab::{TabActor, TabActorMsg};
use protocol::{ActorDescription, JsonPacketStream}; use protocol::{ActorDescription, JsonPacketStream};
use serde_json::Value; use serde_json::{Map, Value};
use std::collections::BTreeMap;
use std::net::TcpStream; use std::net::TcpStream;
#[derive(Serialize)] #[derive(Serialize)]
@ -69,7 +68,7 @@ impl Actor for RootActor {
fn handle_message(&self, fn handle_message(&self,
registry: &ActorRegistry, registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
_msg: &BTreeMap<String, Value>, _msg: &Map<String, Value>,
stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"listAddons" => { "listAddons" => {

View file

@ -11,8 +11,7 @@ use actor::{Actor, ActorMessageStatus, ActorRegistry};
use actors::console::ConsoleActor; use actors::console::ConsoleActor;
use devtools_traits::DevtoolScriptControlMsg::{self, WantsLiveNotifications}; use devtools_traits::DevtoolScriptControlMsg::{self, WantsLiveNotifications};
use protocol::JsonPacketStream; use protocol::JsonPacketStream;
use serde_json::Value; use serde_json::{Map, Value};
use std::collections::BTreeMap;
use std::net::TcpStream; use std::net::TcpStream;
#[derive(Serialize)] #[derive(Serialize)]
@ -88,7 +87,7 @@ impl Actor for TabActor {
fn handle_message(&self, fn handle_message(&self,
registry: &ActorRegistry, registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
msg: &BTreeMap<String, Value>, msg: &Map<String, Value>,
stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"reconfigure" => { "reconfigure" => {

View file

@ -4,8 +4,7 @@
use actor::{Actor, ActorMessageStatus, ActorRegistry}; use actor::{Actor, ActorMessageStatus, ActorRegistry};
use protocol::JsonPacketStream; use protocol::JsonPacketStream;
use serde_json::Value; use serde_json::{Map, Value};
use std::collections::BTreeMap;
use std::net::TcpStream; use std::net::TcpStream;
#[derive(Serialize)] #[derive(Serialize)]
@ -68,7 +67,7 @@ impl Actor for ThreadActor {
fn handle_message(&self, fn handle_message(&self,
registry: &ActorRegistry, registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
_msg: &BTreeMap<String, Value>, _msg: &Map<String, Value>,
stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"attach" => { "attach" => {

View file

@ -12,9 +12,8 @@ use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use msg::constellation_msg::PipelineId; use msg::constellation_msg::PipelineId;
use protocol::JsonPacketStream; use protocol::JsonPacketStream;
use serde::{Serialize, Serializer}; use serde::{Serialize, Serializer};
use serde_json::Value; use serde_json::{Map, Value};
use std::cell::RefCell; use std::cell::RefCell;
use std::collections::BTreeMap;
use std::net::TcpStream; use std::net::TcpStream;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use std::thread; use std::thread;
@ -115,7 +114,7 @@ impl HighResolutionStamp {
} }
impl Serialize for 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) self.0.serialize(s)
} }
} }
@ -175,7 +174,7 @@ impl Actor for TimelineActor {
fn handle_message(&self, fn handle_message(&self,
registry: &ActorRegistry, registry: &ActorRegistry,
msg_type: &str, msg_type: &str,
msg: &BTreeMap<String, Value>, msg: &Map<String, Value>,
stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"start" => { "start" => {

View file

@ -4,8 +4,7 @@
use actor::{Actor, ActorMessageStatus, ActorRegistry}; use actor::{Actor, ActorMessageStatus, ActorRegistry};
use devtools_traits::WorkerId; use devtools_traits::WorkerId;
use serde_json::Value; use serde_json::{Map, Value};
use std::collections::BTreeMap;
use std::net::TcpStream; use std::net::TcpStream;
pub struct WorkerActor { pub struct WorkerActor {
@ -21,7 +20,7 @@ impl Actor for WorkerActor {
fn handle_message(&self, fn handle_message(&self,
_: &ActorRegistry, _: &ActorRegistry,
_: &str, _: &str,
_: &BTreeMap<String, Value>, _: &Map<String, Value>,
_: &mut TcpStream) -> Result<ActorMessageStatus, ()> { _: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(ActorMessageStatus::Processed) Ok(ActorMessageStatus::Processed)
} }

View file

@ -40,9 +40,9 @@ impl JsonPacketStream for TcpStream {
} }
fn write_merged_json_packet<T: Serialize, U: Serialize>(&mut self, base: &T, extra: &U) { 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 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(); let extra = extra.as_object().unwrap();
for (key, value) in extra { for (key, value) in extra {
@ -79,14 +79,7 @@ impl JsonPacketStream for TcpStream {
debug!("{}", packet); debug!("{}", packet);
return match serde_json::from_str(&packet) { return match serde_json::from_str(&packet) {
Ok(json) => Ok(Some(json)), Ok(json) => Ok(Some(json)),
Err(err) => match err { Err(err) => Err(err.description().to_owned()),
serde_json::Error::Io(ioerr) => {
return Err(ioerr.description().to_owned())
},
serde_json::Error::Syntax(_, l, c) => {
return Err(format!("syntax at {}:{}", l, c))
},
},
}; };
}, },
c => buffer.push(c), c => buffer.push(c),

View file

@ -14,10 +14,10 @@ bitflags = "0.7"
heapsize = "0.3.0" heapsize = "0.3.0"
heapsize_derive = "0.1" heapsize_derive = "0.1"
hyper = "0.9.9" hyper = "0.9.9"
hyper_serde = "0.1.4" hyper_serde = "0.5"
ipc-channel = "0.6.3" ipc-channel = "0.7"
msg = {path = "../msg"} msg = {path = "../msg"}
serde = "0.8" serde = "0.9"
serde_derive = "0.8" serde_derive = "0.9"
servo_url = {path = "../url"} servo_url = {path = "../url"}
time = "0.1" time = "0.1"

View file

@ -11,9 +11,9 @@ path = "lib.rs"
[features] [features]
# servo as opposed to geckolib # servo as opposed to geckolib
servo = ["app_units/plugins", "euclid/unstable"] servo = ["euclid/unstable"]
[dependencies] [dependencies]
app_units = "0.3" app_units = "0.4"
euclid = "0.10.1" euclid = "0.11"
heapsize = "0.3.0" heapsize = "0.3.0"

View file

@ -11,16 +11,16 @@ name = "gfx"
path = "lib.rs" path = "lib.rs"
[dependencies] [dependencies]
app_units = "0.3" app_units = "0.4"
bitflags = "0.7" bitflags = "0.7"
euclid = "0.10.1" euclid = "0.11"
fnv = "1.0" fnv = "1.0"
fontsan = {git = "https://github.com/servo/fontsan"} fontsan = {git = "https://github.com/servo/fontsan"}
gfx_traits = {path = "../gfx_traits"} gfx_traits = {path = "../gfx_traits"}
harfbuzz-sys = "0.1" harfbuzz-sys = "0.1"
heapsize = "0.3.0" heapsize = "0.3.0"
heapsize_derive = "0.1" heapsize_derive = "0.1"
ipc-channel = "0.6.3" ipc-channel = "0.7"
lazy_static = "0.2" lazy_static = "0.2"
libc = "0.2" libc = "0.2"
log = "0.3.5" log = "0.3.5"
@ -29,8 +29,8 @@ net_traits = {path = "../net_traits"}
ordered-float = "0.4" ordered-float = "0.4"
plugins = {path = "../plugins"} plugins = {path = "../plugins"}
range = {path = "../range"} range = {path = "../range"}
serde = "0.8" serde = "0.9"
serde_derive = "0.8" serde_derive = "0.9"
servo_atoms = {path = "../atoms"} servo_atoms = {path = "../atoms"}
servo_geometry = {path = "../geometry"} servo_geometry = {path = "../geometry"}
servo_url = {path = "../url"} servo_url = {path = "../url"}
@ -49,8 +49,8 @@ features = ["serde_derive", "ipc"]
[target.'cfg(target_os = "macos")'.dependencies] [target.'cfg(target_os = "macos")'.dependencies]
byteorder = "1.0" byteorder = "1.0"
core-foundation = "0.3" core-foundation = "0.3"
core-graphics = "0.6" core-graphics = "0.7"
core-text = "3.0" core-text = "4.0"
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies] [target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
freetype = "0.2" freetype = "0.2"
@ -60,5 +60,5 @@ servo-fontconfig = "0.2.1"
simd = "0.2.0" simd = "0.2.0"
[target.'cfg(target_os = "windows")'.dependencies] [target.'cfg(target_os = "windows")'.dependencies]
dwrote = "0.1.5" dwrote = {git = "https://github.com/servo/dwrote-rs.git", rev = "servo"}
truetype = "0.26" truetype = "0.26"

View file

@ -13,6 +13,7 @@ use servo_atoms::Atom;
use servo_url::ServoUrl; use servo_url::ServoUrl;
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::collections::HashMap; use std::collections::HashMap;
use std::fmt;
use std::fs::File; use std::fs::File;
use std::io::{Read, Error as IoError}; use std::io::{Read, Error as IoError};
use std::ops::Deref; use std::ops::Deref;
@ -121,21 +122,25 @@ impl Deref for CachedCTFont {
} }
impl Serialize 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() serializer.serialize_none()
} }
} }
impl Deserialize for CachedCTFont { 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 { where D: Deserializer {
struct NoneOptionVisitor; struct NoneOptionVisitor;
impl Visitor for NoneOptionVisitor { impl Visitor for NoneOptionVisitor {
type Value = CachedCTFont; type Value = CachedCTFont;
fn expecting(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
write!(fmt, "none")
}
#[inline] #[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()))) Ok(CachedCTFont(Mutex::new(HashMap::new())))
} }
} }

View file

@ -14,5 +14,5 @@ heapsize = "0.3.0"
heapsize_derive = "0.1" heapsize_derive = "0.1"
plugins = {path = "../plugins"} plugins = {path = "../plugins"}
range = {path = "../range"} range = {path = "../range"}
serde = "0.8" serde = "0.9"
serde_derive = "0.8" serde_derive = "0.9"

View file

@ -10,18 +10,18 @@ name = "layout"
path = "lib.rs" path = "lib.rs"
[dependencies] [dependencies]
app_units = "0.3" app_units = "0.4"
atomic_refcell = "0.1" atomic_refcell = "0.1"
bitflags = "0.7" bitflags = "0.7"
canvas_traits = {path = "../canvas_traits"} canvas_traits = {path = "../canvas_traits"}
cssparser = {version = "0.9", features = ["heap_size", "serde-serialization"]} cssparser = {version = "0.10", features = ["heapsize", "serde"]}
euclid = "0.10.1" euclid = "0.11"
fnv = "1.0" fnv = "1.0"
gfx = {path = "../gfx"} gfx = {path = "../gfx"}
gfx_traits = {path = "../gfx_traits"} gfx_traits = {path = "../gfx_traits"}
heapsize = "0.3.0" heapsize = "0.3.0"
html5ever-atoms = "0.1" html5ever-atoms = "0.2"
ipc-channel = "0.6.3" ipc-channel = "0.7"
libc = "0.2" libc = "0.2"
log = "0.3.5" log = "0.3.5"
msg = {path = "../msg"} msg = {path = "../msg"}
@ -35,10 +35,10 @@ rayon = "0.6"
script_layout_interface = {path = "../script_layout_interface"} script_layout_interface = {path = "../script_layout_interface"}
script_traits = {path = "../script_traits"} script_traits = {path = "../script_traits"}
selectors = { path = "../selectors" } selectors = { path = "../selectors" }
serde = "0.8" serde = "0.9"
serde_derive = "0.8" serde_derive = "0.9"
servo_geometry = {path = "../geometry"} servo_geometry = {path = "../geometry"}
serde_json = "0.8" serde_json = "0.9"
servo_config = {path = "../config"} servo_config = {path = "../config"}
servo_url = {path = "../url"} servo_url = {path = "../url"}
smallvec = "0.1" smallvec = "0.1"

View file

@ -524,7 +524,7 @@ bitflags! {
} }
impl Serialize for BlockFlowFlags { 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) self.bits().serialize(serializer)
} }
} }

View file

@ -42,7 +42,7 @@ use inline::InlineFlow;
use model::{CollapsibleMargins, IntrinsicISizes, MarginCollapseInfo}; use model::{CollapsibleMargins, IntrinsicISizes, MarginCollapseInfo};
use multicol::MulticolFlow; use multicol::MulticolFlow;
use parallel::FlowParallelInfo; 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 servo_geometry::{au_rect_to_f32_rect, f32_rect_to_au_rect};
use std::{fmt, mem, raw}; use std::{fmt, mem, raw};
use std::iter::Zip; use std::iter::Zip;
@ -1013,16 +1013,16 @@ impl fmt::Debug for BaseFlow {
} }
impl Serialize for BaseFlow { impl Serialize for BaseFlow {
fn serialize<S: Serializer>(&self, serializer: &mut S) -> Result<(), S::Error> { fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut state = try!(serializer.serialize_struct("base", 5)); let mut serializer = try!(serializer.serialize_struct("base", 5));
try!(serializer.serialize_struct_elt(&mut state, "id", self.debug_id())); try!(serializer.serialize_field("id", &self.debug_id()));
try!(serializer.serialize_struct_elt(&mut state, "stacking_relative_position", try!(serializer.serialize_field("stacking_relative_position",
&self.stacking_relative_position)); &self.stacking_relative_position));
try!(serializer.serialize_struct_elt(&mut state, "intrinsic_inline_sizes", try!(serializer.serialize_field("intrinsic_inline_sizes",
&self.intrinsic_inline_sizes)); &self.intrinsic_inline_sizes));
try!(serializer.serialize_struct_elt(&mut state, "position", &self.position)); try!(serializer.serialize_field("position", &self.position));
try!(serializer.serialize_struct_elt(&mut state, "children", &self.children)); try!(serializer.serialize_field("children", &self.children));
serializer.serialize_struct_end(state) serializer.end()
} }
} }

View file

@ -4,9 +4,8 @@
use flow::{Flow, FlowClass}; use flow::{Flow, FlowClass};
use flow_ref::FlowRef; use flow_ref::FlowRef;
use serde::{Serialize, Serializer}; use serde::ser::{Serialize, SerializeSeq, Serializer};
use serde_json::{to_value, Value}; use serde_json::{Map, Value, to_value};
use serde_json::builder::ObjectBuilder;
use std::collections::{LinkedList, linked_list}; use std::collections::{LinkedList, linked_list};
use std::sync::Arc; use std::sync::Arc;
@ -24,30 +23,29 @@ pub struct FlowList {
} }
impl Serialize for FlowList { impl Serialize for FlowList {
fn serialize<S: Serializer>(&self, serializer: &mut S) -> Result<(), S::Error> { fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut state = try!(serializer.serialize_seq(Some(self.len()))); let mut serializer = try!(serializer.serialize_seq(Some(self.len())));
for f in self.iter() { for f in self.iter() {
let flow_val = ObjectBuilder::new() let mut flow_val = Map::new();
.insert("class", f.class()) flow_val.insert("class".to_owned(), to_value(f.class()).unwrap());
.insert("data", match f.class() { let data = match f.class() {
FlowClass::Block => to_value(f.as_block()), FlowClass::Block => to_value(f.as_block()).unwrap(),
FlowClass::Inline => to_value(f.as_inline()), FlowClass::Inline => to_value(f.as_inline()).unwrap(),
FlowClass::Table => to_value(f.as_table()), FlowClass::Table => to_value(f.as_table()).unwrap(),
FlowClass::TableWrapper => to_value(f.as_table_wrapper()), FlowClass::TableWrapper => to_value(f.as_table_wrapper()).unwrap(),
FlowClass::TableRowGroup => to_value(f.as_table_rowgroup()), FlowClass::TableRowGroup => to_value(f.as_table_rowgroup()).unwrap(),
FlowClass::TableRow => to_value(f.as_table_row()), FlowClass::TableRow => to_value(f.as_table_row()).unwrap(),
FlowClass::TableCell => to_value(f.as_table_cell()), FlowClass::TableCell => to_value(f.as_table_cell()).unwrap(),
FlowClass::Flex => to_value(f.as_flex()), FlowClass::Flex => to_value(f.as_flex()).unwrap(),
FlowClass::ListItem | FlowClass::TableColGroup | FlowClass::TableCaption | FlowClass::ListItem | FlowClass::TableColGroup | FlowClass::TableCaption |
FlowClass::Multicol | FlowClass::MulticolColumn => { FlowClass::Multicol | FlowClass::MulticolColumn => {
Value::Null // Not implemented yet Value::Null // Not implemented yet
} }
}) };
.build(); flow_val.insert("data".to_owned(), data);
try!(serializer.serialize_element(&flow_val));
try!(serializer.serialize_seq_elt(&mut state, flow_val));
} }
serializer.serialize_seq_end(state) serializer.end()
} }
} }

View file

@ -32,7 +32,7 @@ use range::*;
use script_layout_interface::HTMLCanvasData; use script_layout_interface::HTMLCanvasData;
use script_layout_interface::SVGSVGData; use script_layout_interface::SVGSVGData;
use script_layout_interface::wrapper_traits::{PseudoElementType, ThreadSafeLayoutElement, ThreadSafeLayoutNode}; use script_layout_interface::wrapper_traits::{PseudoElementType, ThreadSafeLayoutElement, ThreadSafeLayoutNode};
use serde::{Serialize, Serializer}; use serde::ser::{Serialize, SerializeStruct, Serializer};
use servo_url::ServoUrl; use servo_url::ServoUrl;
use std::{f32, fmt}; use std::{f32, fmt};
use std::borrow::ToOwned; use std::borrow::ToOwned;
@ -142,12 +142,12 @@ pub struct Fragment {
} }
impl Serialize for Fragment { impl Serialize for Fragment {
fn serialize<S: Serializer>(&self, serializer: &mut S) -> Result<(), S::Error> { fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut state = try!(serializer.serialize_struct("fragment", 3)); let mut serializer = try!(serializer.serialize_struct("fragment", 3));
try!(serializer.serialize_struct_elt(&mut state, "id", &self.debug_id)); try!(serializer.serialize_field("id", &self.debug_id));
try!(serializer.serialize_struct_elt(&mut state, "border_box", &self.border_box)); try!(serializer.serialize_field("border_box", &self.border_box));
try!(serializer.serialize_struct_elt(&mut state, "margin", &self.margin)); try!(serializer.serialize_field("margin", &self.margin));
serializer.serialize_struct_end(state) serializer.end()
} }
} }
@ -3179,14 +3179,14 @@ impl fmt::Display for DebugId {
#[cfg(not(debug_assertions))] #[cfg(not(debug_assertions))]
impl Serialize for DebugId { 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)) serializer.serialize_str(&format!("{:p}", &self))
} }
} }
#[cfg(debug_assertions)] #[cfg(debug_assertions)]
impl Serialize for DebugId { 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) serializer.serialize_u16(self.0)
} }
} }

View file

@ -63,7 +63,7 @@ impl Scope {
pub fn new(name: String) -> Scope { pub fn new(name: String) -> Scope {
STATE_KEY.with(|ref r| { STATE_KEY.with(|ref r| {
if let Some(ref mut state) = *r.borrow_mut() { 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); let data = box ScopeData::new(name.clone(), flow_trace);
state.scope_stack.push(data); state.scope_stack.push(data);
} }
@ -78,7 +78,7 @@ impl Drop for Scope {
STATE_KEY.with(|ref r| { STATE_KEY.with(|ref r| {
if let Some(ref mut state) = *r.borrow_mut() { if let Some(ref mut state) = *r.borrow_mut() {
let mut current_scope = state.scope_stack.pop().unwrap(); 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(); let previous_scope = state.scope_stack.last_mut().unwrap();
previous_scope.children.push(current_scope); 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())); assert!(STATE_KEY.with(|ref r| r.borrow().is_none()));
STATE_KEY.with(|ref r| { 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 { let state = State {
scope_stack: vec![box ScopeData::new("root".to_owned(), flow_trace)], scope_stack: vec![box ScopeData::new("root".to_owned(), flow_trace)],
flow_root: flow_root.clone(), 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()); let mut thread_state = STATE_KEY.with(|ref r| r.borrow_mut().take().unwrap());
assert!(thread_state.scope_stack.len() == 1); assert!(thread_state.scope_stack.len() == 1);
let mut root_scope = thread_state.scope_stack.pop().unwrap(); 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 result = to_string(&root_scope).unwrap();
let mut file = File::create(format!("layout_trace-{}.json", generation)).unwrap(); let mut file = File::create(format!("layout_trace-{}.json", generation)).unwrap();

View file

@ -69,7 +69,7 @@ pub struct TableRowFlow {
} }
impl Serialize for 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) self.block_flow.serialize(serializer)
} }
} }
@ -578,8 +578,8 @@ pub struct CollapsedBorder {
} }
impl Serialize for CollapsedBorder { impl Serialize for CollapsedBorder {
fn serialize<S: Serializer>(&self, _: &mut S) -> Result<(), S::Error> { fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
Ok(()) serializer.serialize_unit()
} }
} }

View file

@ -45,7 +45,7 @@ pub struct TableRowGroupFlow {
} }
impl Serialize for 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) self.block_flow.serialize(serializer)
} }
} }

View file

@ -10,13 +10,13 @@ name = "layout_thread"
path = "lib.rs" path = "lib.rs"
[dependencies] [dependencies]
app_units = "0.3" app_units = "0.4"
euclid = "0.10.1" euclid = "0.11"
fnv = "1.0" fnv = "1.0"
gfx = {path = "../gfx"} gfx = {path = "../gfx"}
gfx_traits = {path = "../gfx_traits"} gfx_traits = {path = "../gfx_traits"}
heapsize = "0.3.0" heapsize = "0.3.0"
ipc-channel = "0.6.3" ipc-channel = "0.7"
layout = {path = "../layout"} layout = {path = "../layout"}
layout_traits = {path = "../layout_traits"} layout_traits = {path = "../layout_traits"}
lazy_static = "0.2" lazy_static = "0.2"
@ -31,8 +31,8 @@ script = {path = "../script"}
script_layout_interface = {path = "../script_layout_interface"} script_layout_interface = {path = "../script_layout_interface"}
script_traits = {path = "../script_traits"} script_traits = {path = "../script_traits"}
selectors = { path = "../selectors" } selectors = { path = "../selectors" }
serde_derive = "0.8" serde_derive = "0.9"
serde_json = "0.8" serde_json = "0.9"
servo_config = {path = "../config"} servo_config = {path = "../config"}
servo_geometry = {path = "../geometry"} servo_geometry = {path = "../geometry"}
servo_url = {path = "../url"} servo_url = {path = "../url"}

View file

@ -11,7 +11,7 @@ path = "lib.rs"
[dependencies] [dependencies]
gfx = {path = "../gfx"} gfx = {path = "../gfx"}
ipc-channel = "0.6.3" ipc-channel = "0.7"
msg = {path = "../msg"} msg = {path = "../msg"}
net_traits = {path = "../net_traits"} net_traits = {path = "../net_traits"}
profile_traits = {path = "../profile_traits"} profile_traits = {path = "../profile_traits"}

View file

@ -11,12 +11,12 @@ path = "lib.rs"
[dependencies] [dependencies]
bitflags = "0.7" bitflags = "0.7"
cssparser = {version = "0.9", features = ["heap_size", "serde-serialization"]} cssparser = {version = "0.10", features = ["heapsize", "serde"]}
heapsize = "0.3.0" heapsize = "0.3.0"
heapsize_derive = "0.1" heapsize_derive = "0.1"
plugins = {path = "../plugins"} plugins = {path = "../plugins"}
serde = "0.8" serde = "0.9"
serde_derive = "0.8" serde_derive = "0.9"
[dependencies.webrender_traits] [dependencies.webrender_traits]
git = "https://github.com/servo/webrender" git = "https://github.com/servo/webrender"

View file

@ -11,14 +11,14 @@ path = "lib.rs"
[dependencies] [dependencies]
brotli = "1.0.6" brotli = "1.0.6"
content-blocker = "0.2.1" content-blocker = "0.2.3"
cookie = {version = "0.2.5", features = ["serialize-rustc"]} cookie = {version = "0.2.5", features = ["serialize-rustc"]}
devtools_traits = {path = "../devtools_traits"} devtools_traits = {path = "../devtools_traits"}
flate2 = "0.2.0" flate2 = "0.2.0"
hyper = "0.9.9" hyper = "0.9.9"
hyper_serde = "0.1.4" hyper_serde = "0.5"
immeta = "0.3.1" immeta = "0.3.1"
ipc-channel = "0.6.3" ipc-channel = "0.7"
lazy_static = "0.2" lazy_static = "0.2"
log = "0.3.5" log = "0.3.5"
matches = "0.1" matches = "0.1"
@ -37,7 +37,7 @@ threadpool = "1.0"
time = "0.1.17" time = "0.1.17"
unicase = "1.4.0" unicase = "1.4.0"
url = {version = "1.2", features = ["heap_size", "rustc-serialize"]} 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" websocket = "0.17"
[dependencies.webrender_traits] [dependencies.webrender_traits]

View file

@ -14,19 +14,19 @@ cookie = {version = "0.2.5", features = ["serialize-rustc"]}
heapsize = "0.3.0" heapsize = "0.3.0"
heapsize_derive = "0.1" heapsize_derive = "0.1"
hyper = "0.9.9" hyper = "0.9.9"
hyper_serde = "0.1.4" hyper_serde = "0.5"
image = "0.12" image = "0.12"
ipc-channel = "0.6.3" ipc-channel = "0.7"
lazy_static = "0.2" lazy_static = "0.2"
log = "0.3.5" log = "0.3.5"
msg = {path = "../msg"} msg = {path = "../msg"}
num-traits = "0.1.32" num-traits = "0.1.32"
serde = "0.8" serde = "0.9"
serde_derive = "0.8" serde_derive = "0.9"
servo_config = {path = "../config", features = ["servo"]} servo_config = {path = "../config", features = ["servo"]}
servo_url = {path = "../url", features = ["servo"]} servo_url = {path = "../url", features = ["servo"]}
url = {version = "1.2", features = ["heap_size"]} 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" websocket = "0.17"
[dependencies.webrender_traits] [dependencies.webrender_traits]

View file

@ -39,7 +39,7 @@ use hyper::header::{ContentType, Headers, ReferrerPolicy as ReferrerPolicyHeader
use hyper::http::RawStatus; use hyper::http::RawStatus;
use hyper::mime::{Attr, Mime}; use hyper::mime::{Attr, Mime};
use hyper_serde::Serde; use hyper_serde::Serde;
use ipc_channel::SerializeError; use ipc_channel::Error;
use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER; use ipc_channel::router::ROUTER;
use request::{Request, RequestInit}; use request::{Request, RequestInit};
@ -266,7 +266,7 @@ impl<T: FetchResponseListener> Action<T> for FetchResponseMsg {
/// Handle to a resource thread /// Handle to a resource thread
pub type CoreResourceThread = IpcSender<CoreResourceMsg>; 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, /// Abstraction of the ability to send a particular type of message,
/// used by net_traits::ResourceThreads to ease the use its IpcSender sub-fields /// used by net_traits::ResourceThreads to ease the use its IpcSender sub-fields

View file

@ -12,12 +12,12 @@ path = "lib.rs"
[dependencies] [dependencies]
profile_traits = {path = "../profile_traits"} profile_traits = {path = "../profile_traits"}
plugins = {path = "../plugins"} plugins = {path = "../plugins"}
ipc-channel = "0.6.3" ipc-channel = "0.7"
heartbeats-simple = "0.4" heartbeats-simple = "0.4"
log = "0.3.5" log = "0.3.5"
serde = "0.8" serde = "0.9"
serde_derive = "0.8" serde_derive = "0.9"
serde_json = "0.8" serde_json = "0.9"
servo_config = {path = "../config", features = ["servo"]} servo_config = {path = "../config", features = ["servo"]}
time = "0.1.12" time = "0.1.12"

View file

@ -15,11 +15,11 @@ energy-profiling = ["energymon", "energy-monitor"]
[dependencies] [dependencies]
energy-monitor = {version = "0.2.0", optional = true} energy-monitor = {version = "0.2.0", optional = true}
energymon = {git = "https://github.com/energymon/energymon-rust.git", 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" log = "0.3.5"
plugins = {path = "../plugins"} plugins = {path = "../plugins"}
serde = "0.8" serde = "0.9"
serde_derive = "0.8" serde_derive = "0.9"
servo_config = {path = "../config"} servo_config = {path = "../config"}
signpost = {git = "https://github.com/pcwalton/signpost.git"} signpost = {git = "https://github.com/pcwalton/signpost.git"}
time = "0.1.12" time = "0.1.12"

View file

@ -14,5 +14,5 @@ path = "lib.rs"
heapsize = "0.3.0" heapsize = "0.3.0"
heapsize_derive = "0.1" heapsize_derive = "0.1"
num-traits = "0.1.32" num-traits = "0.1.32"
serde = "0.8" serde = "0.9"
serde_derive = "0.8" serde_derive = "0.9"

View file

@ -18,14 +18,14 @@ debugmozjs = ['js/debugmozjs']
cmake = "0.1" cmake = "0.1"
phf_codegen = "0.7.18" phf_codegen = "0.7.18"
phf_shared = "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] [target.'cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))'.dependencies]
tinyfiledialogs = "2.5.9" tinyfiledialogs = "2.5.9"
[dependencies] [dependencies]
angle = {git = "https://github.com/servo/angle", branch = "servo"} angle = {git = "https://github.com/servo/angle", branch = "servo"}
app_units = "0.3" app_units = "0.4"
audio-video-metadata = "0.1.2" audio-video-metadata = "0.1.2"
atomic_refcell = "0.1" atomic_refcell = "0.1"
bitflags = "0.7" bitflags = "0.7"
@ -34,22 +34,22 @@ byteorder = "1.0"
canvas_traits = {path = "../canvas_traits"} canvas_traits = {path = "../canvas_traits"}
caseless = "0.1.0" caseless = "0.1.0"
cookie = {version = "0.2.5", features = ["serialize-rustc"]} 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"} deny_public_fields = {path = "../deny_public_fields"}
devtools_traits = {path = "../devtools_traits"} devtools_traits = {path = "../devtools_traits"}
domobject_derive = {path = "../domobject_derive"} domobject_derive = {path = "../domobject_derive"}
encoding = "0.2" encoding = "0.2"
euclid = "0.10.1" euclid = "0.11"
fnv = "1.0" fnv = "1.0"
gfx_traits = {path = "../gfx_traits"} gfx_traits = {path = "../gfx_traits"}
heapsize = "0.3.6" heapsize = "0.3.6"
heapsize_derive = "0.1" heapsize_derive = "0.1"
html5ever = {version = "0.12.1", features = ["heap_size", "unstable"]} html5ever = {version = "0.13", features = ["heap_size", "unstable"]}
html5ever-atoms = {version = "0.1", features = ["heap_size"]} html5ever-atoms = {version = "0.2", features = ["heap_size"]}
hyper = "0.9.9" hyper = "0.9.9"
hyper_serde = "0.1.4" hyper_serde = "0.5"
image = "0.12" image = "0.12"
ipc-channel = "0.6.3" ipc-channel = "0.7"
js = {git = "https://github.com/servo/rust-mozjs", features = ["promises"]} js = {git = "https://github.com/servo/rust-mozjs", features = ["promises"]}
jstraceable_derive = {path = "../jstraceable_derive"} jstraceable_derive = {path = "../jstraceable_derive"}
libc = "0.2" libc = "0.2"
@ -59,7 +59,7 @@ mime_guess = "1.8.0"
msg = {path = "../msg"} msg = {path = "../msg"}
net_traits = {path = "../net_traits"} net_traits = {path = "../net_traits"}
num-traits = "0.1.32" num-traits = "0.1.32"
offscreen_gl_context = "0.5.0" offscreen_gl_context = "0.6"
open = "1.1.1" open = "1.1.1"
parking_lot = "0.3" parking_lot = "0.3"
phf = "0.7.18" phf = "0.7.18"
@ -74,7 +74,7 @@ script_layout_interface = {path = "../script_layout_interface"}
script_plugins = {path = "../script_plugins"} script_plugins = {path = "../script_plugins"}
script_traits = {path = "../script_traits"} script_traits = {path = "../script_traits"}
selectors = { path = "../selectors" } selectors = { path = "../selectors" }
serde = "0.8" serde = "0.9"
servo_atoms = {path = "../atoms"} servo_atoms = {path = "../atoms"}
servo_config = {path = "../config", features = ["servo"] } servo_config = {path = "../config", features = ["servo"] }
servo_geometry = {path = "../geometry" } servo_geometry = {path = "../geometry" }
@ -85,9 +85,9 @@ style = {path = "../style"}
style_traits = {path = "../style_traits"} style_traits = {path = "../style_traits"}
time = "0.1.12" time = "0.1.12"
url = {version = "1.2", features = ["heap_size", "query_encoding"]} 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" websocket = "0.17"
xml5ever = {version = "0.3.1", features = ["unstable"]} xml5ever = {version = "0.4", features = ["unstable"]}
webvr = {path = "../webvr"} webvr = {path = "../webvr"}
webvr_traits = {path = "../webvr_traits"} webvr_traits = {path = "../webvr_traits"}

View file

@ -10,16 +10,16 @@ name = "script_layout_interface"
path = "lib.rs" path = "lib.rs"
[dependencies] [dependencies]
app_units = "0.3" app_units = "0.4"
atomic_refcell = "0.1" atomic_refcell = "0.1"
canvas_traits = {path = "../canvas_traits"} canvas_traits = {path = "../canvas_traits"}
cssparser = {version = "0.9", features = ["heap_size", "serde-serialization"]} cssparser = {version = "0.10", features = ["heapsize", "serde"]}
euclid = "0.10.1" euclid = "0.11"
gfx_traits = {path = "../gfx_traits"} gfx_traits = {path = "../gfx_traits"}
heapsize = "0.3.0" heapsize = "0.3.0"
heapsize_derive = "0.1" heapsize_derive = "0.1"
html5ever-atoms = "0.1" html5ever-atoms = "0.2"
ipc-channel = "0.6.3" ipc-channel = "0.7"
libc = "0.2" libc = "0.2"
log = "0.3.5" log = "0.3.5"
msg = {path = "../msg"} msg = {path = "../msg"}

View file

@ -10,27 +10,27 @@ name = "script_traits"
path = "lib.rs" path = "lib.rs"
[dependencies] [dependencies]
app_units = "0.3" app_units = "0.4"
bluetooth_traits = {path = "../bluetooth_traits"} bluetooth_traits = {path = "../bluetooth_traits"}
canvas_traits = {path = "../canvas_traits"} canvas_traits = {path = "../canvas_traits"}
cookie = {version = "0.2.5", features = ["serialize-rustc"]} cookie = {version = "0.2.5", features = ["serialize-rustc"]}
devtools_traits = {path = "../devtools_traits"} devtools_traits = {path = "../devtools_traits"}
euclid = "0.10.1" euclid = "0.11"
gfx_traits = {path = "../gfx_traits"} gfx_traits = {path = "../gfx_traits"}
heapsize = "0.3.0" heapsize = "0.3.0"
heapsize_derive = "0.1" heapsize_derive = "0.1"
hyper = "0.9.9" hyper = "0.9.9"
hyper_serde = "0.1.4" hyper_serde = "0.5"
ipc-channel = "0.6.3" ipc-channel = "0.7"
libc = "0.2" libc = "0.2"
msg = {path = "../msg"} msg = {path = "../msg"}
net_traits = {path = "../net_traits"} net_traits = {path = "../net_traits"}
offscreen_gl_context = "0.5.0" offscreen_gl_context = "0.6"
plugins = {path = "../plugins"} plugins = {path = "../plugins"}
profile_traits = {path = "../profile_traits"} profile_traits = {path = "../profile_traits"}
rustc-serialize = "0.3.4" rustc-serialize = "0.3.4"
serde = "0.8" serde = "0.9"
serde_derive = "0.8" serde_derive = "0.9"
servo_url = {path = "../url", features = ["servo"]} servo_url = {path = "../url", features = ["servo"]}
style_traits = {path = "../style_traits", features = ["servo"]} style_traits = {path = "../style_traits", features = ["servo"]}
time = "0.1.12" time = "0.1.12"

View file

@ -91,13 +91,13 @@ impl HeapSizeOf for UntrustedNodeAddress {
unsafe impl Send for UntrustedNodeAddress {} unsafe impl Send for UntrustedNodeAddress {}
impl Serialize 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) (self.0 as usize).serialize(s)
} }
} }
impl Deserialize for UntrustedNodeAddress { 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)); let value: usize = try!(Deserialize::deserialize(d));
Ok(UntrustedNodeAddress::from_id(value)) Ok(UntrustedNodeAddress::from_id(value))
} }

View file

@ -18,5 +18,5 @@ path = "lib.rs"
[dependencies] [dependencies]
bitflags = "0.7" bitflags = "0.7"
matches = "0.1" matches = "0.1"
cssparser = "0.9" cssparser = "0.10"
fnv = "1.0" fnv = "1.0"

View file

@ -31,10 +31,10 @@ debugger = {path = "../debugger"}
devtools = {path = "../devtools"} devtools = {path = "../devtools"}
devtools_traits = {path = "../devtools_traits"} devtools_traits = {path = "../devtools_traits"}
env_logger = "0.4" env_logger = "0.4"
euclid = "0.10.1" euclid = "0.11"
gfx = {path = "../gfx"} gfx = {path = "../gfx"}
gleam = "0.2" gleam = "0.2"
ipc-channel = "0.6.3" ipc-channel = "0.7"
layout_thread = {path = "../layout_thread"} layout_thread = {path = "../layout_thread"}
log = "0.3" log = "0.3"
msg = {path = "../msg"} msg = {path = "../msg"}

View file

@ -16,23 +16,23 @@ doctest = false
gecko = ["nsstring_vendor", "num_cpus", "rayon/unstable"] gecko = ["nsstring_vendor", "num_cpus", "rayon/unstable"]
use_bindgen = ["bindgen", "regex"] use_bindgen = ["bindgen", "regex"]
servo = ["serde/unstable", "serde", "serde_derive", "heapsize_derive", servo = ["serde/unstable", "serde", "serde_derive", "heapsize_derive",
"style_traits/servo", "app_units/plugins", "servo_atoms", "html5ever-atoms", "style_traits/servo", "servo_atoms", "html5ever-atoms",
"cssparser/heap_size", "cssparser/serde-serialization", "cssparser/heapsize", "cssparser/serde",
"rayon/unstable", "servo_url/servo"] "rayon/unstable", "servo_url/servo"]
testing = [] testing = []
[dependencies] [dependencies]
app_units = "0.3" app_units = "0.4"
atomic_refcell = "0.1" atomic_refcell = "0.1"
bitflags = "0.7" bitflags = "0.7"
cfg-if = "0.1.0" cfg-if = "0.1.0"
cssparser = "0.9" cssparser = "0.10"
encoding = "0.2" encoding = "0.2"
euclid = "0.10.1" euclid = "0.11"
fnv = "1.0" fnv = "1.0"
heapsize = "0.3.0" heapsize = "0.3.0"
heapsize_derive = {version = "0.1", optional = true} 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" lazy_static = "0.2"
log = "0.3.5" log = "0.3.5"
matches = "0.1" matches = "0.1"
@ -47,8 +47,8 @@ pdqsort = "0.1.0"
rayon = "0.6" rayon = "0.6"
rustc-serialize = "0.3" rustc-serialize = "0.3"
selectors = { path = "../selectors" } selectors = { path = "../selectors" }
serde = {version = "0.8", optional = true} serde = {version = "0.9", optional = true}
serde_derive = {version = "0.8", optional = true} serde_derive = {version = "0.9", optional = true}
servo_atoms = {path = "../atoms", optional = true} servo_atoms = {path = "../atoms", optional = true}
servo_config = {path = "../config"} servo_config = {path = "../config"}
smallvec = "0.1" smallvec = "0.1"

View file

@ -11,14 +11,14 @@ path = "lib.rs"
[features] [features]
servo = ["heapsize", "heapsize_derive", "serde", "serde_derive", servo = ["heapsize", "heapsize_derive", "serde", "serde_derive",
"cssparser/heap_size", "cssparser/serde-serialization"] "cssparser/heapsize", "cssparser/serde"]
[dependencies] [dependencies]
app_units = "0.3" app_units = "0.4"
cssparser = "0.9" cssparser = "0.10"
euclid = "0.10.1" euclid = "0.11"
heapsize = {version = "0.3.0", optional = true} heapsize = {version = "0.3.0", optional = true}
heapsize_derive = {version = "0.1", optional = true} heapsize_derive = {version = "0.1", optional = true}
rustc-serialize = "0.3" rustc-serialize = "0.3"
serde = {version = "0.8", optional = true} serde = {version = "0.9", optional = true}
serde_derive = {version = "0.8", optional = true} serde_derive = {version = "0.9", optional = true}

View file

@ -10,13 +10,11 @@ name = "servo_url"
path = "lib.rs" path = "lib.rs"
[features] [features]
servo = ["heapsize", "heapsize_derive", "serde", "serde_derive", servo = ["heapsize", "heapsize_derive", "serde", "url/heap_size", "url_serde"]
"url/heap_size", "url/serde"]
[dependencies] [dependencies]
heapsize = {version = "0.3.0", optional = true} heapsize = {version = "0.3.0", optional = true}
heapsize_derive = {version = "0.1", optional = true} heapsize_derive = {version = "0.1", optional = true}
serde = {version = "0.8", optional = true} serde = {version = "0.9", optional = true}
serde_derive = {version = "0.8", optional = true}
url = "1.2" url = "1.2"
url_serde = {version = "0.1", optional = true}

View file

@ -7,11 +7,10 @@
#![crate_name = "servo_url"] #![crate_name = "servo_url"]
#![crate_type = "rlib"] #![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")] extern crate heapsize;
#[cfg(feature = "servo")] #[macro_use] extern crate heapsize_derive; #[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; extern crate url;
@ -23,7 +22,7 @@ use std::sync::Arc;
use url::{Url, Origin, Position}; use url::{Url, Origin, Position};
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] #[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>); pub struct ServoUrl(Arc<Url>);
impl ServoUrl { impl ServoUrl {
@ -196,3 +195,21 @@ impl From<Url> for ServoUrl {
ServoUrl::from_url(url) 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)
}
}

View file

@ -11,10 +11,10 @@ path = "lib.rs"
[dependencies] [dependencies]
cookie = {version = "0.2.5", features = ["serialize-rustc"]} cookie = {version = "0.2.5", features = ["serialize-rustc"]}
euclid = "0.10.1" euclid = "0.11"
hyper = "0.9.9" hyper = "0.9.9"
image = "0.12" image = "0.12"
ipc-channel = "0.6.3" ipc-channel = "0.7"
log = "0.3.5" log = "0.3.5"
msg = {path = "../msg"} msg = {path = "../msg"}
net_traits = {path = "../net_traits"} net_traits = {path = "../net_traits"}
@ -25,5 +25,5 @@ script_traits = {path = "../script_traits"}
servo_config = {path = "../config", features = ["servo"]} servo_config = {path = "../config", features = ["servo"]}
servo_url = {path = "../url", features = ["servo"]} servo_url = {path = "../url", features = ["servo"]}
url = {version = "1.2", features = ["heap_size"]} url = {version = "1.2", features = ["heap_size"]}
uuid = { version = "0.3.1", features = ["v4"] } uuid = {version = "0.4", features = ["v4"]}
webdriver = "0.20" webdriver = "0.20"

View file

@ -10,7 +10,7 @@ name = "webvr"
path = "lib.rs" path = "lib.rs"
[dependencies] [dependencies]
ipc-channel = "0.6.3" ipc-channel = "0.7"
log = "0.3" log = "0.3"
msg = {path = "../msg"} msg = {path = "../msg"}
script_traits = {path = "../script_traits"} script_traits = {path = "../script_traits"}

View file

@ -10,8 +10,8 @@ name = "webvr_traits"
path = "lib.rs" path = "lib.rs"
[dependencies] [dependencies]
ipc-channel = "0.6.3" ipc-channel = "0.7"
msg = {path = "../msg"} msg = {path = "../msg"}
rust-webvr = {version = "0.1", features = ["serde-serialization"]} rust-webvr = {version = "0.2", features = ["serde-serialization"]}
serde = "0.8" serde = "0.9"
serde_derive = "0.8" serde_derive = "0.9"

View file

@ -20,7 +20,7 @@ debugmozjs = ["libservo/debugmozjs"]
[dependencies] [dependencies]
compositing = {path = "../../components/compositing"} compositing = {path = "../../components/compositing"}
devtools = {path = "../../components/devtools"} devtools = {path = "../../components/devtools"}
euclid = "0.10.1" euclid = "0.11"
gleam = "0.2.8" gleam = "0.2.8"
glutin_app = {path = "../glutin"} glutin_app = {path = "../glutin"}
libc = "0.2" libc = "0.2"
@ -42,7 +42,7 @@ features = ["serde_derive", "ipc"]
[target.'cfg(target_os="macos")'.dependencies] [target.'cfg(target_os="macos")'.dependencies]
objc = "0.2" objc = "0.2"
cocoa = "0.7" cocoa = "0.8"
[target.'cfg(target_os="linux")'.dependencies] [target.'cfg(target_os="linux")'.dependencies]
x11 = "2.3" x11 = "2.3"

View file

@ -13,11 +13,11 @@ crate-type = ["staticlib", "rlib"]
bindgen = ["style/use_bindgen"] bindgen = ["style/use_bindgen"]
[dependencies] [dependencies]
app_units = "0.3" app_units = "0.4"
atomic_refcell = "0.1" atomic_refcell = "0.1"
cssparser = {version = "0.9"} cssparser = "0.10"
env_logger = {version = "0.4", default-features = false} # disable `regex` to reduce code size env_logger = {version = "0.4", default-features = false} # disable `regex` to reduce code size
euclid = "0.10.1" euclid = "0.11"
lazy_static = "0.2" lazy_static = "0.2"
libc = "0.2" libc = "0.2"
log = {version = "0.3.5", features = ["release_max_level_info"]} log = {version = "0.3.5", features = ["release_max_level_info"]}

View file

@ -11,13 +11,13 @@ path = "lib.rs"
[dependencies] [dependencies]
bitflags = "0.7" bitflags = "0.7"
compositing = {path = "../../components/compositing"} compositing = {path = "../../components/compositing"}
euclid = "0.10.1" euclid = "0.11"
gleam = "0.2.8" gleam = "0.2.8"
log = "0.3.5" log = "0.3.5"
msg = {path = "../../components/msg"} msg = {path = "../../components/msg"}
net_traits = {path = "../../components/net_traits"} net_traits = {path = "../../components/net_traits"}
script_traits = {path = "../../components/script_traits"} script_traits = {path = "../../components/script_traits"}
servo-glutin = "0.8" servo-glutin = "0.9"
servo_geometry = {path = "../../components/geometry"} servo_geometry = {path = "../../components/geometry"}
servo_config = {path = "../../components/config"} servo_config = {path = "../../components/config"}
servo_url = {path = "../../components/url"} servo_url = {path = "../../components/url"}

View file

@ -31,7 +31,7 @@ num = []
[ignore] [ignore]
# Ignored packages with duplicated versions # Ignored packages with duplicated versions
packages = ["byteorder", "semver"] packages = ["byteorder", "semver", "serde_codegen_internals", "syn"]
# Files that are ignored for all tidy and lint checks. # Files that are ignored for all tidy and lint checks.
files = [ files = [
# Generated and upstream code combined with our own. Could use cleanup # Generated and upstream code combined with our own. Could use cleanup

View file

@ -11,5 +11,5 @@ doctest = false
[dependencies] [dependencies]
gfx = {path = "../../../components/gfx"} gfx = {path = "../../../components/gfx"}
ipc-channel = "0.6.3" ipc-channel = "0.7"
style = {path = "../../../components/style"} style = {path = "../../../components/style"}

View file

@ -10,13 +10,13 @@ path = "lib.rs"
doctest = false doctest = false
[dependencies] [dependencies]
content-blocker = "0.2.1" content-blocker = "0.2.3"
cookie = "0.2" cookie = "0.2"
devtools_traits = {path = "../../../components/devtools_traits"} devtools_traits = {path = "../../../components/devtools_traits"}
flate2 = "0.2.0" flate2 = "0.2.0"
hyper = "0.9.9" hyper = "0.9.9"
hyper_serde = "0.1.4" hyper_serde = "0.5"
ipc-channel = "0.6.3" ipc-channel = "0.7"
msg = {path = "../../../components/msg"} msg = {path = "../../../components/msg"}
net = {path = "../../../components/net"} net = {path = "../../../components/net"}
net_traits = {path = "../../../components/net_traits"} net_traits = {path = "../../../components/net_traits"}

View file

@ -10,6 +10,6 @@ path = "lib.rs"
doctest = false doctest = false
[dependencies] [dependencies]
ipc-channel = "0.6.3" ipc-channel = "0.7"
profile = {path = "../../../components/profile"} profile = {path = "../../../components/profile"}
profile_traits = {path = "../../../components/profile_traits"} profile_traits = {path = "../../../components/profile_traits"}

View file

@ -10,7 +10,7 @@ path = "lib.rs"
doctest = false doctest = false
[dependencies] [dependencies]
euclid = "0.10.2" euclid = "0.11"
msg = {path = "../../../components/msg"} msg = {path = "../../../components/msg"}
plugins = {path = "../../../components/plugins"} plugins = {path = "../../../components/plugins"}
script = {path = "../../../components/script"} script = {path = "../../../components/script"}

View file

@ -13,10 +13,10 @@ doctest = false
testing = ["style/testing"] testing = ["style/testing"]
[dependencies] [dependencies]
app_units = "0.3" app_units = "0.4"
cssparser = {version = "0.9", features = ["heap_size"]} cssparser = {version = "0.10", features = ["heapsize"]}
euclid = "0.10.1" euclid = "0.11"
html5ever-atoms = "0.1" html5ever-atoms = "0.2"
matches = "0.1" matches = "0.1"
owning_ref = "0.2.2" owning_ref = "0.2.2"
parking_lot = "0.3" parking_lot = "0.3"

View file

@ -12,11 +12,11 @@ path = "lib.rs"
doctest = false doctest = false
[dependencies] [dependencies]
app_units = "0.3" app_units = "0.4"
atomic_refcell = "0.1" atomic_refcell = "0.1"
cssparser = "0.9" cssparser = "0.10"
env_logger = "0.4" env_logger = "0.4"
euclid = "0.10.1" euclid = "0.11"
lazy_static = "0.2" lazy_static = "0.2"
libc = "0.2" libc = "0.2"
log = {version = "0.3.5", features = ["release_max_level_info"]} log = {version = "0.3.5", features = ["release_max_level_info"]}