mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Auto merge of #17665 - jdm:postmessage-panic, r=KiChjang
Avoid panic when postMessage targets closed window. - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #17664 - [X] There are tests for these changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17665) <!-- Reviewable:end -->
This commit is contained in:
commit
2a575acabe
3 changed files with 26 additions and 1 deletions
|
@ -2000,7 +2000,8 @@ impl Runnable for PostMessageHandler {
|
|||
impl Window {
|
||||
pub fn post_message(&self, origin: Option<ImmutableOrigin>, data: StructuredCloneData) {
|
||||
let runnable = PostMessageHandler::new(self, origin, data);
|
||||
let msg = CommonScriptMsg::RunnableMsg(ScriptThreadEventCategory::DomEvent, box runnable);
|
||||
let runnable = self.get_runnable_wrapper().wrap_runnable(box runnable);
|
||||
let msg = CommonScriptMsg::RunnableMsg(ScriptThreadEventCategory::DomEvent, runnable);
|
||||
// TODO(#12718): Use the "posted message task source".
|
||||
let _ = self.script_chan.send(msg);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue