mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
More files with CanGc fixes (#33892)
* More files with CanGc fixes Signed-off-by: L Ashwin B <lashwinib@gmail.com> * removed the can_gc inside !task Signed-off-by: L Ashwin B <lashwinib@gmail.com> --------- Signed-off-by: L Ashwin B <lashwinib@gmail.com>
This commit is contained in:
parent
fde8d72aca
commit
af6154cf63
31 changed files with 226 additions and 100 deletions
|
@ -97,7 +97,11 @@ impl Worker {
|
|||
*self.context_for_interrupt.borrow_mut() = Some(cx);
|
||||
}
|
||||
|
||||
pub fn handle_message(address: TrustedWorkerAddress, data: StructuredSerializedData) {
|
||||
pub fn handle_message(
|
||||
address: TrustedWorkerAddress,
|
||||
data: StructuredSerializedData,
|
||||
can_gc: CanGc,
|
||||
) {
|
||||
let worker = address.root();
|
||||
|
||||
if worker.is_terminated() {
|
||||
|
@ -109,10 +113,18 @@ impl Worker {
|
|||
let _ac = enter_realm(target);
|
||||
rooted!(in(*GlobalScope::get_cx()) let mut message = UndefinedValue());
|
||||
if let Ok(ports) = structuredclone::read(&global, data, message.handle_mut()) {
|
||||
MessageEvent::dispatch_jsval(target, &global, message.handle(), None, None, ports);
|
||||
MessageEvent::dispatch_jsval(
|
||||
target,
|
||||
&global,
|
||||
message.handle(),
|
||||
None,
|
||||
None,
|
||||
ports,
|
||||
can_gc,
|
||||
);
|
||||
} else {
|
||||
// Step 4 of the "port post message steps" of the implicit messageport, fire messageerror.
|
||||
MessageEvent::dispatch_error(target, &global);
|
||||
MessageEvent::dispatch_error(target, &global, can_gc);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue