aboutsummaryrefslogtreecommitdiffstats
path: root/components/servo_arc/lib.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishearth@gmail.com>2017-07-18 23:17:34 -0700
committerManish Goregaokar <manishsmail@gmail.com>2017-07-21 08:33:11 -0700
commit3c3e4399da4fcddcb75255a1178ed71be7a5f46b (patch)
tree5a062a5c489624a332c93b0c2f1804982b11d754 /components/servo_arc/lib.rs
parent9776d070ea6def6162c7d7b5428078343c336daa (diff)
downloadservo-3c3e4399da4fcddcb75255a1178ed71be7a5f46b.tar.gz
servo-3c3e4399da4fcddcb75255a1178ed71be7a5f46b.zip
stylo: Remove usage of ServoComputedValues from binding functions
Diffstat (limited to 'components/servo_arc/lib.rs')
-rw-r--r--components/servo_arc/lib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/components/servo_arc/lib.rs b/components/servo_arc/lib.rs
index b1f4f277a49..d8a74758247 100644
--- a/components/servo_arc/lib.rs
+++ b/components/servo_arc/lib.rs
@@ -889,6 +889,12 @@ impl<'a, T> ArcBorrow<'a, T> {
arc
}
+ /// For constructing from a reference known to be Arc-backed,
+ /// e.g. if we obtain such a reference over FFI
+ pub unsafe fn from_ref(r: &'a T) -> Self {
+ ArcBorrow(r)
+ }
+
pub fn with_arc<F, U>(&self, f: F) -> U where F: FnOnce(&Arc<T>) -> U, T: 'static {
// Synthesize transient Arc, which never touches the refcount.
let transient = unsafe { NoDrop::new(Arc::from_raw(self.0)) };