| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Henry Mason (hmason@mac.com) | 2 * Copyright (C) 2007 Henry Mason (hmason@mac.com) |
| 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 return adoptRef(new MessageEvent(data, origin)); | 70 return adoptRef(new MessageEvent(data, origin)); |
| 71 } | 71 } |
| 72 static PassRefPtr<MessageEvent> create(PassRefPtr<Blob> data, const String&
origin = String()) | 72 static PassRefPtr<MessageEvent> create(PassRefPtr<Blob> data, const String&
origin = String()) |
| 73 { | 73 { |
| 74 return adoptRef(new MessageEvent(data, origin)); | 74 return adoptRef(new MessageEvent(data, origin)); |
| 75 } | 75 } |
| 76 static PassRefPtr<MessageEvent> create(PassRefPtr<ArrayBuffer> data, const S
tring& origin = String()) | 76 static PassRefPtr<MessageEvent> create(PassRefPtr<ArrayBuffer> data, const S
tring& origin = String()) |
| 77 { | 77 { |
| 78 return adoptRef(new MessageEvent(data, origin)); | 78 return adoptRef(new MessageEvent(data, origin)); |
| 79 } | 79 } |
| 80 static PassRefPtr<MessageEvent> create(const AtomicString& type, const Messa
geEventInit& initializer) | 80 static PassRefPtr<MessageEvent> create(const AtomicString& type, const Messa
geEventInit& initializer, ExceptionState&); |
| 81 { | |
| 82 return adoptRef(new MessageEvent(type, initializer)); | |
| 83 } | |
| 84 virtual ~MessageEvent(); | 81 virtual ~MessageEvent(); |
| 85 | 82 |
| 86 void initMessageEvent(const AtomicString& type, bool canBubble, bool cancela
ble, const String& origin, const String& lastEventId, DOMWindow* source, PassOwn
Ptr<MessagePortArray>); | 83 void initMessageEvent(const AtomicString& type, bool canBubble, bool cancela
ble, const String& origin, const String& lastEventId, DOMWindow* source, PassOwn
Ptr<MessagePortArray>); |
| 87 void initMessageEvent(const AtomicString& type, bool canBubble, bool cancela
ble, PassRefPtr<SerializedScriptValue> data, const String& origin, const String&
lastEventId, DOMWindow* source, PassOwnPtr<MessagePortArray>); | 84 void initMessageEvent(const AtomicString& type, bool canBubble, bool cancela
ble, PassRefPtr<SerializedScriptValue> data, const String& origin, const String&
lastEventId, DOMWindow* source, PassOwnPtr<MessagePortArray>); |
| 88 | 85 |
| 89 const String& origin() const { return m_origin; } | 86 const String& origin() const { return m_origin; } |
| 90 const String& lastEventId() const { return m_lastEventId; } | 87 const String& lastEventId() const { return m_lastEventId; } |
| 91 EventTarget* source() const { return m_source.get(); } | 88 EventTarget* source() const { return m_source.get(); } |
| 89 EventTarget* source(bool& isNull) const { isNull = !m_source; return m_sourc
e.get(); } |
| 92 MessagePortArray ports() const { return m_ports ? *m_ports : MessagePortArra
y(); } | 90 MessagePortArray ports() const { return m_ports ? *m_ports : MessagePortArra
y(); } |
| 93 MessagePortChannelArray* channels() const { return m_channels ? m_channels.g
et() : 0; } | 91 MessagePortChannelArray* channels() const { return m_channels ? m_channels.g
et() : 0; } |
| 94 | 92 |
| 95 virtual const AtomicString& interfaceName() const; | 93 virtual const AtomicString& interfaceName() const; |
| 96 | 94 |
| 97 enum DataType { | 95 enum DataType { |
| 98 DataTypeScriptValue, | 96 DataTypeScriptValue, |
| 99 DataTypeSerializedScriptValue, | 97 DataTypeSerializedScriptValue, |
| 100 DataTypeString, | 98 DataTypeString, |
| 101 DataTypeBlob, | 99 DataTypeBlob, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // m_ports are the MessagePorts in an engtangled state, and m_channels are | 135 // m_ports are the MessagePorts in an engtangled state, and m_channels are |
| 138 // the MessageChannels in a disentangled state. Only one of them can be | 136 // the MessageChannels in a disentangled state. Only one of them can be |
| 139 // non-empty at a time. entangleMessagePorts() moves between the states. | 137 // non-empty at a time. entangleMessagePorts() moves between the states. |
| 140 OwnPtr<MessagePortArray> m_ports; | 138 OwnPtr<MessagePortArray> m_ports; |
| 141 OwnPtr<MessagePortChannelArray> m_channels; | 139 OwnPtr<MessagePortChannelArray> m_channels; |
| 142 }; | 140 }; |
| 143 | 141 |
| 144 } // namespace WebCore | 142 } // namespace WebCore |
| 145 | 143 |
| 146 #endif // MessageEvent_h | 144 #endif // MessageEvent_h |
| OLD | NEW |