mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
stylo: Remove usage of ServoComputedValues from binding functions
This commit is contained in:
parent
9776d070ea
commit
3c3e4399da
7 changed files with 71 additions and 46 deletions
|
@ -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)) };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue