| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 , m_dataAsArrayBuffer(data) | 126 , m_dataAsArrayBuffer(data) |
| 127 , m_origin(origin) | 127 , m_origin(origin) |
| 128 { | 128 { |
| 129 ScriptWrappable::init(this); | 129 ScriptWrappable::init(this); |
| 130 } | 130 } |
| 131 | 131 |
| 132 MessageEvent::~MessageEvent() | 132 MessageEvent::~MessageEvent() |
| 133 { | 133 { |
| 134 } | 134 } |
| 135 | 135 |
| 136 PassRefPtr<MessageEvent> MessageEvent::create(const AtomicString& type, const Me
ssageEventInit& 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 adoptRef(new MessageEvent(type, initializer)); | 142 return adoptRefWillBeRefCountedGarbageCollected(new MessageEvent(type, initi
alizer)); |
| 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, DOMWindow* sourc
e, 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; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Event::trace(visitor); | 190 Event::trace(visitor); |
| 191 } | 191 } |
| 192 | 192 |
| 193 } // namespace WebCore | 193 } // namespace WebCore |
| OLD | NEW |