Repository navigation
Make MessagePort's close() set [[Detached]] - #3584
Conversation
|
Edge is doing this, but Chrome, Firefox, and Safari are not. Paging @cdumez @mkruisselbrink @bakulf @jeremyroman for thoughts. |
|
And @dstorey, just in case Edge is running into issues because of this. |
|
I've thought about it, since it definitely would make our chrome implementation a lot simpler (for a very long time we had a bug where transferring a closed message port would magically re-open it). No idea why ports were specified to behave the way they do. I do wonder how web compatible this change is? Of course there is not much point in transferring closed ports, but throwing where before we didn't throw might still cause sites to break... |
|
Yeah, Edge is shipping it which makes me think it's feasible. Though note there's other ways to disentangle ports that wouldn't make them closed. I'm not sure such a concern would go away completely. |
|
Yeah, it definitely feels like something that should be safe. I added a usecounter to chrome in https://chromium-review.googlesource.com/#/c/973693/ to hopefully verify that it is indeed not something websites "use". |
There is discussion in whatwg/html#3584 about no longer allowing this, so measure how often this actually is used. Bug: None Change-Id: Id4ccf910993df37fa1754954f4fe9fc05cbd4493 Reviewed-on: https://chromium-review.googlesource.com/973693 Reviewed-by: Jeremy Roman <[email protected]> Commit-Queue: Marijn Kruisselbrink <[email protected]> Cr-Commit-Position: refs/heads/master@{#544778}
|
@mkruisselbrink can you estimate when that use counter will hit stable, so we can set a calendar reminder to revisit this when it does? |
It landed in M67, so it hit beta today and should hit stable in ~6 weeks. So far I haven't seen a single hit though, so either I've made a mistake, or there really isn't any usage (in dev/canary). I'm at least convinced that it should be perfectly safe to make this change, up to you if you want to wait for stable numbers. |
|
It seems that @bakulf already made this change in Fx btw. |
|
Right. https://bugzil.la/1441141 Landed in Firefox 61. |
|
Hmm, should we go ahead and merge and file bugs then? |
|
Seems nobody is opposed, so that would work for me. |
|
Sigh, it's |
…tonly Automatic update from web-platform-testsMake MessagePort's close() detach For whatwg/html#3584. -- wpt-commits: b51b155ffce7a030397dc173e20628ae2742e030 wpt-pr: 10123
…tonly Automatic update from web-platform-testsMake MessagePort's close() detach For whatwg/html#3584. -- wpt-commits: b51b155ffce7a030397dc173e20628ae2742e030 wpt-pr: 10123 UltraBlame original commit: 346413cd49cafc88c2bb5a555ce3c15d9d3f3d41
…tonly Automatic update from web-platform-testsMake MessagePort's close() detach For whatwg/html#3584. -- wpt-commits: b51b155ffce7a030397dc173e20628ae2742e030 wpt-pr: 10123 UltraBlame original commit: 346413cd49cafc88c2bb5a555ce3c15d9d3f3d41
…tonly Automatic update from web-platform-testsMake MessagePort's close() detach For whatwg/html#3584. -- wpt-commits: b51b155ffce7a030397dc173e20628ae2742e030 wpt-pr: 10123 UltraBlame original commit: 346413cd49cafc88c2bb5a555ce3c15d9d3f3d41
https://bugs.webkit.org/show_bug.cgi?id=185078 Reviewed by Brent Fulgham. Throw a DataCloneError when trying to serialize a MessagePort that has been detached / closed: - whatwg/html#3584 This aligns our behavior with Gecko and the HTML specification. * LayoutTests/imported/w3c/web-platform-tests/webmessaging/message-channels/close.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/webmessaging/message-channels/close.any.worker-expected.txt: * Source/WebCore/bindings/js/SerializedScriptValue.cpp: (WebCore::SerializedScriptValue::create): * Source/WebCore/dom/MessageChannel.cpp: (WebCore::MessageChannel::MessageChannel): * Source/WebCore/dom/MessagePort.cpp: (WebCore::MessagePort::close): (WebCore::MessagePort::dispatchEvent): (WebCore::MessagePort::virtualHasPendingActivity const): * Source/WebCore/dom/MessagePort.h: Canonical link: https://commits.webkit.org/254661@main
…tonly Automatic update from web-platform-testsMake MessagePort's close() detach For whatwg/html#3584. -- wpt-commits: b51b155ffce7a030397dc173e20628ae2742e030 wpt-pr: 10123
@bakulf suggested doing this as it makes
MessageChannelobjects more consistent with other transferable objects that offer aclose()method./web-messaging.html ( diff )