Bug 1343153 - Replace pointer to const with immutable reference for nsTimingFunction.

This commit is contained in:
Boris Chiou 2017-03-21 14:30:21 +08:00
parent 708f446364
commit 30f44da11c
2 changed files with 7 additions and 8 deletions

View file

@ -1394,7 +1394,7 @@ extern "C" {
pub fn Servo_StyleSet_FillKeyframesForName(set: RawServoStyleSetBorrowed, pub fn Servo_StyleSet_FillKeyframesForName(set: RawServoStyleSetBorrowed,
property: *const nsACString, property: *const nsACString,
timing_function: timing_function:
*const nsTimingFunction, nsTimingFunctionBorrowed,
computed_values: computed_values:
ServoComputedValuesBorrowed, ServoComputedValuesBorrowed,
keyframe_list: keyframe_list:

View file

@ -48,6 +48,7 @@ use style::gecko_bindings::bindings::RawServoAnimationValueStrong;
use style::gecko_bindings::bindings::RawServoImportRuleBorrowed; use style::gecko_bindings::bindings::RawServoImportRuleBorrowed;
use style::gecko_bindings::bindings::ServoComputedValuesBorrowedOrNull; use style::gecko_bindings::bindings::ServoComputedValuesBorrowedOrNull;
use style::gecko_bindings::bindings::nsTArrayBorrowed_uintptr_t; use style::gecko_bindings::bindings::nsTArrayBorrowed_uintptr_t;
use style::gecko_bindings::bindings::nsTimingFunctionBorrowed;
use style::gecko_bindings::bindings::nsTimingFunctionBorrowedMut; use style::gecko_bindings::bindings::nsTimingFunctionBorrowedMut;
use style::gecko_bindings::structs; use style::gecko_bindings::structs;
use style::gecko_bindings::structs::{SheetParsingMode, nsIAtom, nsCSSPropertyID}; use style::gecko_bindings::structs::{SheetParsingMode, nsIAtom, nsCSSPropertyID};
@ -57,7 +58,6 @@ use style::gecko_bindings::structs::Loader;
use style::gecko_bindings::structs::RawGeckoPresContextOwned; use style::gecko_bindings::structs::RawGeckoPresContextOwned;
use style::gecko_bindings::structs::ServoStyleSheet; use style::gecko_bindings::structs::ServoStyleSheet;
use style::gecko_bindings::structs::nsCSSValueSharedList; use style::gecko_bindings::structs::nsCSSValueSharedList;
use style::gecko_bindings::structs::nsTimingFunction;
use style::gecko_bindings::structs::nsresult; use style::gecko_bindings::structs::nsresult;
use style::gecko_bindings::sugar::ownership::{FFIArcHelpers, HasArcFFI, HasBoxFFI}; use style::gecko_bindings::sugar::ownership::{FFIArcHelpers, HasArcFFI, HasBoxFFI};
use style::gecko_bindings::sugar::ownership::{HasSimpleFFI, Strong}; use style::gecko_bindings::sugar::ownership::{HasSimpleFFI, Strong};
@ -1639,7 +1639,7 @@ pub extern "C" fn Servo_AssertTreeIsClean(root: RawGeckoElementBorrowed) {
#[no_mangle] #[no_mangle]
pub extern "C" fn Servo_StyleSet_FillKeyframesForName(raw_data: RawServoStyleSetBorrowed, pub extern "C" fn Servo_StyleSet_FillKeyframesForName(raw_data: RawServoStyleSetBorrowed,
name: *const nsACString, name: *const nsACString,
timing_function: *const nsTimingFunction, timing_function: nsTimingFunctionBorrowed,
style: ServoComputedValuesBorrowed, style: ServoComputedValuesBorrowed,
keyframes: RawGeckoKeyframeListBorrowedMut) -> bool { keyframes: RawGeckoKeyframeListBorrowedMut) -> bool {
use style::gecko_bindings::structs::Keyframe; use style::gecko_bindings::structs::Keyframe;
@ -1648,7 +1648,6 @@ pub extern "C" fn Servo_StyleSet_FillKeyframesForName(raw_data: RawServoStyleSet
let data = PerDocumentStyleData::from_ffi(raw_data).borrow(); let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
let name = unsafe { Atom::from(name.as_ref().unwrap().as_str_unchecked()) }; let name = unsafe { Atom::from(name.as_ref().unwrap().as_str_unchecked()) };
let style_timing_function = unsafe { timing_function.as_ref().unwrap() };
let style = ComputedValues::as_arc(&style); let style = ComputedValues::as_arc(&style);
if let Some(ref animation) = data.stylist.animations().get(&name) { if let Some(ref animation) = data.stylist.animations().get(&name) {
@ -1659,7 +1658,7 @@ pub extern "C" fn Servo_StyleSet_FillKeyframesForName(raw_data: RawServoStyleSet
let timing_function = if let Some(val) = step.get_animation_timing_function(&guard) { let timing_function = if let Some(val) = step.get_animation_timing_function(&guard) {
val.into() val.into()
} else { } else {
*style_timing_function *timing_function
}; };
let keyframe = unsafe { let keyframe = unsafe {