mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Switch to using the new rooted!/RootedGuard API for rooting.
This commit is contained in:
parent
a77cc9950f
commit
0db1faf876
28 changed files with 238 additions and 237 deletions
|
@ -28,8 +28,7 @@ use euclid::point::Point2D;
|
|||
use euclid::rect::Rect;
|
||||
use euclid::size::Size2D;
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use js::jsapi::JSContext;
|
||||
use js::jsapi::{HandleValue, RootedValue};
|
||||
use js::jsapi::{JSContext, HandleValue};
|
||||
use js::jsval::UndefinedValue;
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use msg::webdriver_msg::WebDriverCookieError;
|
||||
|
@ -77,7 +76,7 @@ pub fn handle_execute_script(context: &BrowsingContext,
|
|||
let window = context.active_window();
|
||||
let result = unsafe {
|
||||
let cx = window.get_cx();
|
||||
let mut rval = RootedValue::new(cx, UndefinedValue());
|
||||
rooted!(in(cx) let mut rval = UndefinedValue());
|
||||
window.evaluate_js_on_global_with_result(&eval, rval.handle_mut());
|
||||
jsval_to_webdriver(cx, rval.handle())
|
||||
};
|
||||
|
@ -92,7 +91,7 @@ pub fn handle_execute_async_script(context: &BrowsingContext,
|
|||
let window = context.active_window();
|
||||
let cx = window.get_cx();
|
||||
window.set_webdriver_script_chan(Some(reply));
|
||||
let mut rval = RootedValue::new(cx, UndefinedValue());
|
||||
rooted!(in(cx) let mut rval = UndefinedValue());
|
||||
window.evaluate_js_on_global_with_result(&eval, rval.handle_mut());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue