mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 01:35:35 +00:00
servo: Merge #8627 - Move SetDOMProxyInformation() call from script_task.rs to script/lib.rs (from rilut:refactor-script); r=Ms2ger
Actually, I'm not sure whether to move `unsafe extern "C" fn shadow_check_callback` from script_task.rs to lib.rs or to keep it there. cc: @wenderen Source-Repo: https://github.com/servo/servo Source-Revision: 7ccdc42a660bed7ac3bd3ad110567b79cba012ff
This commit is contained in:
parent
0e8c63fadf
commit
f1c2ebd293
@ -99,6 +99,8 @@ mod unpremultiplytable;
|
|||||||
mod webdriver_handlers;
|
mod webdriver_handlers;
|
||||||
|
|
||||||
use dom::bindings::codegen::RegisterBindings;
|
use dom::bindings::codegen::RegisterBindings;
|
||||||
|
use js::jsapi::SetDOMProxyInformation;
|
||||||
|
use std::ptr;
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
@ -145,6 +147,7 @@ fn perform_platform_specific_initialization() {}
|
|||||||
pub fn init() {
|
pub fn init() {
|
||||||
unsafe {
|
unsafe {
|
||||||
assert_eq!(js::jsapi::JS_Init(), true);
|
assert_eq!(js::jsapi::JS_Init(), true);
|
||||||
|
SetDOMProxyInformation(ptr::null(), 0, Some(script_task::shadow_check_callback));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the global vtables used by the (generated) DOM
|
// Create the global vtables used by the (generated) DOM
|
||||||
|
@ -49,7 +49,7 @@ use hyper::mime::{Mime, SubLevel, TopLevel};
|
|||||||
use ipc_channel::ipc::{self, IpcSender};
|
use ipc_channel::ipc::{self, IpcSender};
|
||||||
use ipc_channel::router::ROUTER;
|
use ipc_channel::router::ROUTER;
|
||||||
use js::glue::CollectServoSizes;
|
use js::glue::CollectServoSizes;
|
||||||
use js::jsapi::{DOMProxyShadowsResult, HandleId, HandleObject, RootedValue, SetDOMProxyInformation};
|
use js::jsapi::{DOMProxyShadowsResult, HandleId, HandleObject, RootedValue};
|
||||||
use js::jsapi::{DisableIncrementalGC, JS_AddExtraGCRootsTracer, JS_SetWrapObjectCallbacks};
|
use js::jsapi::{DisableIncrementalGC, JS_AddExtraGCRootsTracer, JS_SetWrapObjectCallbacks};
|
||||||
use js::jsapi::{GCDescription, GCProgress, JSGCInvocationKind, SetGCSliceCallback};
|
use js::jsapi::{GCDescription, GCProgress, JSGCInvocationKind, SetGCSliceCallback};
|
||||||
use js::jsapi::{JSAutoRequest, JSGCStatus, JS_GetRuntime, JS_SetGCCallback, SetDOMCallbacks};
|
use js::jsapi::{JSAutoRequest, JSGCStatus, JS_GetRuntime, JS_SetGCCallback, SetDOMCallbacks};
|
||||||
@ -588,7 +588,7 @@ unsafe extern "C" fn debug_gc_callback(_rt: *mut JSRuntime, status: JSGCStatus,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe extern "C" fn shadow_check_callback(_cx: *mut JSContext,
|
pub unsafe extern "C" fn shadow_check_callback(_cx: *mut JSContext,
|
||||||
_object: HandleObject, _id: HandleId) -> DOMProxyShadowsResult {
|
_object: HandleObject, _id: HandleId) -> DOMProxyShadowsResult {
|
||||||
// XXX implement me
|
// XXX implement me
|
||||||
DOMProxyShadowsResult::ShadowCheckFailed
|
DOMProxyShadowsResult::ShadowCheckFailed
|
||||||
@ -704,7 +704,6 @@ impl ScriptTask {
|
|||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
unsafe extern "C" fn empty_wrapper_callback(_: *mut JSContext, _: *mut JSObject) -> bool { true }
|
unsafe extern "C" fn empty_wrapper_callback(_: *mut JSContext, _: *mut JSObject) -> bool { true }
|
||||||
SetDOMProxyInformation(ptr::null(), 0, Some(shadow_check_callback));
|
|
||||||
SetDOMCallbacks(runtime.rt(), &DOM_CALLBACKS);
|
SetDOMCallbacks(runtime.rt(), &DOM_CALLBACKS);
|
||||||
SetPreserveWrapperCallback(runtime.rt(), Some(empty_wrapper_callback));
|
SetPreserveWrapperCallback(runtime.rt(), Some(empty_wrapper_callback));
|
||||||
// Pre barriers aren't working correctly at the moment
|
// Pre barriers aren't working correctly at the moment
|
||||||
|
Loading…
Reference in New Issue
Block a user