mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
use ThreadSafeJSContext
instead of ContextForRequestInterrupt
(#33769)
* use `ThreadSafeJSContext` instead of `ContextForRequestInterrupt` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * use servo/mozjs Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
61a930402d
commit
7cd73ef4a7
10 changed files with 53 additions and 89 deletions
|
@ -120,8 +120,7 @@ use crate::microtask::{Microtask, MicrotaskQueue, UserMicrotask};
|
|||
use crate::realms::{enter_realm, AlreadyInRealm, InRealm};
|
||||
use crate::script_module::{DynamicModuleList, ModuleScript, ModuleTree, ScriptFetchOptions};
|
||||
use crate::script_runtime::{
|
||||
CanGc, CommonScriptMsg, ContextForRequestInterrupt, JSContext as SafeJSContext, ScriptChan,
|
||||
ScriptPort,
|
||||
CanGc, CommonScriptMsg, JSContext as SafeJSContext, ScriptChan, ScriptPort, ThreadSafeJSContext,
|
||||
};
|
||||
use crate::script_thread::{MainThreadScriptChan, ScriptThread};
|
||||
use crate::security_manager::CSPViolationReporter;
|
||||
|
@ -151,7 +150,8 @@ pub struct AutoCloseWorker {
|
|||
#[no_trace]
|
||||
control_sender: Sender<DedicatedWorkerControlMsg>,
|
||||
/// The context to request an interrupt on the worker thread.
|
||||
context: ContextForRequestInterrupt,
|
||||
#[no_trace]
|
||||
context: ThreadSafeJSContext,
|
||||
}
|
||||
|
||||
impl Drop for AutoCloseWorker {
|
||||
|
@ -168,7 +168,7 @@ impl Drop for AutoCloseWorker {
|
|||
warn!("Couldn't send an exit message to a dedicated worker.");
|
||||
}
|
||||
|
||||
self.context.request_interrupt();
|
||||
self.context.request_interrupt_callback();
|
||||
|
||||
// TODO: step 2 and 3.
|
||||
// Step 4 is unnecessary since we don't use actual ports for dedicated workers.
|
||||
|
@ -2115,7 +2115,7 @@ impl GlobalScope {
|
|||
closing: Arc<AtomicBool>,
|
||||
join_handle: JoinHandle<()>,
|
||||
control_sender: Sender<DedicatedWorkerControlMsg>,
|
||||
context: ContextForRequestInterrupt,
|
||||
context: ThreadSafeJSContext,
|
||||
) {
|
||||
self.list_auto_close_worker
|
||||
.borrow_mut()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue