2020-03-13 17:00:50 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jeremy Apthorp <nornagon@nornagon.net>
|
|
|
|
Date: Wed, 4 Mar 2020 11:18:03 -0800
|
|
|
|
Subject: feat: add onclose to MessagePort
|
|
|
|
|
2023-11-14 21:21:32 +00:00
|
|
|
This adds the 'onclose' event to MessagePort. Can be removed once
|
|
|
|
https://bugs.chromium.org/p/chromium/issues/detail?id=1495616 is fixed.
|
2020-03-13 17:00:50 +00:00
|
|
|
|
|
|
|
diff --git a/third_party/blink/renderer/core/messaging/message_port.cc b/third_party/blink/renderer/core/messaging/message_port.cc
|
2023-12-11 20:58:26 +00:00
|
|
|
index 2f2a5b60423af1dbc425c44283cc2f2934bffa18..dbbe04b2447aa0769beca25c60d404b4f2209e43 100644
|
2020-03-13 17:00:50 +00:00
|
|
|
--- a/third_party/blink/renderer/core/messaging/message_port.cc
|
|
|
|
+++ b/third_party/blink/renderer/core/messaging/message_port.cc
|
2023-10-24 15:24:20 +00:00
|
|
|
@@ -195,6 +195,7 @@ void MessagePort::close() {
|
2023-09-29 05:26:41 +00:00
|
|
|
Entangle(pipe.TakePort0(), nullptr);
|
2020-03-13 17:00:50 +00:00
|
|
|
}
|
|
|
|
closed_ = true;
|
|
|
|
+ DispatchEvent(*Event::Create(event_type_names::kClose));
|
|
|
|
}
|
|
|
|
|
2023-09-29 05:26:41 +00:00
|
|
|
void MessagePort::Entangle(MessagePortDescriptor port_descriptor,
|
2020-03-13 17:00:50 +00:00
|
|
|
diff --git a/third_party/blink/renderer/core/messaging/message_port.idl b/third_party/blink/renderer/core/messaging/message_port.idl
|
2023-11-14 21:21:32 +00:00
|
|
|
index 9df43655b569428a6abc54341b4b0023e159f99b..3f1f181d9b8a66997136f870f55c97c08294b6eb 100644
|
2020-03-13 17:00:50 +00:00
|
|
|
--- a/third_party/blink/renderer/core/messaging/message_port.idl
|
|
|
|
+++ b/third_party/blink/renderer/core/messaging/message_port.idl
|
2023-11-14 21:21:32 +00:00
|
|
|
@@ -40,5 +40,5 @@
|
2020-03-13 17:00:50 +00:00
|
|
|
// event handlers
|
|
|
|
attribute EventHandler onmessage;
|
|
|
|
attribute EventHandler onmessageerror;
|
2023-11-14 21:21:32 +00:00
|
|
|
- [RuntimeEnabled=MessagePortCloseEvent] attribute EventHandler onclose;
|
2020-03-13 17:00:50 +00:00
|
|
|
+ attribute EventHandler onclose;
|
|
|
|
};
|