mirror of
https://github.com/servo/servo.git
synced 2025-08-11 00:15:32 +01:00
Add FFI for nsCSSFontFaceRule.
This commit is contained in:
parent
83badaa718
commit
e36b92507e
2 changed files with 16 additions and 4 deletions
|
@ -235,10 +235,7 @@ impl<T: RefCounted> PartialEq for RefPtr<T> {
|
|||
unsafe impl<T: ThreadSafeRefCounted> Send for RefPtr<T> {}
|
||||
unsafe impl<T: ThreadSafeRefCounted> Sync for RefPtr<T> {}
|
||||
|
||||
// Companion of NS_DECL_THREADSAFE_FFI_REFCOUNTING.
|
||||
//
|
||||
// Gets you a free RefCounted impl implemented via FFI.
|
||||
macro_rules! impl_threadsafe_refcount {
|
||||
macro_rules! impl_refcount {
|
||||
($t:ty, $addref:ident, $release:ident) => (
|
||||
unsafe impl RefCounted for $t {
|
||||
fn addref(&self) {
|
||||
|
@ -248,6 +245,18 @@ macro_rules! impl_threadsafe_refcount {
|
|||
::gecko_bindings::bindings::$release(self as *const _ as *mut _)
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
impl_refcount!(::gecko_bindings::structs::nsCSSFontFaceRule,
|
||||
Gecko_CSSFontFaceRule_AddRef, Gecko_CSSFontFaceRule_Release);
|
||||
|
||||
// Companion of NS_DECL_THREADSAFE_FFI_REFCOUNTING.
|
||||
//
|
||||
// Gets you a free RefCounted impl implemented via FFI.
|
||||
macro_rules! impl_threadsafe_refcount {
|
||||
($t:ty, $addref:ident, $release:ident) => (
|
||||
impl_refcount!($t, $addref, $release);
|
||||
unsafe impl ThreadSafeRefCounted for $t {}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue