mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Make StructuredCloneData::read take a &GlobalScope
This commit is contained in:
parent
ac5a4adf5f
commit
b3393fba18
5 changed files with 7 additions and 7 deletions
|
@ -6,7 +6,7 @@
|
|||
//! (https://html.spec.whatwg.org/multipage/#safe-passing-of-structured-data).
|
||||
|
||||
use dom::bindings::error::{Error, Fallible};
|
||||
use dom::bindings::global::GlobalRef;
|
||||
use dom::globalscope::GlobalScope;
|
||||
use js::jsapi::{HandleValue, MutableHandleValue};
|
||||
use js::jsapi::{JSContext, JS_ReadStructuredClone, JS_STRUCTURED_CLONE_VERSION};
|
||||
use js::jsapi::{JS_ClearPendingException, JS_WriteStructuredClone};
|
||||
|
@ -60,7 +60,7 @@ impl StructuredCloneData {
|
|||
/// Reads a structured clone.
|
||||
///
|
||||
/// Panics if `JS_ReadStructuredClone` fails.
|
||||
fn read_clone(global: GlobalRef, data: *mut u64, nbytes: size_t, rval: MutableHandleValue) {
|
||||
fn read_clone(global: &GlobalScope, data: *mut u64, nbytes: size_t, rval: MutableHandleValue) {
|
||||
unsafe {
|
||||
assert!(JS_ReadStructuredClone(global.get_cx(),
|
||||
data,
|
||||
|
@ -73,7 +73,7 @@ impl StructuredCloneData {
|
|||
}
|
||||
|
||||
/// Thunk for the actual `read_clone` method. Resolves proper variant for read_clone.
|
||||
pub fn read(self, global: GlobalRef, rval: MutableHandleValue) {
|
||||
pub fn read(self, global: &GlobalScope, rval: MutableHandleValue) {
|
||||
match self {
|
||||
StructuredCloneData::Vector(mut vec_msg) => {
|
||||
let nbytes = vec_msg.len();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue