Regenerate bindings with Holder types.

This commit is contained in:
Cameron McCormack 2016-05-19 14:31:20 +10:00
parent bb85f5faf0
commit 9b63deb8ec
4 changed files with 157 additions and 69 deletions

View file

@ -25,6 +25,8 @@ use structs::nsStyleSVGReset;
use structs::nsStyleColumn; use structs::nsStyleColumn;
use structs::nsStyleEffects; use structs::nsStyleEffects;
use structs::SheetParsingMode; use structs::SheetParsingMode;
use structs::nsMainThreadPtrHandle;
use structs::nsMainThreadPtrHolder;
use heapsize::HeapSizeOf; use heapsize::HeapSizeOf;
unsafe impl Send for nsStyleFont {} unsafe impl Send for nsStyleFont {}
unsafe impl Sync for nsStyleFont {} unsafe impl Sync for nsStyleFont {}
@ -102,6 +104,8 @@ impl HeapSizeOf for nsStyleEffects { fn heap_size_of_children(&self) -> usize {
pub enum nsIAtom { } pub enum nsIAtom { }
pub enum nsINode { } pub enum nsINode { }
pub type RawGeckoNode = nsINode; pub type RawGeckoNode = nsINode;
pub enum nsIPrincipal { }
pub enum nsIURI { }
pub enum Element { } pub enum Element { }
pub type RawGeckoElement = Element; pub type RawGeckoElement = Element;
pub enum nsIDocument { } pub enum nsIDocument { }
@ -110,6 +114,8 @@ pub enum ServoNodeData { }
pub enum ServoComputedValues { } pub enum ServoComputedValues { }
pub enum RawServoStyleSheet { } pub enum RawServoStyleSheet { }
pub enum RawServoStyleSet { } pub enum RawServoStyleSet { }
pub type ThreadSafePrincipalHolder = nsMainThreadPtrHolder<nsIPrincipal>;
pub type ThreadSafeURIHolder = nsMainThreadPtrHolder<nsIURI>;
extern "C" { extern "C" {
pub fn Gecko_ChildrenCount(node: *mut RawGeckoNode) -> u32; pub fn Gecko_ChildrenCount(node: *mut RawGeckoNode) -> u32;
pub fn Gecko_NodeIsElement(node: *mut RawGeckoNode) -> bool; pub fn Gecko_NodeIsElement(node: *mut RawGeckoNode) -> bool;
@ -138,6 +144,8 @@ extern "C" {
pub fn Gecko_IsVisitedLink(element: *mut RawGeckoElement) -> bool; pub fn Gecko_IsVisitedLink(element: *mut RawGeckoElement) -> bool;
pub fn Gecko_IsUnvisitedLink(element: *mut RawGeckoElement) -> bool; pub fn Gecko_IsUnvisitedLink(element: *mut RawGeckoElement) -> bool;
pub fn Gecko_IsRootElement(element: *mut RawGeckoElement) -> bool; pub fn Gecko_IsRootElement(element: *mut RawGeckoElement) -> bool;
pub fn Gecko_LocalName(element: *mut RawGeckoElement) -> *mut nsIAtom;
pub fn Gecko_Namespace(element: *mut RawGeckoElement) -> *mut nsIAtom;
pub fn Gecko_GetNodeData(node: *mut RawGeckoNode) -> *mut ServoNodeData; pub fn Gecko_GetNodeData(node: *mut RawGeckoNode) -> *mut ServoNodeData;
pub fn Gecko_SetNodeData(node: *mut RawGeckoNode, pub fn Gecko_SetNodeData(node: *mut RawGeckoNode,
data: *mut ServoNodeData); data: *mut ServoNodeData);
@ -159,8 +167,25 @@ extern "C" {
pub fn Gecko_SetListStyleType(style_struct: *mut nsStyleList, type_: u32); pub fn Gecko_SetListStyleType(style_struct: *mut nsStyleList, type_: u32);
pub fn Gecko_CopyListStyleTypeFrom(dst: *mut nsStyleList, pub fn Gecko_CopyListStyleTypeFrom(dst: *mut nsStyleList,
src: *const nsStyleList); src: *const nsStyleList);
pub fn Gecko_AddRefPrincipalArbitraryThread(aPtr:
*mut ThreadSafePrincipalHolder);
pub fn Gecko_ReleasePrincipalArbitraryThread(aPtr:
*mut ThreadSafePrincipalHolder);
pub fn Gecko_AddRefURIArbitraryThread(aPtr: *mut ThreadSafeURIHolder);
pub fn Gecko_ReleaseURIArbitraryThread(aPtr: *mut ThreadSafeURIHolder);
pub fn Gecko_SetMozBinding(style_struct: *mut nsStyleDisplay,
string_bytes: *const u8, string_length: u32,
base_uri: *mut ThreadSafeURIHolder,
referrer: *mut ThreadSafeURIHolder,
principal: *mut ThreadSafePrincipalHolder);
pub fn Gecko_CopyMozBindingFrom(des: *mut nsStyleDisplay,
src: *const nsStyleDisplay);
pub fn Servo_StylesheetFromUTF8Bytes(bytes: *const u8, length: u32, pub fn Servo_StylesheetFromUTF8Bytes(bytes: *const u8, length: u32,
parsing_mode: SheetParsingMode) parsing_mode: SheetParsingMode,
base: *mut ThreadSafeURIHolder,
referrer: *mut ThreadSafeURIHolder,
principal:
*mut ThreadSafePrincipalHolder)
-> *mut RawServoStyleSheet; -> *mut RawServoStyleSheet;
pub fn Servo_AddRefStyleSheet(sheet: *mut RawServoStyleSheet); pub fn Servo_AddRefStyleSheet(sheet: *mut RawServoStyleSheet);
pub fn Servo_ReleaseStyleSheet(sheet: *mut RawServoStyleSheet); pub fn Servo_ReleaseStyleSheet(sheet: *mut RawServoStyleSheet);
@ -202,8 +227,6 @@ extern "C" {
ns: *mut nsIAtom, name: *mut nsIAtom, ns: *mut nsIAtom, name: *mut nsIAtom,
length: *mut u32) length: *mut u32)
-> *const ::std::os::raw::c_char; -> *const ::std::os::raw::c_char;
pub fn Gecko_LocalName(element: *mut RawGeckoElement) -> *mut nsIAtom;
pub fn Gecko_Namespace(element: *mut RawGeckoElement) -> *mut nsIAtom;
pub fn Gecko_Construct_nsStyleFont(ptr: *mut nsStyleFont); pub fn Gecko_Construct_nsStyleFont(ptr: *mut nsStyleFont);
pub fn Gecko_CopyConstruct_nsStyleFont(ptr: *mut nsStyleFont, pub fn Gecko_CopyConstruct_nsStyleFont(ptr: *mut nsStyleFont,
other: *const nsStyleFont); other: *const nsStyleFont);

View file

@ -2747,7 +2747,6 @@ pub struct piecewise_construct_t;
impl ::std::clone::Clone for piecewise_construct_t { impl ::std::clone::Clone for piecewise_construct_t {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
pub enum tuple { }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct pair<_T1, _T2> { pub struct pair<_T1, _T2> {
@ -3778,6 +3777,56 @@ pub type nscolor = u32;
#[repr(i8)] #[repr(i8)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum nsHexColorType { NoAlpha = 0, AllowAlpha = 1, } pub enum nsHexColorType { NoAlpha = 0, AllowAlpha = 1, }
/**
* Class to safely handle main-thread-only pointers off the main thread.
*
* Classes like XPCWrappedJS are main-thread-only, which means that it is
* forbidden to call methods on instances of these classes off the main thread.
* For various reasons (see bug 771074), this restriction recently began to
* apply to AddRef/Release as well.
*
* This presents a problem for consumers that wish to hold a callback alive
* on non-main-thread code. A common example of this is the proxy callback
* pattern, where non-main-thread code holds a strong-reference to the callback
* object, and dispatches new Runnables (also with a strong reference) to the
* main thread in order to execute the callback. This involves several AddRef
* and Release calls on the other thread, which is (now) verboten.
*
* The basic idea of this class is to introduce a layer of indirection.
* nsMainThreadPtrHolder is a threadsafe reference-counted class that internally
* maintains one strong reference to the main-thread-only object. It must be
* instantiated on the main thread (so that the AddRef of the underlying object
* happens on the main thread), but consumers may subsequently pass references
* to the holder anywhere they please. These references are meant to be opaque
* when accessed off-main-thread (assertions enforce this).
*
* The semantics of RefPtr<nsMainThreadPtrHolder<T> > would be cumbersome, so
* we also introduce nsMainThreadPtrHandle<T>, which is conceptually identical
* to the above (though it includes various convenience methods). The basic
* pattern is as follows.
*
* // On the main thread:
* nsCOMPtr<nsIFooCallback> callback = ...;
* nsMainThreadPtrHandle<nsIFooCallback> callbackHandle =
* new nsMainThreadPtrHolder<nsIFooCallback>(callback);
* // Pass callbackHandle to structs/classes that might be accessed on other
* // threads.
*
* All structs and classes that might be accessed on other threads should store
* an nsMainThreadPtrHandle<T> rather than an nsCOMPtr<T>.
*/
#[repr(C)]
#[derive(Debug)]
pub struct nsMainThreadPtrHolder<T> {
pub mRefCnt: ThreadSafeAutoRefCnt,
pub mRawPtr: *mut T,
pub mStrict: bool,
}
#[repr(C)]
#[derive(Debug)]
pub struct nsMainThreadPtrHandle<T> {
pub mPtr: RefPtr<T>,
}
/** /**
* This structure precedes the string buffers "we" allocate. It may be the * This structure precedes the string buffers "we" allocate. It may be the
* case that nsTAString::mData does not point to one of these special * case that nsTAString::mData does not point to one of these special
@ -3800,12 +3849,21 @@ fn bindgen_test_layout_nsStringBuffer() {
} }
pub enum CSSStyleSheet { } pub enum CSSStyleSheet { }
#[repr(C)] #[repr(C)]
pub struct URLValueData {
pub _bindgen_opaque_blob: [u64; 5usize],
}
#[test]
fn bindgen_test_layout_URLValueData() {
assert_eq!(::std::mem::size_of::<URLValueData>() , 40usize);
assert_eq!(::std::mem::align_of::<URLValueData>() , 8usize);
}
#[repr(C)]
pub struct URLValue { pub struct URLValue {
pub _bindgen_opaque_blob: [u64; 7usize], pub _bindgen_opaque_blob: [u64; 6usize],
} }
#[test] #[test]
fn bindgen_test_layout_URLValue() { fn bindgen_test_layout_URLValue() {
assert_eq!(::std::mem::size_of::<URLValue>() , 56usize); assert_eq!(::std::mem::size_of::<URLValue>() , 48usize);
assert_eq!(::std::mem::align_of::<URLValue>() , 8usize); assert_eq!(::std::mem::align_of::<URLValue>() , 8usize);
} }
#[repr(C)] #[repr(C)]
@ -4553,22 +4611,22 @@ pub enum nsStyleUnit {
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsStyleCoord_h_unnamed_10 { pub struct nsStyleCoord_h_unnamed_14 {
pub mInt: __BindgenUnionField<i32>, pub mInt: __BindgenUnionField<i32>,
pub mFloat: __BindgenUnionField<f32>, pub mFloat: __BindgenUnionField<f32>,
pub mPointer: __BindgenUnionField<*mut ::std::os::raw::c_void>, pub mPointer: __BindgenUnionField<*mut ::std::os::raw::c_void>,
pub _bindgen_data_: u64, pub _bindgen_data_: u64,
} }
impl nsStyleCoord_h_unnamed_10 { } impl nsStyleCoord_h_unnamed_14 { }
impl ::std::clone::Clone for nsStyleCoord_h_unnamed_10 { impl ::std::clone::Clone for nsStyleCoord_h_unnamed_14 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleCoord_h_unnamed_10() { fn bindgen_test_layout_nsStyleCoord_h_unnamed_14() {
assert_eq!(::std::mem::size_of::<nsStyleCoord_h_unnamed_10>() , 8usize); assert_eq!(::std::mem::size_of::<nsStyleCoord_h_unnamed_14>() , 8usize);
assert_eq!(::std::mem::align_of::<nsStyleCoord_h_unnamed_10>() , 8usize); assert_eq!(::std::mem::align_of::<nsStyleCoord_h_unnamed_14>() , 8usize);
} }
pub type nsStyleUnion = nsStyleCoord_h_unnamed_10; pub type nsStyleUnion = nsStyleCoord_h_unnamed_14;
/** /**
* Class that hold a single size specification used by the style * Class that hold a single size specification used by the style
* system. The size specification consists of two parts -- a number * system. The size specification consists of two parts -- a number
@ -4763,27 +4821,27 @@ pub enum nsStyleImageType {
pub struct nsStyleImage { pub struct nsStyleImage {
pub mSubImages: u64, pub mSubImages: u64,
pub mType: nsStyleImageType, pub mType: nsStyleImageType,
pub nsStyleImage_nsStyleStruct_h_unnamed_13: nsStyleImage_nsStyleStruct_h_unnamed_13, pub nsStyleImage_nsStyleStruct_h_unnamed_17: nsStyleImage_nsStyleStruct_h_unnamed_17,
pub mCropRect: nsAutoPtr<nsStyleSides>, pub mCropRect: nsAutoPtr<nsStyleSides>,
pub mImageTracked: bool, pub mImageTracked: bool,
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsStyleImage_nsStyleStruct_h_unnamed_13 { pub struct nsStyleImage_nsStyleStruct_h_unnamed_17 {
pub mImage: __BindgenUnionField<*mut imgRequestProxy>, pub mImage: __BindgenUnionField<*mut imgRequestProxy>,
pub mGradient: __BindgenUnionField<*mut nsStyleGradient>, pub mGradient: __BindgenUnionField<*mut nsStyleGradient>,
pub mElementId: __BindgenUnionField<*mut ::std::os::raw::c_ushort>, pub mElementId: __BindgenUnionField<*mut ::std::os::raw::c_ushort>,
pub _bindgen_data_: u64, pub _bindgen_data_: u64,
} }
impl nsStyleImage_nsStyleStruct_h_unnamed_13 { } impl nsStyleImage_nsStyleStruct_h_unnamed_17 { }
impl ::std::clone::Clone for nsStyleImage_nsStyleStruct_h_unnamed_13 { impl ::std::clone::Clone for nsStyleImage_nsStyleStruct_h_unnamed_17 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleImage_nsStyleStruct_h_unnamed_13() { fn bindgen_test_layout_nsStyleImage_nsStyleStruct_h_unnamed_17() {
assert_eq!(::std::mem::size_of::<nsStyleImage_nsStyleStruct_h_unnamed_13>() assert_eq!(::std::mem::size_of::<nsStyleImage_nsStyleStruct_h_unnamed_17>()
, 8usize); , 8usize);
assert_eq!(::std::mem::align_of::<nsStyleImage_nsStyleStruct_h_unnamed_13>() assert_eq!(::std::mem::align_of::<nsStyleImage_nsStyleStruct_h_unnamed_17>()
, 8usize); , 8usize);
} }
#[test] #[test]
@ -4833,7 +4891,7 @@ pub struct nsStyleImageLayers {
} }
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum nsStyleImageLayers_nsStyleStruct_h_unnamed_14 { pub enum nsStyleImageLayers_nsStyleStruct_h_unnamed_18 {
shorthand = 0, shorthand = 0,
color = 1, color = 1,
image = 2, image = 2,
@ -5298,7 +5356,7 @@ fn bindgen_test_layout_nsStyleVisibility() {
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsTimingFunction { pub struct nsTimingFunction {
pub mType: nsTimingFunction_Type, pub mType: nsTimingFunction_Type,
pub nsTimingFunction_nsStyleStruct_h_unnamed_15: nsTimingFunction_nsStyleStruct_h_unnamed_15, pub nsTimingFunction_nsStyleStruct_h_unnamed_19: nsTimingFunction_nsStyleStruct_h_unnamed_19,
} }
#[repr(i32)] #[repr(i32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
@ -5325,56 +5383,56 @@ pub enum nsTimingFunction_StepSyntax {
pub enum nsTimingFunction_Keyword { Implicit = 0, Explicit = 1, } pub enum nsTimingFunction_Keyword { Implicit = 0, Explicit = 1, }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsTimingFunction_nsStyleStruct_h_unnamed_15 { pub struct nsTimingFunction_nsStyleStruct_h_unnamed_19 {
pub mFunc: __BindgenUnionField<nsTimingFunction_nsStyleStruct_h_unnamed_15_nsStyleStruct_h_unnamed_16>, pub mFunc: __BindgenUnionField<nsTimingFunction_nsStyleStruct_h_unnamed_19_nsStyleStruct_h_unnamed_20>,
pub nsTimingFunction_nsStyleStruct_h_unnamed_15_nsStyleStruct_h_unnamed_17: __BindgenUnionField<nsTimingFunction_nsStyleStruct_h_unnamed_15_nsStyleStruct_h_unnamed_17>, pub nsTimingFunction_nsStyleStruct_h_unnamed_19_nsStyleStruct_h_unnamed_21: __BindgenUnionField<nsTimingFunction_nsStyleStruct_h_unnamed_19_nsStyleStruct_h_unnamed_21>,
pub _bindgen_data_: [u32; 4usize], pub _bindgen_data_: [u32; 4usize],
} }
impl nsTimingFunction_nsStyleStruct_h_unnamed_15 { } impl nsTimingFunction_nsStyleStruct_h_unnamed_19 { }
impl ::std::clone::Clone for nsTimingFunction_nsStyleStruct_h_unnamed_15 { impl ::std::clone::Clone for nsTimingFunction_nsStyleStruct_h_unnamed_19 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_15() { fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_19() {
assert_eq!(::std::mem::size_of::<nsTimingFunction_nsStyleStruct_h_unnamed_15>() assert_eq!(::std::mem::size_of::<nsTimingFunction_nsStyleStruct_h_unnamed_19>()
, 16usize); , 16usize);
assert_eq!(::std::mem::align_of::<nsTimingFunction_nsStyleStruct_h_unnamed_15>() assert_eq!(::std::mem::align_of::<nsTimingFunction_nsStyleStruct_h_unnamed_19>()
, 4usize); , 4usize);
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsTimingFunction_nsStyleStruct_h_unnamed_15_nsStyleStruct_h_unnamed_16 { pub struct nsTimingFunction_nsStyleStruct_h_unnamed_19_nsStyleStruct_h_unnamed_20 {
pub mX1: f32, pub mX1: f32,
pub mY1: f32, pub mY1: f32,
pub mX2: f32, pub mX2: f32,
pub mY2: f32, pub mY2: f32,
} }
impl ::std::clone::Clone for impl ::std::clone::Clone for
nsTimingFunction_nsStyleStruct_h_unnamed_15_nsStyleStruct_h_unnamed_16 { nsTimingFunction_nsStyleStruct_h_unnamed_19_nsStyleStruct_h_unnamed_20 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_15_nsStyleStruct_h_unnamed_16() { fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_19_nsStyleStruct_h_unnamed_20() {
assert_eq!(::std::mem::size_of::<nsTimingFunction_nsStyleStruct_h_unnamed_15_nsStyleStruct_h_unnamed_16>() assert_eq!(::std::mem::size_of::<nsTimingFunction_nsStyleStruct_h_unnamed_19_nsStyleStruct_h_unnamed_20>()
, 16usize); , 16usize);
assert_eq!(::std::mem::align_of::<nsTimingFunction_nsStyleStruct_h_unnamed_15_nsStyleStruct_h_unnamed_16>() assert_eq!(::std::mem::align_of::<nsTimingFunction_nsStyleStruct_h_unnamed_19_nsStyleStruct_h_unnamed_20>()
, 4usize); , 4usize);
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsTimingFunction_nsStyleStruct_h_unnamed_15_nsStyleStruct_h_unnamed_17 { pub struct nsTimingFunction_nsStyleStruct_h_unnamed_19_nsStyleStruct_h_unnamed_21 {
pub mStepSyntax: nsTimingFunction_StepSyntax, pub mStepSyntax: nsTimingFunction_StepSyntax,
pub mSteps: u32, pub mSteps: u32,
} }
impl ::std::clone::Clone for impl ::std::clone::Clone for
nsTimingFunction_nsStyleStruct_h_unnamed_15_nsStyleStruct_h_unnamed_17 { nsTimingFunction_nsStyleStruct_h_unnamed_19_nsStyleStruct_h_unnamed_21 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_15_nsStyleStruct_h_unnamed_17() { fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_19_nsStyleStruct_h_unnamed_21() {
assert_eq!(::std::mem::size_of::<nsTimingFunction_nsStyleStruct_h_unnamed_15_nsStyleStruct_h_unnamed_17>() assert_eq!(::std::mem::size_of::<nsTimingFunction_nsStyleStruct_h_unnamed_19_nsStyleStruct_h_unnamed_21>()
, 8usize); , 8usize);
assert_eq!(::std::mem::align_of::<nsTimingFunction_nsStyleStruct_h_unnamed_15_nsStyleStruct_h_unnamed_17>() assert_eq!(::std::mem::align_of::<nsTimingFunction_nsStyleStruct_h_unnamed_19_nsStyleStruct_h_unnamed_21>()
, 4usize); , 4usize);
} }
impl ::std::clone::Clone for nsTimingFunction { impl ::std::clone::Clone for nsTimingFunction {
@ -5519,26 +5577,26 @@ pub enum nsStyleContentType {
#[derive(Debug)] #[derive(Debug)]
pub struct nsStyleContentData { pub struct nsStyleContentData {
pub mType: nsStyleContentType, pub mType: nsStyleContentType,
pub mContent: nsStyleContentData_nsStyleStruct_h_unnamed_18, pub mContent: nsStyleContentData_nsStyleStruct_h_unnamed_22,
pub mImageTracked: bool, pub mImageTracked: bool,
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsStyleContentData_nsStyleStruct_h_unnamed_18 { pub struct nsStyleContentData_nsStyleStruct_h_unnamed_22 {
pub mString: __BindgenUnionField<*mut ::std::os::raw::c_ushort>, pub mString: __BindgenUnionField<*mut ::std::os::raw::c_ushort>,
pub mImage: __BindgenUnionField<*mut imgRequestProxy>, pub mImage: __BindgenUnionField<*mut imgRequestProxy>,
pub mCounters: __BindgenUnionField<*mut Array>, pub mCounters: __BindgenUnionField<*mut Array>,
pub _bindgen_data_: u64, pub _bindgen_data_: u64,
} }
impl nsStyleContentData_nsStyleStruct_h_unnamed_18 { } impl nsStyleContentData_nsStyleStruct_h_unnamed_22 { }
impl ::std::clone::Clone for nsStyleContentData_nsStyleStruct_h_unnamed_18 { impl ::std::clone::Clone for nsStyleContentData_nsStyleStruct_h_unnamed_22 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleContentData_nsStyleStruct_h_unnamed_18() { fn bindgen_test_layout_nsStyleContentData_nsStyleStruct_h_unnamed_22() {
assert_eq!(::std::mem::size_of::<nsStyleContentData_nsStyleStruct_h_unnamed_18>() assert_eq!(::std::mem::size_of::<nsStyleContentData_nsStyleStruct_h_unnamed_22>()
, 8usize); , 8usize);
assert_eq!(::std::mem::align_of::<nsStyleContentData_nsStyleStruct_h_unnamed_18>() assert_eq!(::std::mem::align_of::<nsStyleContentData_nsStyleStruct_h_unnamed_22>()
, 8usize); , 8usize);
} }
#[test] #[test]
@ -5672,26 +5730,26 @@ pub enum nsStyleSVGOpacitySource {
#[repr(C)] #[repr(C)]
#[derive(Debug)] #[derive(Debug)]
pub struct nsStyleSVGPaint { pub struct nsStyleSVGPaint {
pub mPaint: nsStyleSVGPaint_nsStyleStruct_h_unnamed_19, pub mPaint: nsStyleSVGPaint_nsStyleStruct_h_unnamed_23,
pub mType: nsStyleSVGPaintType, pub mType: nsStyleSVGPaintType,
pub mFallbackColor: nscolor, pub mFallbackColor: nscolor,
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsStyleSVGPaint_nsStyleStruct_h_unnamed_19 { pub struct nsStyleSVGPaint_nsStyleStruct_h_unnamed_23 {
pub mColor: __BindgenUnionField<nscolor>, pub mColor: __BindgenUnionField<nscolor>,
pub mPaintServer: __BindgenUnionField<*mut nsIURI>, pub mPaintServer: __BindgenUnionField<*mut nsIURI>,
pub _bindgen_data_: u64, pub _bindgen_data_: u64,
} }
impl nsStyleSVGPaint_nsStyleStruct_h_unnamed_19 { } impl nsStyleSVGPaint_nsStyleStruct_h_unnamed_23 { }
impl ::std::clone::Clone for nsStyleSVGPaint_nsStyleStruct_h_unnamed_19 { impl ::std::clone::Clone for nsStyleSVGPaint_nsStyleStruct_h_unnamed_23 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleSVGPaint_nsStyleStruct_h_unnamed_19() { fn bindgen_test_layout_nsStyleSVGPaint_nsStyleStruct_h_unnamed_23() {
assert_eq!(::std::mem::size_of::<nsStyleSVGPaint_nsStyleStruct_h_unnamed_19>() assert_eq!(::std::mem::size_of::<nsStyleSVGPaint_nsStyleStruct_h_unnamed_23>()
, 8usize); , 8usize);
assert_eq!(::std::mem::align_of::<nsStyleSVGPaint_nsStyleStruct_h_unnamed_19>() assert_eq!(::std::mem::align_of::<nsStyleSVGPaint_nsStyleStruct_h_unnamed_23>()
, 8usize); , 8usize);
} }
#[test] #[test]
@ -5758,25 +5816,25 @@ fn bindgen_test_layout_nsStyleBasicShape() {
#[derive(Debug)] #[derive(Debug)]
pub struct nsStyleClipPath { pub struct nsStyleClipPath {
pub mType: i32, pub mType: i32,
pub nsStyleClipPath_nsStyleStruct_h_unnamed_20: nsStyleClipPath_nsStyleStruct_h_unnamed_20, pub nsStyleClipPath_nsStyleStruct_h_unnamed_24: nsStyleClipPath_nsStyleStruct_h_unnamed_24,
pub mSizingBox: u8, pub mSizingBox: u8,
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsStyleClipPath_nsStyleStruct_h_unnamed_20 { pub struct nsStyleClipPath_nsStyleStruct_h_unnamed_24 {
pub mBasicShape: __BindgenUnionField<*mut nsStyleBasicShape>, pub mBasicShape: __BindgenUnionField<*mut nsStyleBasicShape>,
pub mURL: __BindgenUnionField<*mut nsIURI>, pub mURL: __BindgenUnionField<*mut nsIURI>,
pub _bindgen_data_: u64, pub _bindgen_data_: u64,
} }
impl nsStyleClipPath_nsStyleStruct_h_unnamed_20 { } impl nsStyleClipPath_nsStyleStruct_h_unnamed_24 { }
impl ::std::clone::Clone for nsStyleClipPath_nsStyleStruct_h_unnamed_20 { impl ::std::clone::Clone for nsStyleClipPath_nsStyleStruct_h_unnamed_24 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleClipPath_nsStyleStruct_h_unnamed_20() { fn bindgen_test_layout_nsStyleClipPath_nsStyleStruct_h_unnamed_24() {
assert_eq!(::std::mem::size_of::<nsStyleClipPath_nsStyleStruct_h_unnamed_20>() assert_eq!(::std::mem::size_of::<nsStyleClipPath_nsStyleStruct_h_unnamed_24>()
, 8usize); , 8usize);
assert_eq!(::std::mem::align_of::<nsStyleClipPath_nsStyleStruct_h_unnamed_20>() assert_eq!(::std::mem::align_of::<nsStyleClipPath_nsStyleStruct_h_unnamed_24>()
, 8usize); , 8usize);
} }
#[test] #[test]
@ -5789,24 +5847,24 @@ fn bindgen_test_layout_nsStyleClipPath() {
pub struct nsStyleFilter { pub struct nsStyleFilter {
pub mType: i32, pub mType: i32,
pub mFilterParameter: nsStyleCoord, pub mFilterParameter: nsStyleCoord,
pub nsStyleFilter_nsStyleStruct_h_unnamed_21: nsStyleFilter_nsStyleStruct_h_unnamed_21, pub nsStyleFilter_nsStyleStruct_h_unnamed_25: nsStyleFilter_nsStyleStruct_h_unnamed_25,
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsStyleFilter_nsStyleStruct_h_unnamed_21 { pub struct nsStyleFilter_nsStyleStruct_h_unnamed_25 {
pub mURL: __BindgenUnionField<*mut nsIURI>, pub mURL: __BindgenUnionField<*mut nsIURI>,
pub mDropShadow: __BindgenUnionField<*mut nsCSSShadowArray>, pub mDropShadow: __BindgenUnionField<*mut nsCSSShadowArray>,
pub _bindgen_data_: u64, pub _bindgen_data_: u64,
} }
impl nsStyleFilter_nsStyleStruct_h_unnamed_21 { } impl nsStyleFilter_nsStyleStruct_h_unnamed_25 { }
impl ::std::clone::Clone for nsStyleFilter_nsStyleStruct_h_unnamed_21 { impl ::std::clone::Clone for nsStyleFilter_nsStyleStruct_h_unnamed_25 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleFilter_nsStyleStruct_h_unnamed_21() { fn bindgen_test_layout_nsStyleFilter_nsStyleStruct_h_unnamed_25() {
assert_eq!(::std::mem::size_of::<nsStyleFilter_nsStyleStruct_h_unnamed_21>() assert_eq!(::std::mem::size_of::<nsStyleFilter_nsStyleStruct_h_unnamed_25>()
, 8usize); , 8usize);
assert_eq!(::std::mem::align_of::<nsStyleFilter_nsStyleStruct_h_unnamed_21>() assert_eq!(::std::mem::align_of::<nsStyleFilter_nsStyleStruct_h_unnamed_25>()
, 8usize); , 8usize);
} }
#[test] #[test]

View file

@ -50,7 +50,7 @@ do
done done
# Other mapped types. # Other mapped types.
for TYPE in SheetParsingMode for TYPE in SheetParsingMode nsMainThreadPtrHandle nsMainThreadPtrHolder
do do
MAP_GECKO_TYPES=$MAP_GECKO_TYPES"-blacklist-type $TYPE " MAP_GECKO_TYPES=$MAP_GECKO_TYPES"-blacklist-type $TYPE "
MAP_GECKO_TYPES=$MAP_GECKO_TYPES"-raw-line 'use structs::$TYPE;' " MAP_GECKO_TYPES=$MAP_GECKO_TYPES"-raw-line 'use structs::$TYPE;' "
@ -59,6 +59,8 @@ done
# Check for the include directory. # Check for the include directory.
export OBJDIR="$1"
export SRCDIR="$1/.." # Not necessarily true, but let's assume.
export DIST_INCLUDE="$1/dist/include" export DIST_INCLUDE="$1/dist/include"
if [ ! -d "$DIST_INCLUDE" ]; then if [ ! -d "$DIST_INCLUDE" ]; then
echo "$DIST_INCLUDE: directory not found" echo "$DIST_INCLUDE: directory not found"
@ -72,6 +74,8 @@ export RUST_BACKTRACE=1
eval ./rust-bindgen/target/debug/bindgen \ eval ./rust-bindgen/target/debug/bindgen \
-x c++ -std=gnu++0x \ -x c++ -std=gnu++0x \
"-I$DIST_INCLUDE" \ "-I$DIST_INCLUDE" \
"-I$DIST_INCLUDE/nspr/" \
"-I$SRCDIR/nsprpub/pr/include/" \
$PLATFORM_DEPENDENT_DEFINES \ $PLATFORM_DEPENDENT_DEFINES \
-o ../bindings.rs \ -o ../bindings.rs \
-no-type-renaming \ -no-type-renaming \

View file

@ -102,8 +102,10 @@ export RUST_BACKTRACE=1
-match "pair" \ -match "pair" \
-match "SheetParsingMode.h" \ -match "SheetParsingMode.h" \
-match "StaticPtr.h" \ -match "StaticPtr.h" \
-match "nsProxyRelease.h" \
-blacklist-type "IsDestructibleFallbackImpl" \ -blacklist-type "IsDestructibleFallbackImpl" \
-blacklist-type "IsDestructibleFallback" \ -blacklist-type "IsDestructibleFallback" \
-blacklist-type "nsProxyReleaseEvent" \
-opaque-type "nsIntMargin" \ -opaque-type "nsIntMargin" \
-opaque-type "nsIntPoint" \ -opaque-type "nsIntPoint" \
-opaque-type "nsIntRect" \ -opaque-type "nsIntRect" \
@ -116,6 +118,7 @@ export RUST_BACKTRACE=1
-opaque-type "CounterStyleManager" \ -opaque-type "CounterStyleManager" \
-opaque-type "ImageValue" \ -opaque-type "ImageValue" \
-opaque-type "URLValue" \ -opaque-type "URLValue" \
-opaque-type "URLValueData" \
-opaque-type "nsIPrincipal" \ -opaque-type "nsIPrincipal" \
-opaque-type "nsDataHashtable" \ -opaque-type "nsDataHashtable" \
-opaque-type "imgIRequest" \ -opaque-type "imgIRequest" \