mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Pass C string pointer to CompileOptionsWrapper.
This commit is contained in:
parent
6a9aac3e65
commit
a271ed9150
1 changed files with 3 additions and 2 deletions
|
@ -58,6 +58,7 @@ use servo_config::pref;
|
||||||
use servo_url::ImmutableOrigin;
|
use servo_url::ImmutableOrigin;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
use std::ffi::CString;
|
||||||
use std::fs::{create_dir_all, read_to_string, File};
|
use std::fs::{create_dir_all, read_to_string, File};
|
||||||
use std::io::{Read, Seek, Write};
|
use std::io::{Read, Seek, Write};
|
||||||
use std::mem::replace;
|
use std::mem::replace;
|
||||||
|
@ -424,8 +425,8 @@ impl FetchResponseListener for ClassicContext {
|
||||||
let cx = global.get_cx();
|
let cx = global.get_cx();
|
||||||
let _ar = enter_realm(&*global);
|
let _ar = enter_realm(&*global);
|
||||||
|
|
||||||
let options =
|
let final_url_c_str = CString::new(final_url.as_str()).unwrap();
|
||||||
unsafe { CompileOptionsWrapper::new(*cx, final_url.as_str().as_ptr() as *const i8, 1) };
|
let options = unsafe { CompileOptionsWrapper::new(*cx, final_url_c_str.as_ptr(), 1) };
|
||||||
|
|
||||||
let can_compile_off_thread = pref!(dom.script.asynch) &&
|
let can_compile_off_thread = pref!(dom.script.asynch) &&
|
||||||
unsafe { CanCompileOffThread(*cx, options.ptr as *const _, source_text.len()) };
|
unsafe { CanCompileOffThread(*cx, options.ptr as *const _, source_text.len()) };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue