mirror of
https://github.com/servo/servo.git
synced 2025-07-02 21:13:39 +01:00
style: Pass a bonafide nsACString to Servo.
This will allow the Rust code hold a copy-free strong reference to the string past callstack unwind. Bug: 1454460 Reviewed-by: bz MozReview-Commit-ID: HCop9h2abZU
This commit is contained in:
parent
bc1126ee8c
commit
c06e3dcd58
1 changed files with 2 additions and 3 deletions
|
@ -1130,8 +1130,7 @@ pub extern "C" fn Servo_StyleSheet_FromUTF8Bytes(
|
|||
loader: *mut Loader,
|
||||
stylesheet: *mut ServoStyleSheet,
|
||||
load_data: *mut SheetLoadData,
|
||||
data: *const u8,
|
||||
data_len: usize,
|
||||
bytes: *const nsACString,
|
||||
mode: SheetParsingMode,
|
||||
extra_data: *mut URLExtraData,
|
||||
line_number_offset: u32,
|
||||
|
@ -1139,7 +1138,7 @@ pub extern "C" fn Servo_StyleSheet_FromUTF8Bytes(
|
|||
reusable_sheets: *mut LoaderReusableStyleSheets,
|
||||
) -> RawServoStyleSheetContentsStrong {
|
||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||
let input = unsafe { ::std::str::from_utf8_unchecked(::std::slice::from_raw_parts(data, data_len)) };
|
||||
let input: &str = unsafe { (*bytes).as_str_unchecked() };
|
||||
|
||||
let origin = match mode {
|
||||
SheetParsingMode::eAuthorSheetFeatures => Origin::Author,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue