Bug 1304792: Use borrowed types for ServoImportRule. r=Manishearth r=heycam

MozReview-Commit-ID: HKjsOaE2qAp
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
Emilio Cobos Álvarez 2016-12-29 18:33:47 +01:00
parent a5f5e48c68
commit df9da705f5
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 9 additions and 3 deletions

View file

@ -330,7 +330,7 @@ extern "C" {
extern "C" {
pub fn Gecko_LoadStyleSheet(loader: *mut Loader,
parent: *mut ServoStyleSheet,
import_rule: RawServoImportRuleStrong,
import_rule: RawServoImportRuleBorrowed,
url_bytes: *const u8, url_length: u32,
media_bytes: *const u8, media_length: u32);
}

View file

@ -109,6 +109,12 @@ pub unsafe trait HasArcFFI : HasFFI {
}
}
fn arc_as_borrowed<'a>(arc: &'a Arc<Self>) -> &'a &Self::FFIType {
unsafe {
transmute::<&Arc<Self>, &&Self::FFIType>(arc)
}
}
#[inline]
fn arc_from_borrowed<'a>(ptr: &'a Option<&Self::FFIType>) -> Option<&'a Arc<Self>> {
unsafe {