diff options
Diffstat (limited to 'WebCore/dom/MessagePort.h')
| -rw-r--r-- | WebCore/dom/MessagePort.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/WebCore/dom/MessagePort.h b/WebCore/dom/MessagePort.h index 0ab0f50..ae1eb22 100644 --- a/WebCore/dom/MessagePort.h +++ b/WebCore/dom/MessagePort.h @@ -103,7 +103,10 @@ namespace WebCore { // Returns null otherwise. // NOTE: This is used solely to enable a GC optimization. Some platforms may not be able to determine ownership of the remote port (since it may live cross-process) - those platforms may always return null. MessagePort* locallyEntangledPort(); - bool isEntangled() { return m_entangledChannel; } + // A port starts out its life entangled, and remains entangled until it is closed or is cloned. + bool isEntangled() { return !m_closed && !isCloned(); } + // A port is cloned if its entangled channel has been removed and sent to a new owner via postMessage(). + bool isCloned() { return !m_entangledChannel; } private: MessagePort(ScriptExecutionContext&); @@ -116,6 +119,7 @@ namespace WebCore { OwnPtr<MessagePortChannel> m_entangledChannel; bool m_started; + bool m_closed; ScriptExecutionContext* m_scriptExecutionContext; EventTargetData m_eventTargetData; |
