aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBobby Holley <bobbyholley@gmail.com>2017-06-02 17:40:00 -0700
committerBobby Holley <bobbyholley@gmail.com>2017-06-05 19:44:04 -0700
commitfa9d2cb03618c6ea310eebab27856112cdef2dad (patch)
tree16d58a2e134d2c79c58bfb17340d4445c7500d75
parent992059c8560fddd92bb49d709f606ef72f0d71f0 (diff)
downloadservo-fa9d2cb03618c6ea310eebab27856112cdef2dad.tar.gz
servo-fa9d2cb03618c6ea310eebab27856112cdef2dad.zip
Move stylearc into a separate crate.
MozReview-Commit-ID: C3btN8Jw9sJ
-rw-r--r--Cargo.lock9
-rw-r--r--components/servo_arc/Cargo.toml17
-rw-r--r--components/servo_arc/lib.rs (renamed from components/style/stylearc.rs)4
-rw-r--r--components/style/Cargo.toml1
-rw-r--r--components/style/lib.rs7
5 files changed, 35 insertions, 3 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 4e5e1c777a2..d340b4860e2 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2689,6 +2689,14 @@ dependencies = [
]
[[package]]
+name = "servo_arc"
+version = "0.0.1"
+dependencies = [
+ "heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
name = "servo_atoms"
version = "0.0.1"
dependencies = [
@@ -2913,6 +2921,7 @@ dependencies = [
"selectors 0.19.0",
"serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "servo_arc 0.0.1",
"servo_atoms 0.0.1",
"servo_config 0.0.1",
"servo_url 0.0.1",
diff --git a/components/servo_arc/Cargo.toml b/components/servo_arc/Cargo.toml
new file mode 100644
index 00000000000..578b845da53
--- /dev/null
+++ b/components/servo_arc/Cargo.toml
@@ -0,0 +1,17 @@
+[package]
+name = "servo_arc"
+version = "0.0.1"
+authors = ["The Servo Project Developers"]
+license = "MPL-2.0"
+publish = false
+
+[lib]
+name = "servo_arc"
+path = "lib.rs"
+
+[features]
+servo = ["serde", "heapsize"]
+
+[dependencies]
+heapsize = {version = "0.4.0", optional = true}
+serde = {version = "0.9", optional = true}
diff --git a/components/style/stylearc.rs b/components/servo_arc/lib.rs
index 9b355e7d211..8f7573cbf73 100644
--- a/components/style/stylearc.rs
+++ b/components/servo_arc/lib.rs
@@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-//! Fork of Arc for the style system. This has the following advantages over std::Arc:
+//! Fork of Arc for Servo. This has the following advantages over std::Arc:
//! * We don't waste storage on the weak reference count.
//! * We don't do extra RMU operations to handle the possibility of weak references.
//! * We can experiment with arena allocation (todo).
@@ -20,6 +20,8 @@
// duplicate those here.
#![allow(missing_docs)]
+#[cfg(feature = "servo")] extern crate serde;
+
#[cfg(feature = "servo")]
use heapsize::HeapSizeOf;
#[cfg(feature = "servo")]
diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml
index 4b33f660a68..a8751e1646b 100644
--- a/components/style/Cargo.toml
+++ b/components/style/Cargo.toml
@@ -61,6 +61,7 @@ rayon = "0.7.1"
selectors = { path = "../selectors" }
serde = {version = "0.9", optional = true}
serde_derive = {version = "0.9", optional = true}
+servo_arc = { path = "../servo_arc" }
servo_atoms = {path = "../atoms", optional = true}
servo_config = {path = "../config", optional = true}
smallvec = "0.4"
diff --git a/components/style/lib.rs b/components/style/lib.rs
index 4856610b9ed..0cde26b37f0 100644
--- a/components/style/lib.rs
+++ b/components/style/lib.rs
@@ -72,8 +72,8 @@ extern crate pdqsort;
#[cfg(feature = "gecko")] extern crate precomputed_hash;
extern crate rayon;
extern crate selectors;
-#[cfg(feature = "servo")] extern crate serde;
#[cfg(feature = "servo")] #[macro_use] extern crate serde_derive;
+pub extern crate servo_arc;
#[cfg(feature = "servo")] #[macro_use] extern crate servo_atoms;
#[cfg(feature = "servo")] extern crate servo_config;
#[cfg(feature = "servo")] extern crate servo_url;
@@ -129,7 +129,6 @@ pub mod sequential;
pub mod sink;
pub mod str;
pub mod style_adjuster;
-pub mod stylearc;
pub mod stylesheet_set;
pub mod stylesheets;
pub mod thread_state;
@@ -139,6 +138,10 @@ pub mod traversal;
#[allow(non_camel_case_types)]
pub mod values;
+// Compat shim for the old name when it lived in the style crate.
+// FIXME(bholley) Remove this.
+pub use servo_arc as stylearc;
+
use std::fmt;
use style_traits::ToCss;