Messages posted to a closed MessagePort should not be deliverd. |
|||||||
Issue description
The following patch updates one of our layout tests to add a test to make sure that messages that are posted to a (transfered) closed port don't actually still arive. And this test fails. Once a port is closed any messages sent to it should disappear.
diff --git a/third_party/WebKit/LayoutTests/fast/events/message-port-clone.html b/third_party/WebKit/LayoutTests/fast/events/message-port-clone.html
index e158ec6..88d1f03 100644
--- a/third_party/WebKit/LayoutTests/fast/events/message-port-clone.html
+++ b/third_party/WebKit/LayoutTests/fast/events/message-port-clone.html
@@ -95,6 +95,9 @@ function testPostClosePort()
{
var channel = new MessageChannel;
var channel2 = new MessageChannel;
+ channel2.port1.onmessage = function(evt) {
+ testFailed("Message sent to closed port should not arrive.");
+ }
channel2.port2.close();
channel.port1.postMessage("closed", [channel2.port2]);
channel.port2.onmessage = function(evt) {
@@ -102,8 +105,10 @@ function testPostClosePort()
shouldNotBe("testEvent.ports", "null");
shouldBe("testEvent.ports.length", "1");
shouldBe("testEvent.data", "'closed'");
-
- finishJSTest();
+ testEvent.ports[0].postMessage('Should not arrive');
+ setTimeout(function() {
+ finishJSTest();
+ }, 100);
}
}
,
Feb 6 2017
Has this been fixed? In any case, looks like this is not an untriaged issue in the least. :) As part of platform predictability, we have been pinging untriaged "Hotlist-Interop" bugs.
,
Feb 6 2017
Nope, hasn't been fixed. And I believe the in-progress mojo rewrite of MessagePort has the same bug. I guess nobody is actively triaging Blink>Messaging bugs yet. Marking this as available is probably the right thing to do.
,
Feb 7 2017
This seems straightforward (and P3/Available is probably a suitable triage, thanks), but probably ought to wait until after Darin's refactor lands.
,
Feb 7 2017
It's not quite straight forward, especially after Darin's refactor, as mojo doesn't entirely have the concept of transfering a closed message pipe. But one possible work-around would be to just represent closed message pipes by creating a new message pipe and throwing one end away. So yeah, not complicated, but a little bit tricky.
,
Sep 13 2017
,
Sep 28 2017
,
Oct 2 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/419b66b54c98e04141e5e966d905dbb371314770 commit 419b66b54c98e04141e5e966d905dbb371314770 Author: Marijn Kruisselbrink <mek@chromium.org> Date: Mon Oct 02 20:30:24 2017 Fix behavior around closed message ports. Connect a closed message port to a dangling message pipe to make sure messages posted to the port end up getting lost, even after the message port is transferred to a different process. Bug: 673526 Change-Id: I95467bf5c3e1af316c8781bcca6dfdda29936fe8 Reviewed-on: https://chromium-review.googlesource.com/690981 Reviewed-by: Jeremy Roman <jbroman@chromium.org> Commit-Queue: Marijn Kruisselbrink <mek@chromium.org> Cr-Commit-Position: refs/heads/master@{#505760} [modify] https://crrev.com/419b66b54c98e04141e5e966d905dbb371314770/third_party/WebKit/LayoutTests/TestExpectations [modify] https://crrev.com/419b66b54c98e04141e5e966d905dbb371314770/third_party/WebKit/Source/core/dom/MessagePort.cpp
,
Oct 2 2017
,
Oct 3 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/db3d89459575f0c658c562baa2d3d55648e6767c commit db3d89459575f0c658c562baa2d3d55648e6767c Author: Marijn Kruisselbrink <mek@chromium.org> Date: Tue Oct 03 16:32:02 2017 Revert "Fix behavior around closed message ports." This reverts commit 419b66b54c98e04141e5e966d905dbb371314770. Reason for revert: Depends on MessagePort onion-soupification, which needs to be reverted for performance issues. Original change's description: > Fix behavior around closed message ports. > > Connect a closed message port to a dangling message pipe to make sure > messages posted to the port end up getting lost, even after the message > port is transferred to a different process. > > Bug: 673526 > Change-Id: I95467bf5c3e1af316c8781bcca6dfdda29936fe8 > Reviewed-on: https://chromium-review.googlesource.com/690981 > Reviewed-by: Jeremy Roman <jbroman@chromium.org> > Commit-Queue: Marijn Kruisselbrink <mek@chromium.org> > Cr-Commit-Position: refs/heads/master@{#505760} TBR=jbroman@chromium.org,mek@chromium.org Change-Id: Ia2cead94d083c2f27b8be8c451de0ce1a06c2866 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 673526 , 770834 Reviewed-on: https://chromium-review.googlesource.com/698284 Reviewed-by: Marijn Kruisselbrink <mek@chromium.org> Commit-Queue: Marijn Kruisselbrink <mek@chromium.org> Cr-Commit-Position: refs/heads/master@{#506067} [modify] https://crrev.com/db3d89459575f0c658c562baa2d3d55648e6767c/third_party/WebKit/LayoutTests/TestExpectations [modify] https://crrev.com/db3d89459575f0c658c562baa2d3d55648e6767c/third_party/WebKit/Source/core/dom/MessagePort.cpp
,
Oct 3 2017
,
Oct 4 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c43f07d4b4907d52a57af8e8bbfea949c168491b commit c43f07d4b4907d52a57af8e8bbfea949c168491b Author: Marijn Kruisselbrink <mek@chromium.org> Date: Wed Oct 04 20:59:31 2017 Reland "Fix behavior around closed message ports." This is a reland of 419b66b54c98e04141e5e966d905dbb371314770 Original change's description: > Fix behavior around closed message ports. > > Connect a closed message port to a dangling message pipe to make sure > messages posted to the port end up getting lost, even after the message > port is transferred to a different process. > > Bug: 673526 > Change-Id: I95467bf5c3e1af316c8781bcca6dfdda29936fe8 > Reviewed-on: https://chromium-review.googlesource.com/690981 > Reviewed-by: Jeremy Roman <jbroman@chromium.org> > Commit-Queue: Marijn Kruisselbrink <mek@chromium.org> > Cr-Commit-Position: refs/heads/master@{#505760} Conflicts: TBR=jbroman@chromium.org Bug: 673526 Change-Id: Iafdcc3e8891e80c120d270f6f04bb79a55092067 Reviewed-on: https://chromium-review.googlesource.com/700323 Reviewed-by: Marijn Kruisselbrink <mek@chromium.org> Commit-Queue: Marijn Kruisselbrink <mek@chromium.org> Cr-Commit-Position: refs/heads/master@{#506511} [modify] https://crrev.com/c43f07d4b4907d52a57af8e8bbfea949c168491b/third_party/WebKit/LayoutTests/TestExpectations [modify] https://crrev.com/c43f07d4b4907d52a57af8e8bbfea949c168491b/third_party/WebKit/Source/core/dom/MessagePort.cpp
,
Oct 4 2017
|
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by bugdroid1@chromium.org
, Jan 18 2017