Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.
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
This adds the 'onclose' event to MessagePort. Can be removed once
https://bugs.chromium.org/p/chromium/issues/detail?id=1495616 is fixed.
diff --git a/third_party/blink/renderer/core/messaging/message_port.cc b/third_party/blink/renderer/core/messaging/message_port.cc
index 2e0961fd8c0bc8f9a2a7c124693033eb234928bd..5c54705e3c1766553e9cba13142345485ca44578 100644
--- a/third_party/blink/renderer/core/messaging/message_port.cc
+++ b/third_party/blink/renderer/core/messaging/message_port.cc
@@ -195,6 +195,7 @@ void MessagePort::close() {
Entangle(pipe.TakePort0(), nullptr);
}
closed_ = true;
+ DispatchEvent(*Event::Create(event_type_names::kClose));
void MessagePort::OnConnectionError() {
diff --git a/third_party/blink/renderer/core/messaging/message_port.idl b/third_party/blink/renderer/core/messaging/message_port.idl
index 9df43655b569428a6abc54341b4b0023e159f99b..3f1f181d9b8a66997136f870f55c97c08294b6eb 100644
--- a/third_party/blink/renderer/core/messaging/message_port.idl
+++ b/third_party/blink/renderer/core/messaging/message_port.idl
@@ -40,5 +40,5 @@
// event handlers
attribute EventHandler onmessage;
attribute EventHandler onmessageerror;
- [RuntimeEnabled=MessagePortCloseEvent] attribute EventHandler onclose;
+ attribute EventHandler onclose;
};