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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 , m_dataAsArrayBuffer(data) | 127 , m_dataAsArrayBuffer(data) |
128 , m_origin(origin) | 128 , m_origin(origin) |
129 { | 129 { |
130 ScriptWrappable::init(this); | 130 ScriptWrappable::init(this); |
131 } | 131 } |
132 | 132 |
133 MessageEvent::~MessageEvent() | 133 MessageEvent::~MessageEvent() |
134 { | 134 { |
135 } | 135 } |
136 | 136 |
137 PassRefPtr<MessageEvent> MessageEvent::create(const AtomicString& type, const Me
ssageEventInit& initializer, ExceptionState& exceptionState) | 137 PassRefPtrWillBeRawPtr<MessageEvent> MessageEvent::create(const AtomicString& ty
pe, const MessageEventInit& initializer, ExceptionState& exceptionState) |
138 { | 138 { |
139 if (initializer.source.get() && !isValidSource(initializer.source.get())) { | 139 if (initializer.source.get() && !isValidSource(initializer.source.get())) { |
140 exceptionState.throwTypeError("The optional 'source' property is neither
a Window nor MessagePort."); | 140 exceptionState.throwTypeError("The optional 'source' property is neither
a Window nor MessagePort."); |
141 return nullptr; | 141 return nullptr; |
142 } | 142 } |
143 return adoptRef(new MessageEvent(type, initializer)); | 143 return adoptRefCountedWillBeRefCountedGarbageCollected(new MessageEvent(type
, initializer)); |
144 } | 144 } |
145 | 145 |
146 void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bo
ol cancelable, const String& origin, const String& lastEventId, DOMWindow* sourc
e, PassOwnPtr<MessagePortArray> ports) | 146 void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bo
ol cancelable, const String& origin, const String& lastEventId, DOMWindow* sourc
e, PassOwnPtr<MessagePortArray> ports) |
147 { | 147 { |
148 if (dispatched()) | 148 if (dispatched()) |
149 return; | 149 return; |
150 | 150 |
151 initEvent(type, canBubble, cancelable); | 151 initEvent(type, canBubble, cancelable); |
152 | 152 |
153 m_dataType = DataTypeScriptValue; | 153 m_dataType = DataTypeScriptValue; |
(...skipping 30 matching lines...) Expand all Loading... |
184 { | 184 { |
185 m_ports = MessagePort::entanglePorts(*context, m_channels.release()); | 185 m_ports = MessagePort::entanglePorts(*context, m_channels.release()); |
186 } | 186 } |
187 | 187 |
188 void MessageEvent::trace(Visitor* visitor) | 188 void MessageEvent::trace(Visitor* visitor) |
189 { | 189 { |
190 Event::trace(visitor); | 190 Event::trace(visitor); |
191 } | 191 } |
192 | 192 |
193 } // namespace WebCore | 193 } // namespace WebCore |
OLD | NEW |