mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Clean up the conversion routines
Functions returning `Root<T>` are prefixed by "root_" and the ones returning `*const T` by "native_". Functions taking `*mut JSObject` are now suffixed by "_from_object" and the ones taking `&T` by "_from_reflector".
This commit is contained in:
parent
aa105d89b4
commit
b290a3161d
10 changed files with 45 additions and 61 deletions
|
@ -5,7 +5,7 @@
|
|||
//! Base classes to work with IDL callbacks.
|
||||
|
||||
use dom::bindings::error::{Error, Fallible};
|
||||
use dom::bindings::global::global_object_for_js_object;
|
||||
use dom::bindings::global::global_root_from_object;
|
||||
use dom::bindings::reflector::Reflectable;
|
||||
use js::jsapi::GetGlobalForObjectCrossCompartment;
|
||||
use js::jsapi::{Heap, MutableHandleObject, RootedObject, RootedValue};
|
||||
|
@ -170,7 +170,7 @@ impl CallSetup {
|
|||
/// Performs the setup needed to make a call.
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new<T: CallbackContainer>(callback: &T, handling: ExceptionHandling) -> CallSetup {
|
||||
let global = global_object_for_js_object(callback.callback());
|
||||
let global = global_root_from_object(callback.callback());
|
||||
let cx = global.r().get_cx();
|
||||
unsafe { JS_BeginRequest(cx); }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue