Add FFI for nsCSSFontFaceRule.

This commit is contained in:
Xidorn Quan 2017-03-30 10:44:10 +11:00
parent 83badaa718
commit e36b92507e
2 changed files with 16 additions and 4 deletions

View file

@ -271,6 +271,7 @@ mod bindings {
.include(add_include("mozilla/dom/NameSpaceConstants.h"))
.include(add_include("mozilla/LookAndFeel.h"))
.include(add_include("mozilla/ServoBindings.h"))
.include(add_include("nsCSSFontFaceRule.h"))
.include(add_include("nsMediaFeatures.h"))
.include(add_include("nsMediaList.h"))
// FIXME(emilio): Incrementally remove these "pub use"s. Probably
@ -337,6 +338,7 @@ mod bindings {
"nsBorderColors",
"nscolor",
"nsChangeHint",
"nsCSSFontFaceRule",
"nsCSSKeyword",
"nsCSSPropertyID",
"nsCSSProps",
@ -609,6 +611,7 @@ mod bindings {
"StyleBasicShape",
"StyleBasicShapeType",
"StyleShapeSource",
"nsCSSFontFaceRule",
"nsCSSKeyword",
"nsCSSPropertyID",
"nsCSSShadowArray",

View file

@ -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 {}
);
}