MessagePortArray ServiceWorkerMessageEvent::ports(bool& isNull) const { if (m_ports) { isNull = false; return *m_ports; } isNull = true; return MessagePortArray(); }
MessagePortArray ExtendableMessageEvent::ports(bool& isNull) const { // TODO(bashi): Currently we return a copied array because the binding // layer could modify the content of the array while executing JS callbacks. // Avoid copying once we can make sure that the binding layer won't // modify the content. if (m_ports) { isNull = false; return *m_ports; } isNull = true; return MessagePortArray(); }