mirror of
https://github.com/servo/servo.git
synced 2025-09-30 08:39:16 +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
|
@ -117,6 +117,7 @@ impl DedicatedWorkerGlobalScope {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
pub fn new(init: WorkerGlobalScopeInit,
|
||||
worker_url: Url,
|
||||
from_devtools_receiver: Receiver<DevtoolScriptControlMsg>,
|
||||
|
@ -139,7 +140,9 @@ impl DedicatedWorkerGlobalScope {
|
|||
timer_event_chan,
|
||||
timer_event_port,
|
||||
closing);
|
||||
DedicatedWorkerGlobalScopeBinding::Wrap(cx, scope)
|
||||
unsafe {
|
||||
DedicatedWorkerGlobalScopeBinding::Wrap(cx, scope)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
|
@ -366,8 +369,9 @@ unsafe extern "C" fn interrupt_callback(cx: *mut JSContext) -> bool {
|
|||
}
|
||||
|
||||
impl DedicatedWorkerGlobalScopeMethods for DedicatedWorkerGlobalScope {
|
||||
#[allow(unsafe_code)]
|
||||
// https://html.spec.whatwg.org/multipage/#dom-dedicatedworkerglobalscope-postmessage
|
||||
fn PostMessage(&self, cx: *mut JSContext, message: HandleValue) -> ErrorResult {
|
||||
unsafe fn PostMessage(&self, cx: *mut JSContext, message: HandleValue) -> ErrorResult {
|
||||
let data = try!(StructuredCloneData::write(cx, message));
|
||||
let worker = self.worker.borrow().as_ref().unwrap().clone();
|
||||
self.parent_sender
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue