| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 { | 34 { |
| 35 } | 35 } |
| 36 | 36 |
| 37 CustomEvent::CustomEvent() | 37 CustomEvent::CustomEvent() |
| 38 { | 38 { |
| 39 ScriptWrappable::init(this); | 39 ScriptWrappable::init(this); |
| 40 } | 40 } |
| 41 | 41 |
| 42 CustomEvent::CustomEvent(const AtomicString& type, const CustomEventInit& initia
lizer) | 42 CustomEvent::CustomEvent(const AtomicString& type, const CustomEventInit& initia
lizer) |
| 43 : Event(type, initializer) | 43 : Event(type, initializer) |
| 44 , m_detail(initializer.detail) | |
| 45 { | 44 { |
| 46 ScriptWrappable::init(this); | 45 ScriptWrappable::init(this); |
| 47 } | 46 } |
| 48 | 47 |
| 49 CustomEvent::~CustomEvent() | 48 CustomEvent::~CustomEvent() |
| 50 { | 49 { |
| 51 } | 50 } |
| 52 | 51 |
| 53 void CustomEvent::initCustomEvent(const AtomicString& type, bool canBubble, bool
cancelable, const ScriptValue& detail) | 52 void CustomEvent::initCustomEvent(const AtomicString& type, bool canBubble, bool
cancelable) |
| 54 { | 53 { |
| 55 ASSERT(!m_serializedScriptValue.get()); | 54 ASSERT(!m_serializedScriptValue.get()); |
| 56 if (dispatched()) | 55 if (dispatched()) |
| 57 return; | 56 return; |
| 58 | 57 |
| 59 initEvent(type, canBubble, cancelable); | 58 initEvent(type, canBubble, cancelable); |
| 60 | |
| 61 m_detail = detail; | |
| 62 } | 59 } |
| 63 | 60 |
| 64 void CustomEvent::initCustomEvent(const AtomicString& type, bool canBubble, bool
cancelable, PassRefPtr<SerializedScriptValue> serializedScriptValue) | 61 void CustomEvent::initCustomEvent(const AtomicString& type, bool canBubble, bool
cancelable, PassRefPtr<SerializedScriptValue> serializedScriptValue) |
| 65 { | 62 { |
| 66 ASSERT(m_detail.hasNoValue()); | |
| 67 if (dispatched()) | 63 if (dispatched()) |
| 68 return; | 64 return; |
| 69 | 65 |
| 70 initEvent(type, canBubble, cancelable); | 66 initEvent(type, canBubble, cancelable); |
| 71 | 67 |
| 72 m_serializedScriptValue = serializedScriptValue; | 68 m_serializedScriptValue = serializedScriptValue; |
| 73 } | 69 } |
| 74 | 70 |
| 75 const AtomicString& CustomEvent::interfaceName() const | 71 const AtomicString& CustomEvent::interfaceName() const |
| 76 { | 72 { |
| 77 return eventNames().interfaceForCustomEvent; | 73 return eventNames().interfaceForCustomEvent; |
| 78 } | 74 } |
| 79 | 75 |
| 80 } // namespace WebCore | 76 } // namespace WebCore |
| OLD | NEW |