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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 : m_dataType(DataTypeScriptValue) | 46 : m_dataType(DataTypeScriptValue) |
47 { | 47 { |
48 ScriptWrappable::init(this); | 48 ScriptWrappable::init(this); |
49 } | 49 } |
50 | 50 |
51 MessageEvent::MessageEvent(const AtomicString& type, const MessageEventInit& ini
tializer) | 51 MessageEvent::MessageEvent(const AtomicString& type, const MessageEventInit& ini
tializer) |
52 : Event(type, initializer) | 52 : Event(type, initializer) |
53 , m_dataType(DataTypeScriptValue) | 53 , m_dataType(DataTypeScriptValue) |
54 , m_origin(initializer.origin) | 54 , m_origin(initializer.origin) |
55 , m_lastEventId(initializer.lastEventId) | 55 , m_lastEventId(initializer.lastEventId) |
56 , m_source(initializer.source) | 56 , m_source(isValidSource(initializer.source.get()) ? initializer.source : 0) |
57 , m_ports(adoptPtr(new MessagePortArray(initializer.ports))) | 57 , m_ports(adoptPtr(new MessagePortArray(initializer.ports))) |
58 { | 58 { |
59 ScriptWrappable::init(this); | 59 ScriptWrappable::init(this); |
60 ASSERT(isValidSource(m_source.get())); | 60 ASSERT(isValidSource(m_source.get())); |
61 } | 61 } |
62 | 62 |
63 MessageEvent::MessageEvent(const String& origin, const String& lastEventId, Pass
RefPtr<EventTarget> source, PassOwnPtr<MessagePortArray> ports) | 63 MessageEvent::MessageEvent(const String& origin, const String& lastEventId, Pass
RefPtr<EventTarget> source, PassOwnPtr<MessagePortArray> ports) |
64 : Event(eventNames().messageEvent, false, false) | 64 : Event(eventNames().messageEvent, false, false) |
65 , m_dataType(DataTypeScriptValue) | 65 , m_dataType(DataTypeScriptValue) |
66 , m_origin(origin) | 66 , m_origin(origin) |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 if (m_dataAsSerializedScriptValue) | 152 if (m_dataAsSerializedScriptValue) |
153 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC
ontext(); | 153 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC
ontext(); |
154 } | 154 } |
155 | 155 |
156 const AtomicString& MessageEvent::interfaceName() const | 156 const AtomicString& MessageEvent::interfaceName() const |
157 { | 157 { |
158 return eventNames().interfaceForMessageEvent; | 158 return eventNames().interfaceForMessageEvent; |
159 } | 159 } |
160 | 160 |
161 } // namespace WebCore | 161 } // namespace WebCore |
OLD | NEW |