| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 128 |
| 129 PassRefPtrWillBeRawPtr<MessageEvent> MessageEvent::create(const AtomicString& ty
pe, const MessageEventInit& initializer, ExceptionState& exceptionState) | 129 PassRefPtrWillBeRawPtr<MessageEvent> MessageEvent::create(const AtomicString& ty
pe, const MessageEventInit& initializer, ExceptionState& exceptionState) |
| 130 { | 130 { |
| 131 if (initializer.source.get() && !isValidSource(initializer.source.get())) { | 131 if (initializer.source.get() && !isValidSource(initializer.source.get())) { |
| 132 exceptionState.throwTypeError("The optional 'source' property is neither
a Window nor MessagePort."); | 132 exceptionState.throwTypeError("The optional 'source' property is neither
a Window nor MessagePort."); |
| 133 return nullptr; | 133 return nullptr; |
| 134 } | 134 } |
| 135 return adoptRefWillBeNoop(new MessageEvent(type, initializer)); | 135 return adoptRefWillBeNoop(new MessageEvent(type, initializer)); |
| 136 } | 136 } |
| 137 | 137 |
| 138 void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bo
ol cancelable, const String& origin, const String& lastEventId, LocalDOMWindow*
source, PassOwnPtrWillBeRawPtr<MessagePortArray> ports) | 138 void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bo
ol cancelable, const String& origin, const String& lastEventId, DOMWindow* sourc
e, PassOwnPtrWillBeRawPtr<MessagePortArray> ports) |
| 139 { | 139 { |
| 140 if (dispatched()) | 140 if (dispatched()) |
| 141 return; | 141 return; |
| 142 | 142 |
| 143 initEvent(type, canBubble, cancelable); | 143 initEvent(type, canBubble, cancelable); |
| 144 | 144 |
| 145 m_dataType = DataTypeScriptValue; | 145 m_dataType = DataTypeScriptValue; |
| 146 m_origin = origin; | 146 m_origin = origin; |
| 147 m_lastEventId = lastEventId; | 147 m_lastEventId = lastEventId; |
| 148 m_source = source; | 148 m_source = source; |
| 149 m_ports = ports; | 149 m_ports = ports; |
| 150 } | 150 } |
| 151 | 151 |
| 152 void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bo
ol cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, con
st String& lastEventId, LocalDOMWindow* source, PassOwnPtrWillBeRawPtr<MessagePo
rtArray> ports) | 152 void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bo
ol cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, con
st String& lastEventId, DOMWindow* source, PassOwnPtrWillBeRawPtr<MessagePortArr
ay> ports) |
| 153 { | 153 { |
| 154 if (dispatched()) | 154 if (dispatched()) |
| 155 return; | 155 return; |
| 156 | 156 |
| 157 initEvent(type, canBubble, cancelable); | 157 initEvent(type, canBubble, cancelable); |
| 158 | 158 |
| 159 m_dataType = DataTypeSerializedScriptValue; | 159 m_dataType = DataTypeSerializedScriptValue; |
| 160 m_dataAsSerializedScriptValue = data; | 160 m_dataAsSerializedScriptValue = data; |
| 161 m_origin = origin; | 161 m_origin = origin; |
| 162 m_lastEventId = lastEventId; | 162 m_lastEventId = lastEventId; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 break; | 205 break; |
| 206 case MessageEvent::DataTypeArrayBuffer: | 206 case MessageEvent::DataTypeArrayBuffer: |
| 207 V8HiddenValue::setHiddenValue(isolate, wrapper, V8HiddenValue::arrayBuff
erData(isolate), toV8(dataAsArrayBuffer(), wrapper, isolate)); | 207 V8HiddenValue::setHiddenValue(isolate, wrapper, V8HiddenValue::arrayBuff
erData(isolate), toV8(dataAsArrayBuffer(), wrapper, isolate)); |
| 208 break; | 208 break; |
| 209 } | 209 } |
| 210 | 210 |
| 211 return wrapper; | 211 return wrapper; |
| 212 } | 212 } |
| 213 | 213 |
| 214 } // namespace blink | 214 } // namespace blink |
| OLD | NEW |