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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 , m_dataType(DataTypeScriptValue) | 53 , m_dataType(DataTypeScriptValue) |
54 , m_origin(initializer.origin) | 54 , m_origin(initializer.origin) |
55 , m_lastEventId(initializer.lastEventId) | 55 , m_lastEventId(initializer.lastEventId) |
56 , m_source(isValidSource(initializer.source.get()) ? initializer.source : nu
llptr) | 56 , m_source(isValidSource(initializer.source.get()) ? initializer.source : nu
llptr) |
57 , m_ports(adoptPtr(new MessagePortArray(initializer.ports))) | 57 , m_ports(adoptPtr(new MessagePortArray(initializer.ports))) |
58 { | 58 { |
59 ScriptWrappable::init(this); | 59 ScriptWrappable::init(this); |
60 ASSERT(isValidSource(m_source.get())); | 60 ASSERT(isValidSource(m_source.get())); |
61 } | 61 } |
62 | 62 |
63 MessageEvent::MessageEvent(const String& origin, const String& lastEventId, Pass
RefPtr<EventTarget> source, PassOwnPtr<MessagePortArray> ports) | 63 MessageEvent::MessageEvent(const String& origin, const String& lastEventId, Pass
RefPtrWillBeRawPtr<EventTarget> source, PassOwnPtr<MessagePortArray> ports) |
64 : Event(EventTypeNames::message, false, false) | 64 : Event(EventTypeNames::message, false, false) |
65 , m_dataType(DataTypeScriptValue) | 65 , m_dataType(DataTypeScriptValue) |
66 , m_origin(origin) | 66 , m_origin(origin) |
67 , m_lastEventId(lastEventId) | 67 , m_lastEventId(lastEventId) |
68 , m_source(source) | 68 , m_source(source) |
69 , m_ports(ports) | 69 , m_ports(ports) |
70 { | 70 { |
71 ScriptWrappable::init(this); | 71 ScriptWrappable::init(this); |
72 ASSERT(isValidSource(m_source.get())); | 72 ASSERT(isValidSource(m_source.get())); |
73 } | 73 } |
74 | 74 |
75 MessageEvent::MessageEvent(PassRefPtr<SerializedScriptValue> data, const String&
origin, const String& lastEventId, PassRefPtr<EventTarget> source, PassOwnPtr<M
essagePortArray> ports) | 75 MessageEvent::MessageEvent(PassRefPtr<SerializedScriptValue> data, const String&
origin, const String& lastEventId, PassRefPtrWillBeRawPtr<EventTarget> source,
PassOwnPtr<MessagePortArray> ports) |
76 : Event(EventTypeNames::message, false, false) | 76 : Event(EventTypeNames::message, false, false) |
77 , m_dataType(DataTypeSerializedScriptValue) | 77 , m_dataType(DataTypeSerializedScriptValue) |
78 , m_dataAsSerializedScriptValue(data) | 78 , m_dataAsSerializedScriptValue(data) |
79 , m_origin(origin) | 79 , m_origin(origin) |
80 , m_lastEventId(lastEventId) | 80 , m_lastEventId(lastEventId) |
81 , m_source(source) | 81 , m_source(source) |
82 , m_ports(ports) | 82 , m_ports(ports) |
83 { | 83 { |
84 ScriptWrappable::init(this); | 84 ScriptWrappable::init(this); |
85 if (m_dataAsSerializedScriptValue) | 85 if (m_dataAsSerializedScriptValue) |
86 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC
ontext(); | 86 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC
ontext(); |
87 ASSERT(isValidSource(m_source.get())); | 87 ASSERT(isValidSource(m_source.get())); |
88 } | 88 } |
89 | 89 |
90 MessageEvent::MessageEvent(PassRefPtr<SerializedScriptValue> data, const String&
origin, const String& lastEventId, PassRefPtr<EventTarget> source, PassOwnPtr<M
essagePortChannelArray> channels) | 90 MessageEvent::MessageEvent(PassRefPtr<SerializedScriptValue> data, const String&
origin, const String& lastEventId, PassRefPtrWillBeRawPtr<EventTarget> source,
PassOwnPtr<MessagePortChannelArray> channels) |
91 : Event(EventTypeNames::message, false, false) | 91 : Event(EventTypeNames::message, false, false) |
92 , m_dataType(DataTypeSerializedScriptValue) | 92 , m_dataType(DataTypeSerializedScriptValue) |
93 , m_dataAsSerializedScriptValue(data) | 93 , m_dataAsSerializedScriptValue(data) |
94 , m_origin(origin) | 94 , m_origin(origin) |
95 , m_lastEventId(lastEventId) | 95 , m_lastEventId(lastEventId) |
96 , m_source(source) | 96 , m_source(source) |
97 , m_channels(channels) | 97 , m_channels(channels) |
98 { | 98 { |
99 ScriptWrappable::init(this); | 99 ScriptWrappable::init(this); |
100 if (m_dataAsSerializedScriptValue) | 100 if (m_dataAsSerializedScriptValue) |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 } | 180 } |
181 | 181 |
182 void MessageEvent::entangleMessagePorts(ExecutionContext* context) | 182 void MessageEvent::entangleMessagePorts(ExecutionContext* context) |
183 { | 183 { |
184 m_ports = MessagePort::entanglePorts(*context, m_channels.release()); | 184 m_ports = MessagePort::entanglePorts(*context, m_channels.release()); |
185 } | 185 } |
186 | 186 |
187 void MessageEvent::trace(Visitor* visitor) | 187 void MessageEvent::trace(Visitor* visitor) |
188 { | 188 { |
189 visitor->trace(m_dataAsBlob); | 189 visitor->trace(m_dataAsBlob); |
| 190 visitor->trace(m_source); |
190 Event::trace(visitor); | 191 Event::trace(visitor); |
191 } | 192 } |
192 | 193 |
193 } // namespace WebCore | 194 } // namespace WebCore |
OLD | NEW |