Assertion failure in MessagePort::contextDestroyed in http/tests/security/MessagePort...
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Dec 2017 22:47:20 +0000 (22:47 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Dec 2017 22:47:20 +0000 (22:47 +0000)
commit93d6db1bdd13dd4ea658c9f84115d53c9a68d10a
tree4695139f5c73f8da261e3d80e2e7e4cc8bf40794
parent41558dbe7a0cfcfb580fbd7720f23792685a1070
Assertion failure in MessagePort::contextDestroyed in http/tests/security/MessagePort/event-listener-context.html, usually attributed to later tests.
https://bugs.webkit.org/show_bug.cgi?id=94458

Reviewed by Chris Dumez.

Source/WebCore:

No new tests (Changed existing test to reliably crash before this change, and work after it)

There was already a glaring FIXME that said "MessagePorts should be ActiveDOMObjects"

It was right, and it fixes up this subtle lifetime issue.

* dom/MessagePort.cpp:
(WebCore::MessagePort::MessagePort):
(WebCore::MessagePort::hasPendingActivity const):
(WebCore::MessagePort::locallyEntangledPort const):
(WebCore::MessagePort::activeDOMObjectName const):
(WebCore::MessagePort::hasPendingActivity): Deleted.
(WebCore::MessagePort::locallyEntangledPort): Deleted.
* dom/MessagePort.h:

* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::~ScriptExecutionContext):
(WebCore::ScriptExecutionContext::stopActiveDOMObjects):
(WebCore::ScriptExecutionContext::hasPendingActivity const):

LayoutTests:

* fast/events/message-port-constructor-for-deleted-document-expected.txt:
* fast/events/message-port-constructor-for-deleted-document.html:
* fast/events/resources/copy-of-message-port-context-destroyed.html: Added.
* platform/mac/TestExpectations: Reenable the now-reliable and now-passing test.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/message-port-constructor-for-deleted-document-expected.txt
LayoutTests/fast/events/message-port-constructor-for-deleted-document.html
LayoutTests/fast/events/resources/copy-of-message-port-context-destroyed.html [new file with mode: 0644]
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/dom/MessagePort.cpp
Source/WebCore/dom/MessagePort.h
Source/WebCore/dom/ScriptExecutionContext.cpp