| 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, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 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 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 MessageEvent::MessageEvent() | 40 MessageEvent::MessageEvent() |
| 41 : m_dataType(DataTypeScriptValue) | 41 : m_dataType(DataTypeScriptValue) |
| 42 { | 42 { |
| 43 ScriptWrappable::init(this); | 43 ScriptWrappable::init(this); |
| 44 } | 44 } |
| 45 | 45 |
| 46 MessageEvent::MessageEvent(const AtomicString& type, const MessageEventInit& ini
tializer) | 46 MessageEvent::MessageEvent(const AtomicString& type, const MessageEventInit& ini
tializer) |
| 47 : Event(type, initializer) | 47 : Event(type, initializer) |
| 48 , m_dataType(DataTypeScriptValue) | 48 , m_dataType(DataTypeScriptValue) |
| 49 , m_dataAsScriptValue(initializer.data) | |
| 50 , m_origin(initializer.origin) | 49 , m_origin(initializer.origin) |
| 51 , m_lastEventId(initializer.lastEventId) | 50 , m_lastEventId(initializer.lastEventId) |
| 52 , m_source(initializer.source) | 51 , m_source(initializer.source) |
| 53 , m_ports(adoptPtr(new MessagePortArray(initializer.ports))) | 52 , m_ports(adoptPtr(new MessagePortArray(initializer.ports))) |
| 54 { | 53 { |
| 55 ScriptWrappable::init(this); | 54 ScriptWrappable::init(this); |
| 56 } | 55 } |
| 57 | 56 |
| 58 MessageEvent::MessageEvent(const ScriptValue& data, const String& origin, const
String& lastEventId, PassRefPtr<DOMWindow> source, PassOwnPtr<MessagePortArray>
ports) | 57 MessageEvent::MessageEvent(const String& origin, const String& lastEventId, Pass
RefPtr<DOMWindow> source, PassOwnPtr<MessagePortArray> ports) |
| 59 : Event(eventNames().messageEvent, false, false) | 58 : Event(eventNames().messageEvent, false, false) |
| 60 , m_dataType(DataTypeScriptValue) | 59 , m_dataType(DataTypeScriptValue) |
| 61 , m_dataAsScriptValue(data) | |
| 62 , m_origin(origin) | 60 , m_origin(origin) |
| 63 , m_lastEventId(lastEventId) | 61 , m_lastEventId(lastEventId) |
| 64 , m_source(source) | 62 , m_source(source) |
| 65 , m_ports(ports) | 63 , m_ports(ports) |
| 66 { | 64 { |
| 67 ScriptWrappable::init(this); | 65 ScriptWrappable::init(this); |
| 68 } | 66 } |
| 69 | 67 |
| 70 MessageEvent::MessageEvent(PassRefPtr<SerializedScriptValue> data, const String&
origin, const String& lastEventId, PassRefPtr<DOMWindow> source, PassOwnPtr<Mes
sagePortArray> ports) | 68 MessageEvent::MessageEvent(PassRefPtr<SerializedScriptValue> data, const String&
origin, const String& lastEventId, PassRefPtr<DOMWindow> source, PassOwnPtr<Mes
sagePortArray> ports) |
| 71 : Event(eventNames().messageEvent, false, false) | 69 : Event(eventNames().messageEvent, false, false) |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 , m_origin(origin) | 106 , m_origin(origin) |
| 109 , m_lastEventId("") | 107 , m_lastEventId("") |
| 110 { | 108 { |
| 111 ScriptWrappable::init(this); | 109 ScriptWrappable::init(this); |
| 112 } | 110 } |
| 113 | 111 |
| 114 MessageEvent::~MessageEvent() | 112 MessageEvent::~MessageEvent() |
| 115 { | 113 { |
| 116 } | 114 } |
| 117 | 115 |
| 118 void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bo
ol cancelable, const ScriptValue& data, const String& origin, const String& last
EventId, DOMWindow* source, PassOwnPtr<MessagePortArray> ports) | 116 void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bo
ol cancelable, const String& origin, const String& lastEventId, DOMWindow* sourc
e, PassOwnPtr<MessagePortArray> ports) |
| 119 { | 117 { |
| 120 if (dispatched()) | 118 if (dispatched()) |
| 121 return; | 119 return; |
| 122 | 120 |
| 123 initEvent(type, canBubble, cancelable); | 121 initEvent(type, canBubble, cancelable); |
| 124 | 122 |
| 125 m_dataType = DataTypeScriptValue; | 123 m_dataType = DataTypeScriptValue; |
| 126 m_dataAsScriptValue = data; | |
| 127 m_origin = origin; | 124 m_origin = origin; |
| 128 m_lastEventId = lastEventId; | 125 m_lastEventId = lastEventId; |
| 129 m_source = source; | 126 m_source = source; |
| 130 m_ports = ports; | 127 m_ports = ports; |
| 131 } | 128 } |
| 132 | 129 |
| 133 void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bo
ol cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, con
st String& lastEventId, DOMWindow* source, PassOwnPtr<MessagePortArray> ports) | 130 void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bo
ol cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, con
st String& lastEventId, DOMWindow* source, PassOwnPtr<MessagePortArray> ports) |
| 134 { | 131 { |
| 135 if (dispatched()) | 132 if (dispatched()) |
| 136 return; | 133 return; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 147 if (m_dataAsSerializedScriptValue) | 144 if (m_dataAsSerializedScriptValue) |
| 148 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC
ontext(); | 145 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC
ontext(); |
| 149 } | 146 } |
| 150 | 147 |
| 151 const AtomicString& MessageEvent::interfaceName() const | 148 const AtomicString& MessageEvent::interfaceName() const |
| 152 { | 149 { |
| 153 return eventNames().interfaceForMessageEvent; | 150 return eventNames().interfaceForMessageEvent; |
| 154 } | 151 } |
| 155 | 152 |
| 156 } // namespace WebCore | 153 } // namespace WebCore |
| OLD | NEW |