| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 PassRefPtrWillBeRawPtr<MessageEvent> MessageEvent::create(const AtomicString& ty
pe, const MessageEventInit& initializer, ExceptionState& exceptionState) | 136 PassRefPtrWillBeRawPtr<MessageEvent> MessageEvent::create(const AtomicString& ty
pe, const MessageEventInit& initializer, ExceptionState& exceptionState) |
| 137 { | 137 { |
| 138 if (initializer.source.get() && !isValidSource(initializer.source.get())) { | 138 if (initializer.source.get() && !isValidSource(initializer.source.get())) { |
| 139 exceptionState.throwTypeError("The optional 'source' property is neither
a Window nor MessagePort."); | 139 exceptionState.throwTypeError("The optional 'source' property is neither
a Window nor MessagePort."); |
| 140 return nullptr; | 140 return nullptr; |
| 141 } | 141 } |
| 142 return adoptRefWillBeNoop(new MessageEvent(type, initializer)); | 142 return adoptRefWillBeNoop(new MessageEvent(type, initializer)); |
| 143 } | 143 } |
| 144 | 144 |
| 145 void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bo
ol cancelable, const String& origin, const String& lastEventId, DOMWindow* sourc
e, PassOwnPtr<MessagePortArray> ports) | 145 void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bo
ol cancelable, const String& origin, const String& lastEventId, LocalDOMWindow*
source, PassOwnPtr<MessagePortArray> ports) |
| 146 { | 146 { |
| 147 if (dispatched()) | 147 if (dispatched()) |
| 148 return; | 148 return; |
| 149 | 149 |
| 150 initEvent(type, canBubble, cancelable); | 150 initEvent(type, canBubble, cancelable); |
| 151 | 151 |
| 152 m_dataType = DataTypeScriptValue; | 152 m_dataType = DataTypeScriptValue; |
| 153 m_origin = origin; | 153 m_origin = origin; |
| 154 m_lastEventId = lastEventId; | 154 m_lastEventId = lastEventId; |
| 155 m_source = source; | 155 m_source = source; |
| 156 m_ports = ports; | 156 m_ports = ports; |
| 157 } | 157 } |
| 158 | 158 |
| 159 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) | 159 void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bo
ol cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, con
st String& lastEventId, LocalDOMWindow* source, PassOwnPtr<MessagePortArray> por
ts) |
| 160 { | 160 { |
| 161 if (dispatched()) | 161 if (dispatched()) |
| 162 return; | 162 return; |
| 163 | 163 |
| 164 initEvent(type, canBubble, cancelable); | 164 initEvent(type, canBubble, cancelable); |
| 165 | 165 |
| 166 m_dataType = DataTypeSerializedScriptValue; | 166 m_dataType = DataTypeSerializedScriptValue; |
| 167 m_dataAsSerializedScriptValue = data; | 167 m_dataAsSerializedScriptValue = data; |
| 168 m_origin = origin; | 168 m_origin = origin; |
| 169 m_lastEventId = lastEventId; | 169 m_lastEventId = lastEventId; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 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 visitor->trace(m_source); |
| 191 Event::trace(visitor); | 191 Event::trace(visitor); |
| 192 } | 192 } |
| 193 | 193 |
| 194 } // namespace WebCore | 194 } // namespace WebCore |
| OLD | NEW |