| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "modules/serviceworkers/ExtendableEvent.h" | 31 #include "modules/serviceworkers/ExtendableEvent.h" |
| 32 | 32 |
| 33 #include "bindings/core/v8/ScriptWrappable.h" | 33 #include "bindings/core/v8/ScriptWrappable.h" |
| 34 #include "modules/serviceworkers/WaitUntilObserver.h" | 34 #include "modules/serviceworkers/WaitUntilObserver.h" |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 ExtendableEvent* ExtendableEvent::create() | |
| 39 { | |
| 40 return new ExtendableEvent(); | |
| 41 } | |
| 42 | |
| 43 ExtendableEvent* ExtendableEvent::create(const AtomicString& type, const Extenda
bleEventInit& eventInit) | 38 ExtendableEvent* ExtendableEvent::create(const AtomicString& type, const Extenda
bleEventInit& eventInit) |
| 44 { | 39 { |
| 45 return new ExtendableEvent(type, eventInit); | 40 return new ExtendableEvent(type, eventInit); |
| 46 } | 41 } |
| 47 | 42 |
| 48 ExtendableEvent* ExtendableEvent::create(const AtomicString& type, const Extenda
bleEventInit& eventInit, WaitUntilObserver* observer) | 43 ExtendableEvent* ExtendableEvent::create(const AtomicString& type, const Extenda
bleEventInit& eventInit, WaitUntilObserver* observer) |
| 49 { | 44 { |
| 50 return new ExtendableEvent(type, eventInit, observer); | 45 return new ExtendableEvent(type, eventInit, observer); |
| 51 } | 46 } |
| 52 | 47 |
| 53 ExtendableEvent::~ExtendableEvent() | 48 ExtendableEvent::~ExtendableEvent() |
| 54 { | 49 { |
| 55 } | 50 } |
| 56 | 51 |
| 57 void ExtendableEvent::waitUntil(ScriptState* scriptState, ScriptPromise scriptPr
omise, ExceptionState& exceptionState) | 52 void ExtendableEvent::waitUntil(ScriptState* scriptState, ScriptPromise scriptPr
omise, ExceptionState& exceptionState) |
| 58 { | 53 { |
| 59 if (m_observer) | 54 if (m_observer) |
| 60 m_observer->waitUntil(scriptState, scriptPromise, exceptionState); | 55 m_observer->waitUntil(scriptState, scriptPromise, exceptionState); |
| 61 } | 56 } |
| 62 | 57 |
| 63 ExtendableEvent::ExtendableEvent() | |
| 64 { | |
| 65 } | |
| 66 | |
| 67 ExtendableEvent::ExtendableEvent(const AtomicString& type, const ExtendableEvent
Init& initializer) | 58 ExtendableEvent::ExtendableEvent(const AtomicString& type, const ExtendableEvent
Init& initializer) |
| 68 : Event(type, initializer) | 59 : Event(type, initializer) |
| 69 { | 60 { |
| 70 } | 61 } |
| 71 | 62 |
| 72 ExtendableEvent::ExtendableEvent(const AtomicString& type, const ExtendableEvent
Init& initializer, WaitUntilObserver* observer) | 63 ExtendableEvent::ExtendableEvent(const AtomicString& type, const ExtendableEvent
Init& initializer, WaitUntilObserver* observer) |
| 73 : Event(type, initializer) | 64 : Event(type, initializer) |
| 74 , m_observer(observer) | 65 , m_observer(observer) |
| 75 { | 66 { |
| 76 } | 67 } |
| 77 | 68 |
| 78 const AtomicString& ExtendableEvent::interfaceName() const | 69 const AtomicString& ExtendableEvent::interfaceName() const |
| 79 { | 70 { |
| 80 return EventNames::ExtendableEvent; | 71 return EventNames::ExtendableEvent; |
| 81 } | 72 } |
| 82 | 73 |
| 83 DEFINE_TRACE(ExtendableEvent) | 74 DEFINE_TRACE(ExtendableEvent) |
| 84 { | 75 { |
| 85 visitor->trace(m_observer); | 76 visitor->trace(m_observer); |
| 86 Event::trace(visitor); | 77 Event::trace(visitor); |
| 87 } | 78 } |
| 88 | 79 |
| 89 } // namespace blink | 80 } // namespace blink |
| OLD | NEW |