mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
script creates methods taking '*mut JSContext' unsafe
rebase + marked the necessary new code as unsafe
This commit is contained in:
parent
9fd6f0acd5
commit
b372e7c98f
28 changed files with 274 additions and 226 deletions
|
@ -268,8 +268,10 @@ impl WorkerGlobalScopeMethods for WorkerGlobalScope {
|
|||
base64_atob(atob)
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
// https://html.spec.whatwg.org/multipage/#dom-windowtimers-settimeout
|
||||
fn SetTimeout(&self, _cx: *mut JSContext, callback: Rc<Function>, timeout: i32, args: Vec<HandleValue>) -> i32 {
|
||||
unsafe fn SetTimeout(&self, _cx: *mut JSContext, callback: Rc<Function>,
|
||||
timeout: i32, args: Vec<HandleValue>) -> i32 {
|
||||
self.upcast::<GlobalScope>().set_timeout_or_interval(
|
||||
TimerCallback::FunctionTimerCallback(callback),
|
||||
args,
|
||||
|
@ -277,8 +279,10 @@ impl WorkerGlobalScopeMethods for WorkerGlobalScope {
|
|||
IsInterval::NonInterval)
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
// https://html.spec.whatwg.org/multipage/#dom-windowtimers-settimeout
|
||||
fn SetTimeout_(&self, _cx: *mut JSContext, callback: DOMString, timeout: i32, args: Vec<HandleValue>) -> i32 {
|
||||
unsafe fn SetTimeout_(&self, _cx: *mut JSContext, callback: DOMString,
|
||||
timeout: i32, args: Vec<HandleValue>) -> i32 {
|
||||
self.upcast::<GlobalScope>().set_timeout_or_interval(
|
||||
TimerCallback::StringTimerCallback(callback),
|
||||
args,
|
||||
|
@ -291,8 +295,10 @@ impl WorkerGlobalScopeMethods for WorkerGlobalScope {
|
|||
self.upcast::<GlobalScope>().clear_timeout_or_interval(handle);
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
// https://html.spec.whatwg.org/multipage/#dom-windowtimers-setinterval
|
||||
fn SetInterval(&self, _cx: *mut JSContext, callback: Rc<Function>, timeout: i32, args: Vec<HandleValue>) -> i32 {
|
||||
unsafe fn SetInterval(&self, _cx: *mut JSContext, callback: Rc<Function>,
|
||||
timeout: i32, args: Vec<HandleValue>) -> i32 {
|
||||
self.upcast::<GlobalScope>().set_timeout_or_interval(
|
||||
TimerCallback::FunctionTimerCallback(callback),
|
||||
args,
|
||||
|
@ -300,8 +306,10 @@ impl WorkerGlobalScopeMethods for WorkerGlobalScope {
|
|||
IsInterval::Interval)
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
// https://html.spec.whatwg.org/multipage/#dom-windowtimers-setinterval
|
||||
fn SetInterval_(&self, _cx: *mut JSContext, callback: DOMString, timeout: i32, args: Vec<HandleValue>) -> i32 {
|
||||
unsafe fn SetInterval_(&self, _cx: *mut JSContext, callback: DOMString,
|
||||
timeout: i32, args: Vec<HandleValue>) -> i32 {
|
||||
self.upcast::<GlobalScope>().set_timeout_or_interval(
|
||||
TimerCallback::StringTimerCallback(callback),
|
||||
args,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue