| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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) |
| 91 : Event(EventTypeNames::message, false, false) |
| 92 , m_dataType(DataTypeSerializedScriptValue) |
| 93 , m_dataAsSerializedScriptValue(data) |
| 94 , m_origin(origin) |
| 95 , m_lastEventId(lastEventId) |
| 96 , m_source(source) |
| 97 , m_channels(channels) |
| 98 { |
| 99 ScriptWrappable::init(this); |
| 100 if (m_dataAsSerializedScriptValue) |
| 101 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC
ontext(); |
| 102 ASSERT(isValidSource(m_source.get())); |
| 103 } |
| 104 |
| 90 MessageEvent::MessageEvent(const String& data, const String& origin) | 105 MessageEvent::MessageEvent(const String& data, const String& origin) |
| 91 : Event(EventTypeNames::message, false, false) | 106 : Event(EventTypeNames::message, false, false) |
| 92 , m_dataType(DataTypeString) | 107 , m_dataType(DataTypeString) |
| 93 , m_dataAsString(data) | 108 , m_dataAsString(data) |
| 94 , m_origin(origin) | 109 , m_origin(origin) |
| 95 { | 110 { |
| 96 ScriptWrappable::init(this); | 111 ScriptWrappable::init(this); |
| 97 } | 112 } |
| 98 | 113 |
| 99 MessageEvent::MessageEvent(PassRefPtr<Blob> data, const String& origin) | 114 MessageEvent::MessageEvent(PassRefPtr<Blob> data, const String& origin) |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 163 |
| 149 if (m_dataAsSerializedScriptValue) | 164 if (m_dataAsSerializedScriptValue) |
| 150 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC
ontext(); | 165 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC
ontext(); |
| 151 } | 166 } |
| 152 | 167 |
| 153 const AtomicString& MessageEvent::interfaceName() const | 168 const AtomicString& MessageEvent::interfaceName() const |
| 154 { | 169 { |
| 155 return EventNames::MessageEvent; | 170 return EventNames::MessageEvent; |
| 156 } | 171 } |
| 157 | 172 |
| 173 void MessageEvent::entangleMessagePorts(ExecutionContext* context) |
| 174 { |
| 175 m_ports = MessagePort::entanglePorts(*context, m_channels.release()); |
| 176 } |
| 177 |
| 158 } // namespace WebCore | 178 } // namespace WebCore |
| OLD | NEW |