mirror of
https://github.com/servo/servo.git
synced 2025-06-24 09:04:33 +01:00
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:
parent
a5f5e48c68
commit
df9da705f5
3 changed files with 9 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue