Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove servo feature from servo_url
  • Loading branch information
upsuper committed Apr 7, 2017
1 parent e07cf0a commit 817172e
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 37 deletions.
2 changes: 1 addition & 1 deletion components/compositing/Cargo.toml
Expand Up @@ -22,7 +22,7 @@ profile_traits = {path = "../profile_traits"}
script_traits = {path = "../script_traits"}
servo_config = {path = "../config"}
servo_geometry = {path = "../geometry", features = ["servo"]}
servo_url = {path = "../url", features = ["servo"]}
servo_url = {path = "../url"}
style_traits = {path = "../style_traits"}
time = "0.1.17"
webrender = {git = "https://github.com/servo/webrender"}
Expand Down
2 changes: 1 addition & 1 deletion components/config/Cargo.toml
Expand Up @@ -19,7 +19,7 @@ rustc-serialize = "0.3"
serde = {version = "0.9"}
serde_derive = {version = "0.9"}
servo_geometry = {path = "../geometry"}
servo_url = {path = "../url", features = ["servo"]}
servo_url = {path = "../url"}
url = "1.2"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion components/constellation/Cargo.toml
Expand Up @@ -36,7 +36,7 @@ style_traits = {path = "../style_traits"}
servo_config = {path = "../config"}
servo_rand = {path = "../rand"}
servo_remutex = {path = "../remutex"}
servo_url = {path = "../url", features = ["servo"]}
servo_url = {path = "../url"}
webvr_traits = {path = "../webvr_traits"}
webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]}

Expand Down
2 changes: 1 addition & 1 deletion components/net_traits/Cargo.toml
Expand Up @@ -25,7 +25,7 @@ num-traits = "0.1.32"
serde = "0.9"
serde_derive = "0.9"
servo_config = {path = "../config"}
servo_url = {path = "../url", features = ["servo"]}
servo_url = {path = "../url"}
url = {version = "1.2", features = ["heap_size"]}
uuid = {version = "0.4", features = ["v4", "serde"]}
webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]}
2 changes: 1 addition & 1 deletion components/script/Cargo.toml
Expand Up @@ -80,7 +80,7 @@ servo_atoms = {path = "../atoms"}
servo_config = {path = "../config"}
servo_geometry = {path = "../geometry" }
servo_rand = {path = "../rand"}
servo_url = {path = "../url", features = ["servo"]}
servo_url = {path = "../url"}
smallvec = "0.3"
style = {path = "../style"}
style_traits = {path = "../style_traits"}
Expand Down
2 changes: 1 addition & 1 deletion components/script_traits/Cargo.toml
Expand Up @@ -30,7 +30,7 @@ profile_traits = {path = "../profile_traits"}
rustc-serialize = "0.3.4"
serde = "0.9"
serde_derive = "0.9"
servo_url = {path = "../url", features = ["servo"]}
servo_url = {path = "../url"}
style_traits = {path = "../style_traits", features = ["servo"]}
time = "0.1.12"
url = {version = "1.2", features = ["heap_size"]}
Expand Down
2 changes: 1 addition & 1 deletion components/style/Cargo.toml
Expand Up @@ -18,7 +18,7 @@ use_bindgen = ["bindgen", "regex"]
servo = ["serde/unstable", "serde", "serde_derive", "heapsize", "heapsize_derive",
"style_traits/servo", "servo_atoms", "servo_config", "html5ever-atoms",
"cssparser/heapsize", "cssparser/serde", "encoding",
"rayon/unstable", "servo_url", "servo_url/servo"]
"rayon/unstable", "servo_url"]
testing = []

[dependencies]
Expand Down
17 changes: 7 additions & 10 deletions components/url/Cargo.toml
Expand Up @@ -9,15 +9,12 @@ publish = false
name = "servo_url"
path = "lib.rs"

[features]
servo = ["heapsize", "heapsize_derive", "serde", "serde_derive", "uuid/serde", "url/heap_size", "url_serde"]

[dependencies]
heapsize = {version = "0.3.0", optional = true}
heapsize_derive = {version = "0.1", optional = true}
serde = {version = "0.9", optional = true}
serde_derive = {version = "0.9", optional = true}
heapsize = {version = "0.3.0"}
heapsize_derive = {version = "0.1"}
serde = {version = "0.9"}
serde_derive = {version = "0.9"}
servo_rand = {path = "../rand"}
url = "1.2"
url_serde = {version = "0.1.3", optional = true}
uuid = {version = "0.4.0", features = ["v4"]}
url = {version = "1.2", features = ["heap_size"]}
url_serde = {version = "0.1.3"}
uuid = {version = "0.4.0", features = ["v4", "serde"]}
16 changes: 6 additions & 10 deletions components/url/lib.rs
Expand Up @@ -7,14 +7,13 @@
#![crate_name = "servo_url"]
#![crate_type = "rlib"]

#[cfg(feature = "servo")] #[macro_use] extern crate heapsize;
#[cfg(feature = "servo")] #[macro_use] extern crate heapsize_derive;
#[cfg(feature = "servo")] extern crate serde;
#[cfg(feature = "servo")] #[macro_use] extern crate serde_derive;
#[cfg(feature = "servo")] extern crate url_serde;

#[macro_use] extern crate heapsize;
#[macro_use] extern crate heapsize_derive;
extern crate serde;
#[macro_use] extern crate serde_derive;
extern crate servo_rand;
extern crate url;
extern crate url_serde;
extern crate uuid;

pub mod origin;
Expand All @@ -30,8 +29,7 @@ use url::{Url, Position};

pub use url::Host;

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, HeapSizeOf)]
pub struct ServoUrl(Arc<Url>);

impl ServoUrl {
Expand Down Expand Up @@ -203,7 +201,6 @@ impl From<Url> for ServoUrl {
}
}

#[cfg(feature = "servo")]
impl serde::Serialize for ServoUrl {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: serde::Serializer,
Expand All @@ -212,7 +209,6 @@ impl serde::Serialize for ServoUrl {
}
}

#[cfg(feature = "servo")]
impl serde::Deserialize for ServoUrl {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: serde::Deserializer,
Expand Down
13 changes: 4 additions & 9 deletions components/url/origin.rs
Expand Up @@ -7,21 +7,19 @@ use servo_rand::Rng;
use std::cell::RefCell;
use std::rc::Rc;
use url::{Host, Origin};
#[cfg(feature = "servo")] use url_serde;
use url_serde;
use uuid::Uuid;

/// The origin of an URL
#[derive(PartialEq, Eq, Clone, Debug)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
#[derive(PartialEq, Eq, Clone, Debug, HeapSizeOf, Deserialize, Serialize)]
pub enum ImmutableOrigin {
/// A globally unique identifier
Opaque(OpaqueOrigin),

/// Consists of the URL's scheme, host and port
Tuple(
String,
#[cfg_attr(feature = "servo",
serde(deserialize_with = "url_serde::deserialize", serialize_with = "url_serde::serialize"))]
#[serde(deserialize_with = "url_serde::deserialize", serialize_with = "url_serde::serialize")]
Host,
u16,
)
Expand Down Expand Up @@ -97,18 +95,15 @@ impl ImmutableOrigin {
}

/// Opaque identifier for URLs that have file or other schemes
#[derive(Eq, PartialEq, Clone, Debug)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
#[derive(Eq, PartialEq, Clone, Debug, Deserialize, Serialize)]
pub struct OpaqueOrigin(Uuid);

#[cfg(feature = "servo")]
known_heap_size!(0, OpaqueOrigin);

/// A representation of an [origin](https://html.spec.whatwg.org/multipage/#origin-2).
#[derive(Clone, Debug)]
pub struct MutableOrigin(Rc<(ImmutableOrigin, RefCell<Option<Host>>)>);

#[cfg(feature = "servo")]
known_heap_size!(0, MutableOrigin);

impl MutableOrigin {
Expand Down
2 changes: 1 addition & 1 deletion components/webdriver_server/Cargo.toml
Expand Up @@ -23,7 +23,7 @@ regex = "0.2"
rustc-serialize = "0.3.4"
script_traits = {path = "../script_traits"}
servo_config = {path = "../config"}
servo_url = {path = "../url", features = ["servo"]}
servo_url = {path = "../url"}
url = {version = "1.2", features = ["heap_size"]}
uuid = {version = "0.4", features = ["v4"]}
webdriver = "0.22"

0 comments on commit 817172e

Please sign in to comment.