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 22 matching lines...) Expand all Loading... |
33 | 33 |
34 namespace WebCore { | 34 namespace WebCore { |
35 | 35 |
36 MessageEventInit::MessageEventInit() | 36 MessageEventInit::MessageEventInit() |
37 { | 37 { |
38 } | 38 } |
39 | 39 |
40 MessageEvent::MessageEvent() | 40 MessageEvent::MessageEvent() |
41 : m_dataType(DataTypeScriptValue) | 41 : m_dataType(DataTypeScriptValue) |
42 { | 42 { |
| 43 ScriptWrappable::init(this); |
43 } | 44 } |
44 | 45 |
45 MessageEvent::MessageEvent(const AtomicString& type, const MessageEventInit& ini
tializer) | 46 MessageEvent::MessageEvent(const AtomicString& type, const MessageEventInit& ini
tializer) |
46 : Event(type, initializer) | 47 : Event(type, initializer) |
47 , m_dataType(DataTypeScriptValue) | 48 , m_dataType(DataTypeScriptValue) |
48 , m_dataAsScriptValue(initializer.data) | 49 , m_dataAsScriptValue(initializer.data) |
49 , m_origin(initializer.origin) | 50 , m_origin(initializer.origin) |
50 , m_lastEventId(initializer.lastEventId) | 51 , m_lastEventId(initializer.lastEventId) |
51 , m_source(initializer.source) | 52 , m_source(initializer.source) |
52 , m_ports(adoptPtr(new MessagePortArray(initializer.ports))) | 53 , m_ports(adoptPtr(new MessagePortArray(initializer.ports))) |
53 { | 54 { |
| 55 ScriptWrappable::init(this); |
54 } | 56 } |
55 | 57 |
56 MessageEvent::MessageEvent(const ScriptValue& data, const String& origin, const
String& lastEventId, PassRefPtr<DOMWindow> source, PassOwnPtr<MessagePortArray>
ports) | 58 MessageEvent::MessageEvent(const ScriptValue& data, const String& origin, const
String& lastEventId, PassRefPtr<DOMWindow> source, PassOwnPtr<MessagePortArray>
ports) |
57 : Event(eventNames().messageEvent, false, false) | 59 : Event(eventNames().messageEvent, false, false) |
58 , m_dataType(DataTypeScriptValue) | 60 , m_dataType(DataTypeScriptValue) |
59 , m_dataAsScriptValue(data) | 61 , m_dataAsScriptValue(data) |
60 , m_origin(origin) | 62 , m_origin(origin) |
61 , m_lastEventId(lastEventId) | 63 , m_lastEventId(lastEventId) |
62 , m_source(source) | 64 , m_source(source) |
63 , m_ports(ports) | 65 , m_ports(ports) |
64 { | 66 { |
| 67 ScriptWrappable::init(this); |
65 } | 68 } |
66 | 69 |
67 MessageEvent::MessageEvent(PassRefPtr<SerializedScriptValue> data, const String&
origin, const String& lastEventId, PassRefPtr<DOMWindow> source, PassOwnPtr<Mes
sagePortArray> ports) | 70 MessageEvent::MessageEvent(PassRefPtr<SerializedScriptValue> data, const String&
origin, const String& lastEventId, PassRefPtr<DOMWindow> source, PassOwnPtr<Mes
sagePortArray> ports) |
68 : Event(eventNames().messageEvent, false, false) | 71 : Event(eventNames().messageEvent, false, false) |
69 , m_dataType(DataTypeSerializedScriptValue) | 72 , m_dataType(DataTypeSerializedScriptValue) |
70 , m_dataAsSerializedScriptValue(data) | 73 , m_dataAsSerializedScriptValue(data) |
71 , m_origin(origin) | 74 , m_origin(origin) |
72 , m_lastEventId(lastEventId) | 75 , m_lastEventId(lastEventId) |
73 , m_source(source) | 76 , m_source(source) |
74 , m_ports(ports) | 77 , m_ports(ports) |
75 { | 78 { |
| 79 ScriptWrappable::init(this); |
76 if (m_dataAsSerializedScriptValue) | 80 if (m_dataAsSerializedScriptValue) |
77 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC
ontext(); | 81 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC
ontext(); |
78 } | 82 } |
79 | 83 |
80 MessageEvent::MessageEvent(const String& data, const String& origin) | 84 MessageEvent::MessageEvent(const String& data, const String& origin) |
81 : Event(eventNames().messageEvent, false, false) | 85 : Event(eventNames().messageEvent, false, false) |
82 , m_dataType(DataTypeString) | 86 , m_dataType(DataTypeString) |
83 , m_dataAsString(data) | 87 , m_dataAsString(data) |
84 , m_origin(origin) | 88 , m_origin(origin) |
85 , m_lastEventId("") | 89 , m_lastEventId("") |
86 { | 90 { |
| 91 ScriptWrappable::init(this); |
87 } | 92 } |
88 | 93 |
89 MessageEvent::MessageEvent(PassRefPtr<Blob> data, const String& origin) | 94 MessageEvent::MessageEvent(PassRefPtr<Blob> data, const String& origin) |
90 : Event(eventNames().messageEvent, false, false) | 95 : Event(eventNames().messageEvent, false, false) |
91 , m_dataType(DataTypeBlob) | 96 , m_dataType(DataTypeBlob) |
92 , m_dataAsBlob(data) | 97 , m_dataAsBlob(data) |
93 , m_origin(origin) | 98 , m_origin(origin) |
94 , m_lastEventId("") | 99 , m_lastEventId("") |
95 { | 100 { |
| 101 ScriptWrappable::init(this); |
96 } | 102 } |
97 | 103 |
98 MessageEvent::MessageEvent(PassRefPtr<ArrayBuffer> data, const String& origin) | 104 MessageEvent::MessageEvent(PassRefPtr<ArrayBuffer> data, const String& origin) |
99 : Event(eventNames().messageEvent, false, false) | 105 : Event(eventNames().messageEvent, false, false) |
100 , m_dataType(DataTypeArrayBuffer) | 106 , m_dataType(DataTypeArrayBuffer) |
101 , m_dataAsArrayBuffer(data) | 107 , m_dataAsArrayBuffer(data) |
102 , m_origin(origin) | 108 , m_origin(origin) |
103 , m_lastEventId("") | 109 , m_lastEventId("") |
104 { | 110 { |
| 111 ScriptWrappable::init(this); |
105 } | 112 } |
106 | 113 |
107 MessageEvent::~MessageEvent() | 114 MessageEvent::~MessageEvent() |
108 { | 115 { |
109 } | 116 } |
110 | 117 |
111 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) | 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) |
112 { | 119 { |
113 if (dispatched()) | 120 if (dispatched()) |
114 return; | 121 return; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 } | 173 } |
167 initMessageEvent(type, canBubble, cancelable, data, origin, lastEventId, sou
rce, ports.release()); | 174 initMessageEvent(type, canBubble, cancelable, data, origin, lastEventId, sou
rce, ports.release()); |
168 } | 175 } |
169 | 176 |
170 const AtomicString& MessageEvent::interfaceName() const | 177 const AtomicString& MessageEvent::interfaceName() const |
171 { | 178 { |
172 return eventNames().interfaceForMessageEvent; | 179 return eventNames().interfaceForMessageEvent; |
173 } | 180 } |
174 | 181 |
175 } // namespace WebCore | 182 } // namespace WebCore |
OLD | NEW |