Switch to using the new rooted!/RootedGuard API for rooting.

This commit is contained in:
Eduard Burtescu 2016-07-04 20:59:01 +03:00
parent a77cc9950f
commit 0db1faf876
28 changed files with 238 additions and 237 deletions

View file

@ -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());
}