stylo: Add ServoBundledURI abstraction for use when setting css::URLValues

MozReview-Commit-ID: 4QKKzJ1DVYP
This commit is contained in:
Manish Goregaokar 2017-02-09 17:43:52 -08:00 committed by Manish Goregaokar
parent 47ebeaa95c
commit e965b4e345
6 changed files with 63 additions and 29 deletions

View file

@ -20,6 +20,7 @@ use gecko_bindings::structs::TraversalRootBehavior;
use gecko_bindings::structs::FontFamilyList;
use gecko_bindings::structs::FontFamilyType;
use gecko_bindings::structs::Keyframe;
use gecko_bindings::structs::ServoBundledURI;
use gecko_bindings::structs::ServoElementSnapshot;
use gecko_bindings::structs::SheetParsingMode;
use gecko_bindings::structs::StyleBasicShape;
@ -590,11 +591,7 @@ extern "C" {
}
extern "C" {
pub fn Gecko_SetListStyleImage(style_struct: *mut nsStyleList,
string_bytes: *const u8,
string_length: u32,
base_uri: *mut ThreadSafeURIHolder,
referrer: *mut ThreadSafeURIHolder,
principal: *mut ThreadSafePrincipalHolder);
uri: ServoBundledURI);
}
extern "C" {
pub fn Gecko_CopyListStyleImageFrom(dest: *mut nsStyleList,
@ -617,10 +614,7 @@ extern "C" {
}
extern "C" {
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);
bundled_uri: ServoBundledURI);
}
extern "C" {
pub fn Gecko_CopyMozBindingFrom(des: *mut nsStyleDisplay,

View file

@ -25363,6 +25363,23 @@ pub mod root {
pub type ThreadSafePrincipalHolder =
root::nsMainThreadPtrHolder<root::nsIPrincipal>;
pub type ThreadSafeURIHolder = root::nsMainThreadPtrHolder<root::nsIURI>;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ServoBundledURI {
pub mURLString: *const u8,
pub mURLStringLength: u32,
pub mBaseURI: *mut root::ThreadSafeURIHolder,
pub mReferrer: *mut root::ThreadSafeURIHolder,
pub mPrincipal: *mut root::ThreadSafePrincipalHolder,
}
#[test]
fn bindgen_test_layout_ServoBundledURI() {
assert_eq!(::std::mem::size_of::<ServoBundledURI>() , 40usize);
assert_eq!(::std::mem::align_of::<ServoBundledURI>() , 8usize);
}
impl Clone for ServoBundledURI {
fn clone(&self) -> Self { *self }
}
pub type nsMediaFeatureValueGetter =
::std::option::Option<unsafe extern "C" fn(aPresContext:
*mut root::nsPresContext,

View file

@ -24719,6 +24719,23 @@ pub mod root {
pub type ThreadSafePrincipalHolder =
root::nsMainThreadPtrHolder<root::nsIPrincipal>;
pub type ThreadSafeURIHolder = root::nsMainThreadPtrHolder<root::nsIURI>;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ServoBundledURI {
pub mURLString: *const u8,
pub mURLStringLength: u32,
pub mBaseURI: *mut root::ThreadSafeURIHolder,
pub mReferrer: *mut root::ThreadSafeURIHolder,
pub mPrincipal: *mut root::ThreadSafePrincipalHolder,
}
#[test]
fn bindgen_test_layout_ServoBundledURI() {
assert_eq!(::std::mem::size_of::<ServoBundledURI>() , 40usize);
assert_eq!(::std::mem::align_of::<ServoBundledURI>() , 8usize);
}
impl Clone for ServoBundledURI {
fn clone(&self) -> Self { *self }
}
pub type nsMediaFeatureValueGetter =
::std::option::Option<unsafe extern "C" fn(aPresContext:
*mut root::nsPresContext,